-
Notifications
You must be signed in to change notification settings - Fork 673
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(autoware_mpc_lateral_controller): add predicted trajectory acconts for input delay #8436
feat(autoware_mpc_lateral_controller): add predicted trajectory acconts for input delay #8436
Conversation
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
dd1943f
to
09b2739
Compare
predicted_trajectory = calculatePredictedTrajectory( | ||
mpc_matrix, x0, Uex, mpc_resampled_ref_trajectory, prediction_dt, "world"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason not to apply the input delay to the official predicted trajectory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takayuki5168
Based on my understanding, it's better to apply the input delay for the official predicted path. In my additional tests, I've found that when reducing steer_tau, the original predicted path tends to oscillate, whereas the predicted path that considers delay follows the reference path more closely.
However, as an answer to the question, there are no reasons other than conservative ones. The main concern is that the change could affect the validation functionality in the latter stages. Therefore, I am proposing a configuration that allows for visualization for comparison purposes.
Do you think we should adopt a path that considers input_delay as the official predicted path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the control_validator and lane_departure_checker which depend on the predicted path are not used so much, so I think we do not have to be sensitive to that. This is not my strong opinion, but I feel that changing sooner is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takayuki5168
How about adopting the predicted path that considers input delay as the official version, while keeping an option to revert to the original predicted path just in case? I've done some light verification on my end by changing vehicle parameters and trying several rosbags, and it seems fine, but it's better to be prepared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takayuki5168
addressed in c10f9fd
auto predicted_trajectory_frenet = calculatePredictedTrajectory( | ||
mpc_matrix, x0, Uex, mpc_resampled_ref_trajectory, prediction_dt, "frenet"); | ||
predicted_trajectory_frenet.header.stamp = m_clock->now(); | ||
predicted_trajectory_frenet.header.frame_id = "map"; | ||
m_debug_frenet_predicted_trajectory_pub->publish(predicted_trajectory_frenet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like considering the input delay will have more accuracy. Any reason not to consider the input delay here?
09b2739
to
c10f9fd
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8436 +/- ##
==========================================
- Coverage 25.02% 24.95% -0.08%
==========================================
Files 1322 1325 +3
Lines 98047 98438 +391
Branches 37795 37896 +101
==========================================
+ Hits 24536 24562 +26
- Misses 71020 71382 +362
- Partials 2491 2494 +3
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
c10f9fd
to
7386c3c
Compare
f021f03
to
febc057
Compare
The code changes add a new publisher for the debug predicted trajectory with delay. Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
…ajectories and small refactoring Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
…autowarefoundation#8497) Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp> Co-authored-by: Yi-Hsiang Fang (Vivid) <146902905+vividf@users.noreply.github.com>
…th in README (autowarefoundation#8496) Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@tier4.jp>
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
…ajectories This commit enables the debug publishing of predicted trajectory and resampled reference trajectory for debugging purposes. It also includes small refactoring changes. Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp> Signed-off-by: Kyoichi Sugahara <kyoichi.sugahara@tier4.jp>
272ba06
to
17a4b8a
Compare
67d9b8e
into
autowarefoundation:main
…ts for input delay (autowarefoundation#8436) * feat: enable delayed initial state for predicted trajectory Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp> * feat: enable debug publishing of predicted and resampled reference trajectories Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp> --------- Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp> Signed-off-by: emuemuJP <k.matsumoto.0807@gmail.com>
…ts for input delay (autowarefoundation#8436) * feat: enable delayed initial state for predicted trajectory Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp> * feat: enable debug publishing of predicted and resampled reference trajectories Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp> --------- Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Description
merging this PR first.
Current Implementation Issue
The MPC optimization calculation uses an initial state that accounts for input delay. However, in the current implementation, when calculating the predicted trajectory from the obtained solution, it uses the currently observed state instead of the state that considers this delay. This creates an inconsistency between the optimization calculation and the trajectory prediction.
New Visualization Option
To verify the accuracy of following the reference trajectory, I have added an option to visualize the resampled reference trajectory.
Initial Findings
/control/trajectory_follower/controller_node_exe/debug/resampled_reference_trajectory
/control/trajectory_follower/controller_node_exe/debug/predicted_trajectory_with_delay
/control/trajectory_follower/lateral/predicted_trajectory
How was this PR tested?
by visualizing predicted trajectory w/wo delay and reference trajectory
2024-08-10_22.09.13.mp4
Notes for reviewers
Ideally, we should interpolate the trajectory from the current state to the state considering input delay, and then generate the predicted trajectory from this delay-considered state. Please note that the trajectory visualized in this PR generates the predicted trajectory directly from the delay-considered state without performing this interpolation.
ROS Parameter Changes
Additions and removals
debug_publish_resampled_reference_trajectory
bool
false