Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(path_optimizer): additional failure logging and failure mode handling #1905

Merged
merged 2 commits into from
Mar 18, 2025

Conversation

PanConChicharron
Copy link

@PanConChicharron PanConChicharron commented Mar 12, 2025

Description

Returns the smoothed_points trajectory fed into MPT when the latter fails, triggers an emergency stop MRM after 3s.

Related links

Parent Issue:

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added documentation Improvements or additions to documentation control planning common launch labels Mar 12, 2025
@PanConChicharron PanConChicharron force-pushed the arjun.ram/RT0-33698 branch 2 times, most recently from ae2a9a3 to 1fcebfb Compare March 13, 2025 06:00
@PanConChicharron PanConChicharron changed the base branch from beta/v0.11.3 to beta/v0.29.0-3 March 13, 2025 06:01
@PanConChicharron PanConChicharron force-pushed the arjun.ram/RT0-33698 branch 3 times, most recently from ca881f7 to 4f84b91 Compare March 14, 2025 08:35
@PanConChicharron PanConChicharron marked this pull request as ready for review March 14, 2025 08:37
@PanConChicharron PanConChicharron changed the base branch from beta/v0.29.0-3 to beta/v0.29.0-2 March 14, 2025 08:38
@PanConChicharron PanConChicharron force-pushed the arjun.ram/RT0-33698 branch 2 times, most recently from 0078eea to 56f8eb4 Compare March 14, 2025 09:00
Comment on lines 404 to 407
const bool apply_input_velocity = !(optimized_traj_failed || elapsed_time_over_three_seconds);
mrm_required_ = optimized_traj_failed && elapsed_time_over_three_seconds;

if (!apply_input_velocity) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this part for the new velocity change. The reported issue will not happen since we have a short time condition to trigger MRM.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

return getPrevOptimizedTrajectory(p.traj_points);
}

if (enable_skip_optimization_) {
mrm_required_ = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of inserting mrm_required_ = false; one by one, let's put it at the beginning of the optimizeTrajectory function only once.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -75,6 +78,7 @@ class PathOptimizer : public rclcpp::Node
bool enable_outside_drivable_area_stop_;
bool enable_skip_optimization_;
bool enable_reset_prev_optimization_;
bool mrm_required_{false};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Publishing the diagnostics does not mean triggering the MRM since it depends on the setting of the system packages.
So, is_optimization_failed_ or something would be proper.

@@ -301,6 +310,21 @@ bool PathOptimizer::checkInputPath(const Path & path, rclcpp::Clock clock) const
return true;
}

void PathOptimizer::onCheckPathOptimizationValid(diagnostic_updater::DiagnosticStatusWrapper & stat)
{
const std::string error_msg = "[Path Optimizer]: MRM not required";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment as above of "Publishing the diagnostics does not mean triggering the MRM since it depends on the setting of the system packages."
IMO, we should remove the word "MRM" from here, and just letting the latter module know that the path_optimizer has xxx kind of error would be enough.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -110,7 +183,7 @@ class MPTOptimizer
const TrajectoryParam & traj_param, const std::shared_ptr<DebugData> debug_data_ptr,
const std::shared_ptr<autoware::universe_utils::TimeKeeper> time_keeper_);

std::vector<TrajectoryPoint> optimizeTrajectory(const PlannerData & planner_data);
std::pair<std::vector<TrajectoryPoint>, int> optimizeTrajectory(const PlannerData & planner_data);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using std::pair with int, please use std::optional<std::vector>.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@PanConChicharron PanConChicharron changed the title feat(obstacle_avoidance_planner): additional failure logging and failure mode handling feat(path_optimizer): additional failure logging and failure mode handling Mar 18, 2025
@PanConChicharron PanConChicharron force-pushed the arjun.ram/RT0-33698 branch 2 times, most recently from 71b3f96 to 9b96851 Compare March 18, 2025 10:28
Signed-off-by: Arjun Jagdish Ram <arjun.ram@tier4.jp>
@PanConChicharron PanConChicharron merged commit 30880cc into beta/v0.29.0-2 Mar 18, 2025
21 of 23 checks passed
@PanConChicharron PanConChicharron deleted the arjun.ram/RT0-33698 branch March 18, 2025 10:45
@PanConChicharron PanConChicharron restored the arjun.ram/RT0-33698 branch March 18, 2025 10:48
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

saka1-s pushed a commit that referenced this pull request Mar 24, 2025
…dling (#1905)

* conditional timer - MRM trigger

Signed-off-by: Arjun Jagdish Ram <arjun.ram@tier4.jp>

* style(pre-commit): autofix

---------

Signed-off-by: Arjun Jagdish Ram <arjun.ram@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
saka1-s pushed a commit that referenced this pull request Mar 24, 2025
…dling (#1905)

* conditional timer - MRM trigger

Signed-off-by: Arjun Jagdish Ram <arjun.ram@tier4.jp>

* style(pre-commit): autofix

---------

Signed-off-by: Arjun Jagdish Ram <arjun.ram@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants