Skip to content

Commit

Permalink
fix: variable name was wrong
Browse files Browse the repository at this point in the history
Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>

fix: reduce lower limit of publish interval

Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>

fix: enlarge publish range upper limit

Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>

fix: set parameter tested and agreed

Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
  • Loading branch information
technolojin committed Apr 9, 2024
1 parent 263bb19 commit f9b483d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void MultiObjectTracker::onMeasurement(
publish(measurement_time);
} else {
// Publish if the next publish time is close
const double minimum_publish_interval = publisher_period_ * 0.7; // 70% of the period
const double minimum_publish_interval = publisher_period_ * 0.70; // 70% of the period
if ((this->now() - last_published_time_).seconds() > minimum_publish_interval) {
checkAndPublish(this->now());
}

Check warning on line 213 in perception/multi_object_tracker/src/multi_object_tracker_core.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

MultiObjectTracker::onMeasurement increases in cyclomatic complexity from 11 to 12, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.

Check notice on line 213 in perception/multi_object_tracker/src/multi_object_tracker_core.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

ℹ Getting worse: Bumpy Road Ahead

MultiObjectTracker::onMeasurement increases from 2 to 3 logical blocks with deeply nested code, threshold is one single block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
Expand Down Expand Up @@ -247,8 +247,8 @@ void MultiObjectTracker::onTimer()
// check the publish period
const auto elapsed_time = (current_time - last_published_time_).seconds();
// if the elapsed time is over the period, publish objects with prediction
constexpr double latency_ratio = 1.11; // 11% margin
const double maximum_publish_latency = publisher_period_ * latest_publish_latency_ratio;
constexpr double maximum_latency_ratio = 1.11; // 11% margin
const double maximum_publish_latency = publisher_period_ * maximum_latency_ratio;
if (elapsed_time > maximum_publish_latency) {
checkAndPublish(current_time);
}
Expand Down

0 comments on commit f9b483d

Please sign in to comment.