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(control_performance_analysis): add new functionalities to evaluate the control modules #659

Merged

Conversation

brkay54
Copy link
Member

@brkay54 brkay54 commented Apr 8, 2022

Description

Please see (#567).

To close this issue, I want to add new functionalities to control_performance_analysis package.

New Design:

benchmark drawio(1)

The outputs which are marked with * will be added.

With this design, we can monitor the motion variables of vehicle (like longitudinal acceleration, longitudinal jerk, lateral jerk etc.). For BUS ODD, we need to stay public transportation limits.

Transportation Limits

161771569-a3556e6b-0c3c-4616-9dfe-f9cf515ea4e8
Referance

Also, with trajectory_generator_node, we will able to test our control modules with custom paths without any map data.

Outputs will be added

longitudinal_velocity_error: m/s

tracking_curvature_discontinuity_ability: It will be added to see how the curvature change affect the lateral error. It will be calculated by using:
delta(curvature) * (1 / (1 + delta(lateral_error)))
(If you have any suggestion please share with me.)

longitudinal_acceleration: m/s^2

longitudinal_jerk: m/s^3

lateral_acceleration: m/s^2

lateral_jerk: m/s^3

controller_processing_time: ms

Related links

Tests performed

Notes for reviewers

  • Run the planning simulator
  • Install plotjuggler to visualize the outputs.
  • Run the control_performance_analysis tool: $ ros2 launch control_performance_analysis controller_performance_analysis.launch.xml
  • Run plotjuggler and import the layout in config/controller_monitor.xml

Now you should see the all outputs. In Cost Outputs tab, you will see the total errors. After test, you can export the statistic from plotjuggler by using CVS exporter, please select Export Statistics. In CVS file, you will see the average, maximum and minimum values of errors and driving monitor outputs. You can compare the controller modules by using these values. Also you can determine the time range by using XY Position tab.

I did not add the trajectory generator module because it may not be necessary to compare control modules. But it can be added in future to use this tool with custom generated path without any map data.

If you have any suggestion please feel free to share with me.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@brkay54 brkay54 changed the title Arranged node msgs files (#567) feat: Add new functionalities to control_performance_analysis package Apr 8, 2022
@brkay54 brkay54 added this to the Bus ODD Mar - Apr Milestone milestone Apr 8, 2022
@brkay54 brkay54 added the priority:high High urgency and importance. label Apr 8, 2022
@brkay54 brkay54 self-assigned this Apr 8, 2022
@codecov
Copy link

codecov bot commented Apr 8, 2022

Codecov Report

Merging #659 (89b9874) into main (2bbb23a) will increase coverage by 0.08%.
The diff coverage is 0.00%.

@@           Coverage Diff            @@
##            main    #659      +/-   ##
========================================
+ Coverage   9.53%   9.61%   +0.08%     
========================================
  Files        970     960      -10     
  Lines      65278   64645     -633     
  Branches   11581   11183     -398     
========================================
- Hits        6221    6217       -4     
+ Misses     53893   53265     -628     
+ Partials    5164    5163       -1     
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 9.63% <0.00%> (+0.12%) ⬆️ Carriedforward from e5579ea

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
...ce_analysis/control_performance_analysis_utils.hpp 0.00% <0.00%> (ø)
...analysis/src/control_performance_analysis_core.cpp 0.00% <0.00%> (ø)
...analysis/src/control_performance_analysis_node.cpp 0.00% <0.00%> (ø)
...nalysis/src/control_performance_analysis_utils.cpp 0.00% <ø> (ø)
common/grid_map_utils/src/polygon_iterator.cpp 58.87% <0.00%> (-4.68%) ⬇️
...est_node/include/fake_test_node/fake_test_node.hpp 39.13% <0.00%> (ø)
...ner/src/scene_module/occlusion_spot/grid_utils.cpp 0.00% <0.00%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e846c6...89b9874. Read the comment docs.

@brkay54 brkay54 changed the title feat: Add new functionalities to control_performance_analysis package feat(control_performance_analysis): Add new functionalities to evaluate the control modules Apr 8, 2022
@brkay54 brkay54 changed the title feat(control_performance_analysis): Add new functionalities to evaluate the control modules feat(control_performance_analysis): add new functionalities to evaluate the control modules Apr 8, 2022
@brkay54 brkay54 marked this pull request as draft April 8, 2022 10:33
@TakaHoribe
Copy link
Contributor

@brkay54 Thank you for the PR. The basic design looks good to me.

I have some questions:

  • what does the tracking_curvature_discontinuity_ability mean?
  • controller_processing_time is in the output of the control_performance_analysis, but it needs to be calculated in the control module itself.

FYI, some values are also calculated in the planning_evaluator node.

@brkay54
Copy link
Member Author

brkay54 commented Apr 11, 2022

* what does the `tracking_curvature_discontinuity_ability` mean?

I didn't explain it sorry for that. Actually, we want to measure the capability to deal with curvature discontinuity. It will be scored with: delta(curvature) * (1 / (1 + delta(lateral_error))) (but I'm not sure with this equation, I need to think about it more. If you have any suggestion please share with me.)

* `controller_processing_time` is in the output of the `control_performance_analysis`, but it needs to be calculated in the control module itself.

Yes you are right. I will change this output name. It will measure the time between the control messages.

FYI, some values are also calculated in the planning_evaluator node.

Thank you, I will check there.

13304490790 pushed a commit to 13304490790/autoware.universe that referenced this pull request Apr 12, 2022
* Back port .auto control packages (autowarefoundation#571)

* Implement Lateral and Longitudinal Control Muxer

* [autowarefoundation#570] Porting wf_simulator

* [autowarefoundation#1189] Deactivate flaky test in 'trajectory_follower_nodes'

* [autowarefoundation#1189] Fix flacky test in 'trajectory_follower_nodes/latlon_muxer'

* [autowarefoundation#1057] Add osqp_interface package

* [autowarefoundation#1057] Add library code for MPC-based lateral control

* [autowarefoundation#1271] Use std::abs instead of abs

* [autowarefoundation#1057] Implement Lateral Controller for Cargo ODD

* [autowarefoundation#1246] Resolve "Test case names currently use snake_case but should be CamelCase"

* [autowarefoundation#1325] Deactivate flaky smoke test in 'trajectory_follower_nodes'

* [autowarefoundation#1058] Add library code of longitudinal controller

* Fix build error for trajectory follower

Signed-off-by: wep21 <[email protected]>

* Fix build error for trajectory follower nodes

Signed-off-by: wep21 <[email protected]>

* [autowarefoundation#1272] Add AckermannControlCommand support to simple_planning_simulator

* [autowarefoundation#1058] Add Longitudinal Controller node

* [autowarefoundation#1058] Rename velocity_controller -> longitudinal_controller

* [autowarefoundation#1058] Update CMakeLists.txt for the longitudinal_controller_node

* [autowarefoundation#1058] Add smoke test python launch file

* [autowarefoundation#1058] Use LowPassFilter1d from trajectory_follower

* [autowarefoundation#1058] Use autoware_auto_msgs

* [autowarefoundation#1058] Changes for .auto (debug msg tmp fix, common func, tf listener)

* [autowarefoundation#1058] Remove unused parameters

* [autowarefoundation#1058] Fix ros test

* [autowarefoundation#1058] Rm default params from declare_parameters + use autoware types

* [autowarefoundation#1058] Use default param file to setup NodeOptions in the ros test

* [autowarefoundation#1058] Fix docstring

* [autowarefoundation#1058] Replace receiving a Twist with a VehicleKinematicState

* [autowarefoundation#1058] Change class variables format to m_ prefix

* [autowarefoundation#1058] Fix plugin name of LongitudinalController in CMakeLists.txt

* [autowarefoundation#1058] Fix copyright dates

* [autowarefoundation#1058] Reorder includes

* [autowarefoundation#1058] Add some tests (~89% coverage without disabling flaky tests)

* [autowarefoundation#1058] Add more tests (90+% coverage without disabling flaky tests)

* [autowarefoundation#1058] Use Float32MultiArrayDiagnostic message for debug and slope

* [autowarefoundation#1058] Calculate wheel_base value from vehicle parameters

* [autowarefoundation#1058] Cleanup redundant logger setting in tests

* [autowarefoundation#1058] Set ROS_DOMAIN_ID when running tests to prevent CI failures

* [autowarefoundation#1058] Remove TF listener and use published vehicle state instead

* [autowarefoundation#1058] Change smoke tests to use autoware_testing

* [autowarefoundation#1058] Add plotjuggler cfg for both lateral and longitudinal control

* [autowarefoundation#1058] Improve design documents

* [autowarefoundation#1058] Disable flaky test

* [autowarefoundation#1058] Properly transform vehicle state in longitudinal node

* [autowarefoundation#1058] Fix TF buffer of lateral controller

* [autowarefoundation#1058] Tuning of lateral controller for LGSVL

* [autowarefoundation#1058] Fix formating

* [autowarefoundation#1058] Fix /tf_static sub to be transient_local

* [autowarefoundation#1058] Fix yaw recalculation of reverse trajs in the lateral controller

* modify trajectory_follower for galactic build

Signed-off-by: Takamasa Horibe <[email protected]>

* [autowarefoundation#1379] Update trajectory_follower

* [autowarefoundation#1379] Update simple_planning_simulator

* [autowarefoundation#1379] Update trajectory_follower_nodes

* apply trajectory msg modification in control

Signed-off-by: Takamasa Horibe <[email protected]>

* move directory

Signed-off-by: Takamasa Horibe <[email protected]>

* remote control/trajectory_follower level dorectpry

Signed-off-by: Takamasa Horibe <[email protected]>

* remove .iv trajectory follower

Signed-off-by: Takamasa Horibe <[email protected]>

* use .auto trajectory_follower

Signed-off-by: Takamasa Horibe <[email protected]>

* remove .iv simple_planning_simulator & osqp_interface

Signed-off-by: Takamasa Horibe <[email protected]>

* use .iv simple_planning_simulator & osqp_interface

Signed-off-by: Takamasa Horibe <[email protected]>

* add tmp_autoware_auto_dependencies

Signed-off-by: Takamasa Horibe <[email protected]>

* tmporally add autoware_auto_msgs

Signed-off-by: Takamasa Horibe <[email protected]>

* apply .auto message split

Signed-off-by: Takamasa Horibe <[email protected]>

* fix build depend

Signed-off-by: Takamasa Horibe <[email protected]>

* fix packages using osqp

* fix autoware_auto_geometry

* ignore lint of some packages

* ignore ament_lint of some packages

* ignore lint/pre-commit of trajectory_follower_nodes

* disable unit tests of some packages

Co-authored-by: Maxime CLEMENT <[email protected]>
Co-authored-by: Joshua Whitley <[email protected]>
Co-authored-by: Igor Bogoslavskyi <[email protected]>
Co-authored-by: MIURA Yasuyuki <[email protected]>
Co-authored-by: wep21 <[email protected]>
Co-authored-by: tomoya.kimura <[email protected]>
Signed-off-by: tanaka3 <[email protected]>

* Fix message interface and tests of 'trajectory_follower_nodes' (autowarefoundation#617)

* Update longitudinal_controller_node to use VehicleOdometry

* Update lateral_controller_node for VehicleOdometry and SteeringReport

* Fix tests

Signed-off-by: tanaka3 <[email protected]>

* Change the topic name of the control_cmd to align them in trajectory_follower_node (autowarefoundation#659)

* Fix topic names

* Fix namespace

* Fix test codes

Signed-off-by: tanaka3 <[email protected]>

* Fix type of current odometry in trajectory_follower_node (autowarefoundation#666)

Signed-off-by: tanaka3 <[email protected]>

* [latlon muxer] fix gtest (autowarefoundation#670)

* fix gtest

* remove unchanged

Signed-off-by: tanaka3 <[email protected]>

* Update lateral controller (autowarefoundation#708)

* Fix parameter names of mpc_follower (autowarefoundation#1376)

* remove yaw_recalc param in mpc (autowarefoundation#1241) (autowarefoundation#1476)

* parameterize curvature num (autowarefoundation#1674) (autowarefoundation#1577)

* fix rosparam steer_rate_lim_degs to steer_rate_lim_dps in mpc_follower (autowarefoundation#1848)

* Fix spellcheck fail for some packages autowarefoundation#1842

* use interpolation::slerp (autowarefoundation#2161)

* Fix/mpc reset prev result (autowarefoundation#2185)

* add add guard (autowarefoundation#2184)

* add-mpc-optimization-status-print (autowarefoundation#2189)

* Apply ament_uncrustify

* Update control/trajectory_follower/src/qp_solver/qp_solver_osqp.cpp

Co-authored-by: Takamasa Horibe <[email protected]>

Co-authored-by: Takamasa Horibe <[email protected]>
Signed-off-by: tanaka3 <[email protected]>

* Use vehicle info utils (autowarefoundation#709)

* Use vehicle info utils and disable unit test

* Update trajectory_follower_nodes default parameters and reenable tests

* Separate vehicle info param file for test

Co-authored-by: Maxime CLEMENT <[email protected]>
Signed-off-by: tanaka3 <[email protected]>

* remove stop distance condition from stopState decision (autowarefoundation#1916) (autowarefoundation#715)

Signed-off-by: tanaka3 <[email protected]>

* velocity_controller sync to .iv develop latest (autowarefoundation#699)

* non extrapolate velocity in lerpTrajectory to avoid negative velocity just before vehicle stops (autowarefoundation#2033)

* Add keep braking function at driving state (autowarefoundation#2346)

* Add keep braking function at driving state

Signed-off-by: Makoto Kurihara <[email protected]>

* Remove debug messages

Signed-off-by: Makoto Kurihara <[email protected]>

* Fix format

Signed-off-by: Makoto Kurihara <[email protected]>

* Feature/add doc for keep braking function at driving state (autowarefoundation#2366)

* Add the description of brake keeping

Signed-off-by: Makoto Kurihara <[email protected]>

* Add the english document

Signed-off-by: Makoto Kurihara <[email protected]>

* Improve description

Signed-off-by: Makoto Kurihara <[email protected]>

* Add english description

Signed-off-by: Makoto Kurihara <[email protected]>

Co-authored-by: Takayuki Murooka <[email protected]>
Co-authored-by: Makoto Kurihara <[email protected]>
Co-authored-by: Fumiya Watanabe <[email protected]>
Signed-off-by: tanaka3 <[email protected]>

* fix topic name in plot juggler (autowarefoundation#734)

Signed-off-by: tanaka3 <[email protected]>

* Fix unstable test in trajectory_follower_nodes (autowarefoundation#731)

* Added spin_some to store tf_buffer

* add more spin

* uncomment statement

* Remove temp file

* Update control/trajectory_follower_nodes/src/lateral_controller_node.cpp

Co-authored-by: Takamasa Horibe <[email protected]>

Co-authored-by: Takamasa Horibe <[email protected]>
Signed-off-by: tanaka3 <[email protected]>

Co-authored-by: Takamasa Horibe <[email protected]>
Co-authored-by: Maxime CLEMENT <[email protected]>
Co-authored-by: Joshua Whitley <[email protected]>
Co-authored-by: Igor Bogoslavskyi <[email protected]>
Co-authored-by: MIURA Yasuyuki <[email protected]>
Co-authored-by: wep21 <[email protected]>
Co-authored-by: tomoya.kimura <[email protected]>
Co-authored-by: Maxime CLEMENT <[email protected]>
Co-authored-by: Fumiya Watanabe <[email protected]>
Co-authored-by: Takayuki Murooka <[email protected]>
Co-authored-by: Makoto Kurihara <[email protected]>
Co-authored-by: Keisuke Shima <[email protected]>
@brkay54
Copy link
Member Author

brkay54 commented Apr 13, 2022

cc @xmfcx @maxime-clem @mitsudome-r @MertClk

In current BUS ODD architecture, we have nav_msgs::Odometry output from localization stack. See here.

There is no measured acceleration output there. However in localization discussion, people decided to (I guess) add measured acceleration output to localization stack. Please see here.

Issue #567 was labeled with BUS ODD. It is little confusing. Should I assume there will be measured acceleration output from localization stack? Otherwise, I will calculate the estimated acceleration and I will evaluate the control stack with that acceleration.

@xmfcx
Copy link
Contributor

xmfcx commented Apr 19, 2022

cc @xmfcx @maxime-clem @mitsudome-r @MertClk

In current BUS ODD architecture, we have nav_msgs::Odometry output from localization stack. See here.

There is no measured acceleration output there. However in localization discussion, people decided to (I guess) add measured acceleration output to localization stack. Please see here.

Issue #567 was labeled with BUS ODD. It is little confusing. Should I assume there will be measured acceleration output from localization stack? Otherwise, I will calculate the estimated acceleration and I will evaluate the control stack with that acceleration.

We are working on a new message for the localization output, will post the PR here tomorrow.

@brkay54 brkay54 force-pushed the evaluate-control-modules branch 8 times, most recently from 90aa22b to 443485f Compare April 25, 2022 14:56
@brkay54 brkay54 marked this pull request as ready for review April 25, 2022 15:03
@brkay54
Copy link
Member Author

brkay54 commented Apr 25, 2022

@TakaHoribe @boyali it is ready for review.

@brkay54 brkay54 force-pushed the evaluate-control-modules branch 3 times, most recently from 965a88f to 0250717 Compare April 26, 2022 14:38
Copy link
Contributor

@boyali boyali left a comment

Choose a reason for hiding this comment

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

I think we need to recheck error accelerations, there are some errors in formulations maybe coming from the original.

core - line 259

error_vars.error.lateral_error_acceleration =
Vx * tan(current_steering_val) / wheelbase_ - curvature_est * Vx;
this expression is epsi_dot. I will post my notes from discord channel.

@brkay54 brkay54 force-pushed the evaluate-control-modules branch 4 times, most recently from 9ebcad3 to f4168cf Compare May 20, 2022 08:02
@brkay54
Copy link
Member Author

brkay54 commented May 20, 2022

@maxime-clem @boyali It is ready for review, instructions are written in readme.md. Can you try the evaluation tool? If you see any problem please share with me.

@brkay54 brkay54 force-pushed the evaluate-control-modules branch 2 times, most recently from a6fbbf2 to fd9e741 Compare May 20, 2022 12:23
@xmfcx xmfcx force-pushed the evaluate-control-modules branch 2 times, most recently from 6b3ab71 to c91b8a5 Compare May 24, 2022 09:32
@brkay54 brkay54 force-pushed the evaluate-control-modules branch 3 times, most recently from 6b83af7 to e3c9962 Compare May 24, 2022 11:04
@wep21 wep21 added the component:control Vehicle control algorithms and mechanisms. (auto-assigned) label May 26, 2022
Copy link
Contributor

@maxime-clem maxime-clem left a comment

Choose a reason for hiding this comment

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

I could test the updated control_performance_analysis following the instructions and it works well.
I only had issues selecting the necessary topics in plotjuggler. Otherwise the plots look good and the statistics can be exported to CSV.

@brkay54
Copy link
Member Author

brkay54 commented Jun 1, 2022

@xmfcx merge please?

@maxime-clem maxime-clem merged commit 932ff58 into autowarefoundation:main Jun 1, 2022
ktro2828 pushed a commit to ktro2828/autoware.universe that referenced this pull request Jun 7, 2022
…te the control modules (autowarefoundation#659)

Signed-off-by: Berkay <[email protected]>

Co-authored-by: M. Fatih Cırıt <[email protected]>
Signed-off-by: ktro2828 <[email protected]>
@BonoloAWF BonoloAWF removed this from the Bus ODD Mar - Apr Milestone milestone Jul 12, 2022
@brkay54 brkay54 deleted the evaluate-control-modules branch July 19, 2022 15:20
boyali referenced this pull request in boyali/autoware.universe Sep 28, 2022
…te the control modules (tier4#659)

Signed-off-by: Berkay <[email protected]>

Co-authored-by: M. Fatih Cırıt <[email protected]>
boyali referenced this pull request in boyali/autoware.universe Oct 3, 2022
…te the control modules (tier4#659)

Signed-off-by: Berkay <[email protected]>

Co-authored-by: M. Fatih Cırıt <[email protected]>
boyali referenced this pull request in boyali/autoware.universe Oct 3, 2022
…te the control modules (tier4#659)

Signed-off-by: Berkay <[email protected]>

Co-authored-by: M. Fatih Cırıt <[email protected]>
boyali referenced this pull request in boyali/autoware.universe Oct 19, 2022
…te the control modules (tier4#659)

Signed-off-by: Berkay <[email protected]>

Co-authored-by: M. Fatih Cırıt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:control Vehicle control algorithms and mechanisms. (auto-assigned) priority:high High urgency and importance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants