Repository navigation
refactor(autoware_trajectory_follower): introduce lateral controller interface - #13547
Merged
Conversation
The Controller reads the time once at the start of the cycle and passes it, instead of MpcLateralControllerNode and PurePursuitLateralControllerNode reading the clock by themselves. The pure_pursuit test now passes the time of the cycle instead of setting a simulated clock. Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp>
…ough InputData Replace set_steering_offset() with InputData::steering_offset. The Controller keeps the latest message received on ~/input/steering_offset_update and passes it in InputData, and MpcLateralController reads it from there. Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp>
… lateral run() and remove isReady() run() can now report why it cannot compute the command, so isReady() is folded into it. MpcLateralControllerNode returns an error when MpcLateralController::isReady() fails, and MpcLateralController still logs which condition failed. PurePursuitLateralControllerNode always returns a value, as its isReady() always returned true. The Controller logs the reason and skips the cycle. Include boost/optional.hpp in controller_node.hpp, which got it through lateral_controller_base.hpp. Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp>
…Base to LateralControllerInterface The class has only a pure virtual function and no state, so it is an interface rather than a base. Rename the header to lateral_controller_interface.hpp as well. Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp>
…ntrollerInterface Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp>
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13547 +/- ##
==========================================
- Coverage 38.31% 38.30% -0.01%
==========================================
Files 2034 2034
Lines 141865 141849 -16
==========================================
- Hits 54349 54336 -13
+ Misses 87516 87513 -3
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
interimadd
marked this pull request as ready for review
October 27, 2026 08:15
interimadd
requested review from
Kotakku,
PanConChicharron,
TakaHoribe,
kyoichi-sugahara,
maxime-clem,
mkquda,
takayuki5168 and
zulfaqar-azmi-t4
as code owners
October 27, 2026 08:15
Kotakku
approved these changes
Oct 27, 2026
interimadd
added a commit
to tier4/autoware_universe
that referenced
this pull request
Oct 28, 2026
…interface (autowarefoundation#13547) * refactor(autoware_trajectory_follower_base): pass stamp to lateral run() The Controller reads the time once at the start of the cycle and passes it, instead of MpcLateralControllerNode and PurePursuitLateralControllerNode reading the clock by themselves. The pure_pursuit test now passes the time of the cycle instead of setting a simulated clock. Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp> * refactor(autoware_trajectory_follower_base): pass steering offset through InputData Replace set_steering_offset() with InputData::steering_offset. The Controller keeps the latest message received on ~/input/steering_offset_update and passes it in InputData, and MpcLateralController reads it from there. Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp> * refactor(autoware_trajectory_follower_base): return tl::expected from lateral run() and remove isReady() run() can now report why it cannot compute the command, so isReady() is folded into it. MpcLateralControllerNode returns an error when MpcLateralController::isReady() fails, and MpcLateralController still logs which condition failed. PurePursuitLateralControllerNode always returns a value, as its isReady() always returned true. The Controller logs the reason and skips the cycle. Include boost/optional.hpp in controller_node.hpp, which got it through lateral_controller_base.hpp. Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp> * refactor(autoware_trajectory_follower_base): rename LateralControllerBase to LateralControllerInterface The class has only a pure virtual function and no state, so it is an interface rather than a base. Rename the header to lateral_controller_interface.hpp as well. Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp> * docs(autoware_trajectory_follower_base): update READMEs for LateralControllerInterface Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp> --------- Signed-off-by: Takahisa.Ishikawa <takahisa.ishikawa@tier4.jp>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR replaces
LateralControllerBasewithLateralControllerInterface. It makes the same change for the lateral controller that #13539 made for the longitudinal controller. The new interface has one function:The old base class had three problems. The caller had to call
isReady()beforerun(). The steering offset reached the controller through a separate function,set_steering_offset(), which the subscription callback called between two cycles.run()had no way to report a failure. With the new interface, one call gets all the data for the cycle and returns all the results.The diff is easy to read commit by commit. Each commit makes one small change, builds, and passes the tests.
pass stamp to lateral run():MpcLateralControllerNodeandPurePursuitLateralControllerNoderead the clock by themselves. Now theControllerpasses the time that it reads once at the start of the cycle. The longitudinal controller andcontrol_cmd.stampalready use this value. The pure_pursuit test now gives the time of the cycle torun()and does not set a simulated clock.pass steering offset through InputData: The new fieldInputData::steering_offsetreplacesset_steering_offset(). Its type isFloat32Stamped, the message type of~/input/steering_offset_update, because the other fields ofInputDataalso hold the received messages. TheControllerkeeps the latest message and puts it inInputData.MpcLateralControllerreads the offset fromInputData. Before the first message, the offset is 0, as before.return tl::expected from lateral run() and remove isReady(): This commit foldsisReady()intorun(). IfMpcLateralController::isReady()returnsfalse,MpcLateralControllerNode::run()returns an error.MpcLateralController::isReady()does not change, and it still logs the condition that failed.PurePursuitLateralControllerNode::isReady()always returnedtrue, so itsrun()always returns a value. TheControllerlogs the reason and skips the cycle.controller_node.hppgotboost/optional.hppthrough the old header, so this commit includes it there directly.rename LateralControllerBase to LateralControllerInterface: This is a mechanical rename of the class, the header file, and the include guard. The class has no state and no default implementation, so it is an interface and not a base.update READMEs for LateralControllerInterface: The two READMEs now describe the new interface and the new process flow.Related links
Parent Issue:
Related PRs:
How was this PR tested?
After each commit that changes the code, I ran
colcon buildandcolcon testforautoware_trajectory_follower_base,autoware_mpc_lateral_controller,autoware_pure_pursuit,autoware_pid_longitudinal_controllerandautoware_trajectory_follower_node. All tests passed.TIERIV internal Evaluator links
https://evaluation.ci.tier4.jp/evaluation/reports/946a0a1f-7474-5ece-a53b-195294a3eb65?project_id=autoware_dev
https://evaluation.ci.tier4.jp/evaluation/reports/e371500e-686b-5754-a7c0-d573f56d155a?project_id=autoware_dev
https://evaluation.ci.tier4.jp/evaluation/reports/7a316529-b6d2-5405-8db9-514b9005b1fd?project_id=autoware_dev
Notes for reviewers
Please review the PR commit by commit. Each commit is small and has one purpose.
Interface changes
None.
Effects on system behavior
None.