diff --git a/latest/404.html b/latest/404.html index 49382dca..3c4e368a 100644 --- a/latest/404.html +++ b/latest/404.html @@ -194,6 +194,98 @@
@@ -210,6 +302,422 @@
+ +
+
+
+ + + + + + +
+
+
+
diff --git a/latest/CONTRIBUTING/index.html b/latest/CONTRIBUTING/index.html index 76210d9c..5cd0b180 100644 --- a/latest/CONTRIBUTING/index.html +++ b/latest/CONTRIBUTING/index.html @@ -205,6 +205,98 @@
@@ -221,6 +313,422 @@
+ +
+
+
+ + + + + + +
+
+
+
diff --git a/latest/DISCLAIMER/index.html b/latest/DISCLAIMER/index.html index 1e6776ed..61d3986e 100644 --- a/latest/DISCLAIMER/index.html +++ b/latest/DISCLAIMER/index.html @@ -14,6 +14,8 @@ + + @@ -198,6 +200,98 @@
@@ -214,6 +308,422 @@
+ +
+
+
+ + + + + + +
+
+
+
@@ -332,6 +842,21 @@

DISCLAIMER

+ + + diff --git a/latest/common/tier4_debug_tools/index.html b/latest/common/tier4_debug_tools/index.html new file mode 100644 index 00000000..21e8e8cf --- /dev/null +++ b/latest/common/tier4_debug_tools/index.html @@ -0,0 +1,1002 @@ + + + + + + + + + + + + + + + + + + + + + + tier4_debug_tools - Autoware Universe Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

tier4_debug_tools#

+

This package provides useful features for debugging Autoware.

+

Usage#

+

tf2pose#

+

This tool converts any tf to pose topic.
+With this tool, for example, you can plot x values of tf in rqt_multiplot.

+
ros2 run tier4_debug_tools tf2pose {tf_from} {tf_to} {hz}
+
+

Example:

+
$ ros2 run tier4_debug_tools tf2pose base_link ndt_base_link 100
+
+$ ros2 topic echo /tf2pose/pose -n1
+header:
+  seq: 13
+  stamp:
+    secs: 1605168366
+    nsecs: 549174070
+  frame_id: "base_link"
+pose:
+  position:
+    x: 0.0387684271191
+    y: -0.00320360406477
+    z: 0.000276674520819
+  orientation:
+    x: 0.000335221893885
+    y: 0.000122020672186
+    z: -0.00539673212896
+    w: 0.999985368502
+---
+
+

pose2tf#

+

This tool converts any pose topic to tf.

+
ros2 run tier4_debug_tools pose2tf {pose_topic_name} {tf_name}
+
+

Example:

+
$ ros2 run tier4_debug_tools pose2tf /localization/pose_estimator/pose ndt_pose
+
+$ ros2 run tf tf_echo ndt_pose ndt_base_link 100
+At time 1605168365.449
+- Translation: [0.000, 0.000, 0.000]
+- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
+            in RPY (radian) [0.000, -0.000, 0.000]
+            in RPY (degree) [0.000, -0.000, 0.000]
+
+

stop_reason2pose#

+

This tool extracts pose from stop_reasons.
+Topics without numbers such as /stop_reason2pose/pose/detection_area are the nearest stop_reasons, and topics with numbers are individual stop_reasons that are roughly matched with previous ones.

+
ros2 run tier4_debug_tools stop_reason2pose {stop_reason_topic_name}
+
+

Example:

+
$ ros2 run tier4_debug_tools stop_reason2pose /planning/scenario_planning/status/stop_reasons
+
+$ ros2 topic list | ag stop_reason2pose
+/stop_reason2pose/pose/detection_area
+/stop_reason2pose/pose/detection_area_1
+/stop_reason2pose/pose/obstacle_stop
+/stop_reason2pose/pose/obstacle_stop_1
+
+$ ros2 topic echo /stop_reason2pose/pose/detection_area -n1
+header:
+  seq: 1
+  stamp:
+    secs: 1605168355
+    nsecs:    821713
+  frame_id: "map"
+pose:
+  position:
+    x: 60608.8433457
+    y: 43886.2410876
+    z: 44.9078212441
+  orientation:
+    x: 0.0
+    y: 0.0
+    z: -0.190261378408
+    w: 0.981733470901
+---
+
+

stop_reason2tf#

+

This is an all-in-one script that uses tf2pose, pose2tf, and stop_reason2pose.
+With this tool, you can view the relative position from base_link to the nearest stop_reason.

+
ros2 run tier4_debug_tools stop_reason2tf {stop_reason_name}
+
+

Example:

+
$ ros2 run tier4_debug_tools stop_reason2tf obstacle_stop
+At time 1605168359.501
+- Translation: [0.291, -0.095, 0.266]
+- Rotation: in Quaternion [0.007, 0.011, -0.005, 1.000]
+            in RPY (radian) [0.014, 0.023, -0.010]
+            in RPY (degree) [0.825, 1.305, -0.573]
+
+

lateral_error_publisher#

+

This node calculate the control error and localization error in the trajectory normal direction as shown in the figure below.

+

lateral_error_publisher_overview

+

Set the reference trajectory, vehicle pose and ground truth pose in the launch file.

+
ros2 launch tier4_debug_tools lateral_error_publisher.launch.xml
+
+ + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/latest/common/tier4_debug_tools/media/lateral_error_publisher.svg b/latest/common/tier4_debug_tools/media/lateral_error_publisher.svg new file mode 100644 index 00000000..9d44bc26 --- /dev/null +++ b/latest/common/tier4_debug_tools/media/lateral_error_publisher.svg @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ â‘  +
+
+
+
+ â‘  +
+
+ + + + + + + + + +
+
+
+ Closest trajectory point +
+
+
+
+ Closest trajectory poi... +
+
+ + + +
+
+
+ Next trajectory point +
+
+
+
+ Next trajectory point +
+
+ + + +
+
+
+ Trajectory +
+
+
+
+ Trajectory +
+
+ + + + +
+
+
+ Ground truth pose +
+
+
+
+ Ground truth pose +
+
+ + + + +
+
+
+ Vehicle pose +
+
+
+
+ Vehicle pose +
+
+ + + +
+
+
+ â‘¡ +
+
+
+
+ â‘¡ +
+
+ + + + +
+
+
+ â‘  Control lateral error +
+ â‘¡ Localization lateral error +
+ â‘ +â‘¡ Lateral error +
+
+
+
+ â‘  Control lateral error... +
+
+
+ + + + Viewer does not support full SVG 1.1 + + +
diff --git a/latest/index.html b/latest/index.html index 2eba2c04..c6f211a6 100644 --- a/latest/index.html +++ b/latest/index.html @@ -203,6 +203,98 @@
@@ -219,6 +311,422 @@
+ +
+
+
+ + + + + + +
+
+
+
diff --git a/latest/planning/planning_debug_tools/doc-stop-reason-visualizer/index.html b/latest/planning/planning_debug_tools/doc-stop-reason-visualizer/index.html new file mode 100644 index 00000000..f8758017 --- /dev/null +++ b/latest/planning/planning_debug_tools/doc-stop-reason-visualizer/index.html @@ -0,0 +1,957 @@ + + + + + + + + + + + + + + + + + + + + + + + + Doc stop reason visualizer - Autoware Universe Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + +

Doc stop reason visualizer

+ +

stop_reason_visualizer#

+

This module is to visualize stop factor quickly without selecting correct debug markers. +This is supposed to use with virtual wall marker like below. +image

+

How to use#

+

Run this node.

+
ros2 run planning_debug_tools stop_reason_visualizer_exe
+
+

Add stop reason debug marker from rviz.

+

image

+

Note: ros2 process can be sometimes deleted only from killall stop_reason_visualizer_exe

+

Reference

+ + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/latest/planning/planning_debug_tools/image/add_marker.png b/latest/planning/planning_debug_tools/image/add_marker.png new file mode 100644 index 00000000..f2b9992d Binary files /dev/null and b/latest/planning/planning_debug_tools/image/add_marker.png differ diff --git a/latest/planning/planning_debug_tools/image/closest-velocity-checker.png b/latest/planning/planning_debug_tools/image/closest-velocity-checker.png new file mode 100644 index 00000000..2849648d Binary files /dev/null and b/latest/planning/planning_debug_tools/image/closest-velocity-checker.png differ diff --git a/latest/planning/planning_debug_tools/image/logging_level_updater.png b/latest/planning/planning_debug_tools/image/logging_level_updater.png new file mode 100644 index 00000000..ae911400 Binary files /dev/null and b/latest/planning/planning_debug_tools/image/logging_level_updater.png differ diff --git a/latest/planning/planning_debug_tools/image/logging_level_updater_typo.png b/latest/planning/planning_debug_tools/image/logging_level_updater_typo.png new file mode 100644 index 00000000..8226c0d4 Binary files /dev/null and b/latest/planning/planning_debug_tools/image/logging_level_updater_typo.png differ diff --git a/latest/planning/planning_debug_tools/image/lua.png b/latest/planning/planning_debug_tools/image/lua.png new file mode 100644 index 00000000..7ae0e5e6 Binary files /dev/null and b/latest/planning/planning_debug_tools/image/lua.png differ diff --git a/latest/planning/planning_debug_tools/image/processing_time_checker.png b/latest/planning/planning_debug_tools/image/processing_time_checker.png new file mode 100644 index 00000000..fb064372 Binary files /dev/null and b/latest/planning/planning_debug_tools/image/processing_time_checker.png differ diff --git a/latest/planning/planning_debug_tools/image/script.png b/latest/planning/planning_debug_tools/image/script.png new file mode 100644 index 00000000..5cc8ca98 Binary files /dev/null and b/latest/planning/planning_debug_tools/image/script.png differ diff --git a/latest/planning/planning_debug_tools/image/stop_reason_image.png b/latest/planning/planning_debug_tools/image/stop_reason_image.png new file mode 100644 index 00000000..92c994ce Binary files /dev/null and b/latest/planning/planning_debug_tools/image/stop_reason_image.png differ diff --git a/latest/planning/planning_debug_tools/image/stop_reason_rviz.png b/latest/planning/planning_debug_tools/image/stop_reason_rviz.png new file mode 100644 index 00000000..1e99b959 Binary files /dev/null and b/latest/planning/planning_debug_tools/image/stop_reason_rviz.png differ diff --git a/latest/planning/planning_debug_tools/index.html b/latest/planning/planning_debug_tools/index.html new file mode 100644 index 00000000..ac6d3b4d --- /dev/null +++ b/latest/planning/planning_debug_tools/index.html @@ -0,0 +1,1190 @@ + + + + + + + + + + + + + + + + + + + + + + + + Planning Debug Tools - Autoware Universe Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

Planning Debug Tools#

+

This package contains several planning-related debug tools.

+
    +
  • Trajectory analyzer: visualizes the information (speed, curvature, yaw, etc) along the trajectory
  • +
  • Closest velocity checker: prints the velocity information indicated by each modules
  • +
  • Perception reproducer: generates detected objects from rosbag data in planning simulator environment
  • +
  • processing time checker: displays processing_time of modules on the terminal
  • +
  • logging level updater: updates the logging level of the planning modules.
  • +
+

Trajectory analyzer#

+

The trajectory_analyzer visualizes the information (speed, curvature, yaw, etc) along the trajectory. This feature would be helpful for purposes such as "investigating the reason why the vehicle decelerates here". This feature employs the OSS PlotJuggler.

+

how this works

+

Stop reason visualizer#

+

This is to visualize stop factor and reason. +see the details

+

How to use#

+

please launch the analyzer node

+
ros2 launch planning_debug_tools trajectory_analyzer.launch.xml
+
+

and visualize the analyzed data on the plot juggler following below.

+

setup PlotJuggler#

+

For the first time, please add the following code to reactive script and save it as the picture below! +(Looking for the way to automatically load the configuration file...)

+

You can customize what you plot by editing this code.

+

image

+

in Global code

+
behavior_path = '/planning/scenario_planning/lane_driving/behavior_planning/path_with_lane_id/debug_info'
+behavior_velocity = '/planning/scenario_planning/lane_driving/behavior_planning/path/debug_info'
+motion_avoid = '/planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner/trajectory/debug_info'
+motion_smoother_latacc = '/planning/scenario_planning/motion_velocity_smoother/debug/trajectory_lateral_acc_filtered/debug_info'
+motion_smoother = '/planning/scenario_planning/trajectory/debug_info'
+
+

in function(tracker_time)

+
PlotCurvatureOverArclength('k_behavior_path', behavior_path, tracker_time)
+PlotCurvatureOverArclength('k_behavior_velocity', behavior_velocity, tracker_time)
+PlotCurvatureOverArclength('k_motion_avoid', motion_avoid, tracker_time)
+PlotCurvatureOverArclength('k_motion_smoother', motion_smoother, tracker_time)
+
+PlotVelocityOverArclength('v_behavior_path', behavior_path, tracker_time)
+PlotVelocityOverArclength('v_behavior_velocity', behavior_velocity, tracker_time)
+PlotVelocityOverArclength('v_motion_avoid', motion_avoid, tracker_time)
+PlotVelocityOverArclength('v_motion_smoother_latacc', motion_smoother_latacc, tracker_time)
+PlotVelocityOverArclength('v_motion_smoother', motion_smoother, tracker_time)
+
+PlotAccelerationOverArclength('a_behavior_path', behavior_path, tracker_time)
+PlotAccelerationOverArclength('a_behavior_velocity', behavior_velocity, tracker_time)
+PlotAccelerationOverArclength('a_motion_avoid', motion_avoid, tracker_time)
+PlotAccelerationOverArclength('a_motion_smoother_latacc', motion_smoother_latacc, tracker_time)
+PlotAccelerationOverArclength('a_motion_smoother', motion_smoother, tracker_time)
+
+PlotYawOverArclength('yaw_behavior_path', behavior_path, tracker_time)
+PlotYawOverArclength('yaw_behavior_velocity', behavior_velocity, tracker_time)
+PlotYawOverArclength('yaw_motion_avoid', motion_avoid, tracker_time)
+PlotYawOverArclength('yaw_motion_smoother_latacc', motion_smoother_latacc, tracker_time)
+PlotYawOverArclength('yaw_motion_smoother', motion_smoother, tracker_time)
+
+PlotCurrentVelocity('localization_kinematic_state', '/localization/kinematic_state', tracker_time)
+
+

in Function Library +image

+ + + +
function PlotValue(name, path, timestamp, value)
+  new_series = ScatterXY.new(name)
+  index = 0
+  while(true) do
+    series_k = TimeseriesView.find( string.format( "%s/"..value..".%d", path, index) )
+    series_s = TimeseriesView.find( string.format( "%s/arclength.%d", path, index) )
+    series_size = TimeseriesView.find( string.format( "%s/size", path) )
+
+    if series_k == nil or series_s == nil then break end
+
+    k = series_k:atTime(timestamp)
+    s = series_s:atTime(timestamp)
+    size = series_size:atTime(timestamp)
+
+    if index >= size then break end
+
+    new_series:push_back(s,k)
+    index = index+1
+  end
+end
+
+function PlotCurvatureOverArclength(name, path, timestamp)
+  PlotValue(name, path, timestamp,"curvature")
+end
+
+function PlotVelocityOverArclength(name, path, timestamp)
+  PlotValue(name, path, timestamp,"velocity")
+end
+
+function PlotAccelerationOverArclength(name, path, timestamp)
+  PlotValue(name, path, timestamp,"acceleration")
+end
+
+function PlotYawOverArclength(name, path, timestamp)
+  PlotValue(name, path, timestamp,"yaw")
+end
+
+function PlotCurrentVelocity(name, kinematics_name, timestamp)
+  new_series = ScatterXY.new(name)
+  series_v = TimeseriesView.find( string.format( "%s/twist/twist/linear/x", kinematics_name))
+  if series_v == nil then
+    print("error")
+    return
+  end
+  v = series_v:atTime(timestamp)
+  new_series:push_back(0.0, v)
+end
+
+

Then, run the plot juggler.

+

How to customize the plot#

+

Add Path/PathWithLaneIds/Trajectory topics you want to plot in the trajectory_analyzer.launch.xml, then the analyzed topics for these messages will be published with TrajectoryDebugINfo.msg type. You can then visualize these data by editing the reactive script on the PlotJuggler.

+

Requirements#

+

The version of the plotJuggler must be > 3.5.0

+

Closest velocity checker#

+

This node prints the velocity information indicated by planning/control modules on a terminal. For trajectories calculated by planning modules, the target velocity on the trajectory point which is closest to the ego vehicle is printed. For control commands calculated by control modules, the target velocity and acceleration is directly printed. This feature would be helpful for purposes such as "investigating the reason why the vehicle does not move".

+

You can launch by

+
ros2 run planning_debug_tools closest_velocity_checker.py
+
+

closest-velocity-checker

+

Trajectory visualizer#

+

The old version of the trajectory analyzer. It is written in Python and more flexible, but very slow.

+

For other use case (experimental)#

+

To see behavior velocity planner's internal plath with lane id +add below example value to behavior velocity analyzer and set is_publish_debug_path: true

+
crosswalk ='/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/debug/path_with_lane_id/crosswalk/debug_info'
+intersection ='/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/debug/path_with_lane_id/intersection/debug_info'
+traffic_light ='/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/debug/path_with_lane_id/traffic_light/debug_info'
+merge_from_private ='/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/debug/path_with_lane_id/merge_from_private/debug_info'
+occlusion_spot ='/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/debug/path_with_lane_id/occlusion_spot/debug_info'
+
+
PlotVelocityOverArclength('v_crosswalk', crosswalk, tracker_time)
+PlotVelocityOverArclength('v_intersection', intersection, tracker_time)
+PlotVelocityOverArclength('v_merge_from_private', merge_from_private, tracker_time)
+PlotVelocityOverArclength('v_traffic_light', traffic_light, tracker_time)
+PlotVelocityOverArclength('v_occlusion', occlusion_spot, tracker_time)
+
+PlotYawOverArclength('yaw_crosswalk', crosswalk, tracker_time)
+PlotYawOverArclength('yaw_intersection', intersection, tracker_time)
+PlotYawOverArclength('yaw_merge_from_private', merge_from_private, tracker_time)
+PlotYawOverArclength('yaw_traffic_light', traffic_light, tracker_time)
+PlotYawOverArclength('yaw_occlusion', occlusion_spot, tracker_time)
+
+PlotCurrentVelocity('localization_kinematic_state', '/localization/kinematic_state', tracker_time)
+
+

Perception reproducer#

+

This script can overlay the perception results from the rosbag on the planning simulator synchronized with the simulator's ego pose.

+

In detail, the ego pose in the rosbag which is closest to the current ego pose in the simulator is calculated. +The perception results at the timestamp of the closest ego pose is extracted, and published.

+

How to use#

+

First, launch the planning simulator, and put the ego pose. +Then, run the script according to the following command.

+

By designating a rosbag, perception reproducer can be launched.

+
ros2 run planning_debug_tools perception_reproducer.py -b <bag-file>
+
+

You can designate multiple rosbags in the directory.

+
ros2 run planning_debug_tools perception_reproducer.py -b <dir-to-bag-files>
+
+

Instead of publishing predicted objects, you can publish detected/tracked objects by designating -d or -t, respectively.

+

Perception replayer#

+

A part of the feature is under development.

+

This script can overlay the perception results from the rosbag on the planning simulator.

+

In detail, this script publishes the data at a certain timestamp from the rosbag. +The timestamp will increase according to the real time without any operation. +By using the GUI, you can modify the timestamp by pausing, changing the rate or going back into the past.

+

How to use#

+

First, launch the planning simulator, and put the ego pose. +Then, run the script according to the following command.

+

By designating a rosbag, perception replayer can be launched. +The GUI is launched as well with which a timestamp of rosbag can be managed.

+
ros2 run planning_debug_tools perception_replayer.py -b <bag-file>
+
+

You can designate multiple rosbags in the directory.

+
ros2 run planning_debug_tools perception_replayer.py -b <dir-to-bag-files>
+
+

Instead of publishing predicted objects, you can publish detected/tracked objects by designating -d or -t, respectively.

+

Processing time checker#

+

The purpose of the Processing Time Subscriber is to monitor and visualize the processing times of various ROS 2 topics in a system. By providing a real-time terminal-based visualization, users can easily confirm the processing time performance as in the picture below.

+

processing_time_checker

+

You can run the program by the following command.

+
ros2 run planning_debug_tools processing_time_checker.py -f <update-hz> -m <max-bar-time>
+
+

This program subscribes to ROS 2 topics that have a suffix of processing_time_ms.

+

The program allows users to customize two parameters via command-line arguments:

+
    +
  • --max_display_time (or -m): This sets the maximum display time in milliseconds. The default value is 150ms.
  • +
  • --display_frequency (or -f): This sets the frequency at which the terminal UI updates. The default value is 5Hz.
  • +
+

By adjusting these parameters, users can tailor the display to their specific monitoring needs.

+

Logging Level Updater#

+

The purpose of the Logging Level Updater is to update the logging level of the planning modules via ROS 2 service. Users can easily update the logging level for debugging.

+
ros2 run planning_debug_tools update_logger_level.sh <module-name> <logger-level>
+
+

<logger-level> will be DEBUG, INFO, WARN, or ERROR.

+

logging_level_updater

+

When you have a typo of the planning module, the script will show the available modules.

+

logging_level_updater_typo

+ + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/latest/search/search_index.json b/latest/search/search_index.json index c18023c9..0f906875 100644 --- a/latest/search/search_index.json +++ b/latest/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"autoware_tools","text":""},{"location":"#autoware_tools","title":"autoware_tools","text":"

This is a repository for keeping packages that are not needed at runtime, including packages for benchmarking, debugging, tuning, calibrating, etc.

"},{"location":"CONTRIBUTING/","title":"Contributing","text":""},{"location":"CONTRIBUTING/#contributing","title":"Contributing","text":"

See https://autowarefoundation.github.io/autoware-documentation/main/contributing/.

"},{"location":"DISCLAIMER/","title":"DISCLAIMER","text":"

DISCLAIMER

\u201cAutoware\u201d will be provided by The Autoware Foundation under the Apache License 2.0. This \u201cDISCLAIMER\u201d will be applied to all users of Autoware (a \u201cUser\u201d or \u201cUsers\u201d) with the Apache License 2.0 and Users shall hereby approve and acknowledge all the contents specified in this disclaimer below and will be deemed to consent to this disclaimer without any objection upon utilizing or downloading Autoware.

Disclaimer and Waiver of Warranties

  1. AUTOWARE FOUNDATION MAKES NO REPRESENTATION OR WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH RESPECT TO PROVIDING AUTOWARE (the \u201cService\u201d) including but not limited to any representation or warranty (i) of fitness or suitability for a particular purpose contemplated by the Users, (ii) of the expected functions, commercial value, accuracy, or usefulness of the Service, (iii) that the use by the Users of the Service complies with the laws and regulations applicable to the Users or any internal rules established by industrial organizations, (iv) that the Service will be free of interruption or defects, (v) of the non-infringement of any third party's right and (vi) the accuracy of the content of the Services and the software itself.

  2. The Autoware Foundation shall not be liable for any damage incurred by the User that are attributable to the Autoware Foundation for any reasons whatsoever. UNDER NO CIRCUMSTANCES SHALL THE AUTOWARE FOUNDATION BE LIABLE FOR INCIDENTAL, INDIRECT, SPECIAL OR FUTURE DAMAGES OR LOSS OF PROFITS.

  3. A User shall be entirely responsible for the content posted by the User and its use of any content of the Service or the Website. If the User is held responsible in a civil action such as a claim for damages or even in a criminal case, the Autoware Foundation and member companies, governments and academic & non-profit organizations and their directors, officers, employees and agents (collectively, the \u201cIndemnified Parties\u201d) shall be completely discharged from any rights or assertions the User may have against the Indemnified Parties, or from any legal action, litigation or similar procedures.

Indemnity

A User shall indemnify and hold the Indemnified Parties harmless from any of their damages, losses, liabilities, costs or expenses (including attorneys' fees or criminal compensation), or any claims or demands made against the Indemnified Parties by any third party, due to or arising out of, or in connection with utilizing Autoware (including the representations and warranties), the violation of applicable Product Liability Law of each country (including criminal case) or violation of any applicable laws by the Users, or the content posted by the User or its use of any content of the Service or the Website.

"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"autoware_tools","text":""},{"location":"#autoware_tools","title":"autoware_tools","text":"

This is a repository for keeping packages that are not needed at runtime, including packages for benchmarking, debugging, tuning, calibrating, etc.

"},{"location":"CONTRIBUTING/","title":"Contributing","text":""},{"location":"CONTRIBUTING/#contributing","title":"Contributing","text":"

See https://autowarefoundation.github.io/autoware-documentation/main/contributing/.

"},{"location":"DISCLAIMER/","title":"DISCLAIMER","text":"

DISCLAIMER

\u201cAutoware\u201d will be provided by The Autoware Foundation under the Apache License 2.0. This \u201cDISCLAIMER\u201d will be applied to all users of Autoware (a \u201cUser\u201d or \u201cUsers\u201d) with the Apache License 2.0 and Users shall hereby approve and acknowledge all the contents specified in this disclaimer below and will be deemed to consent to this disclaimer without any objection upon utilizing or downloading Autoware.

Disclaimer and Waiver of Warranties

  1. AUTOWARE FOUNDATION MAKES NO REPRESENTATION OR WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH RESPECT TO PROVIDING AUTOWARE (the \u201cService\u201d) including but not limited to any representation or warranty (i) of fitness or suitability for a particular purpose contemplated by the Users, (ii) of the expected functions, commercial value, accuracy, or usefulness of the Service, (iii) that the use by the Users of the Service complies with the laws and regulations applicable to the Users or any internal rules established by industrial organizations, (iv) that the Service will be free of interruption or defects, (v) of the non-infringement of any third party's right and (vi) the accuracy of the content of the Services and the software itself.

  2. The Autoware Foundation shall not be liable for any damage incurred by the User that are attributable to the Autoware Foundation for any reasons whatsoever. UNDER NO CIRCUMSTANCES SHALL THE AUTOWARE FOUNDATION BE LIABLE FOR INCIDENTAL, INDIRECT, SPECIAL OR FUTURE DAMAGES OR LOSS OF PROFITS.

  3. A User shall be entirely responsible for the content posted by the User and its use of any content of the Service or the Website. If the User is held responsible in a civil action such as a claim for damages or even in a criminal case, the Autoware Foundation and member companies, governments and academic & non-profit organizations and their directors, officers, employees and agents (collectively, the \u201cIndemnified Parties\u201d) shall be completely discharged from any rights or assertions the User may have against the Indemnified Parties, or from any legal action, litigation or similar procedures.

Indemnity

A User shall indemnify and hold the Indemnified Parties harmless from any of their damages, losses, liabilities, costs or expenses (including attorneys' fees or criminal compensation), or any claims or demands made against the Indemnified Parties by any third party, due to or arising out of, or in connection with utilizing Autoware (including the representations and warranties), the violation of applicable Product Liability Law of each country (including criminal case) or violation of any applicable laws by the Users, or the content posted by the User or its use of any content of the Service or the Website.

"},{"location":"common/tier4_debug_tools/","title":"tier4_debug_tools","text":""},{"location":"common/tier4_debug_tools/#tier4_debug_tools","title":"tier4_debug_tools","text":"

This package provides useful features for debugging Autoware.

"},{"location":"common/tier4_debug_tools/#usage","title":"Usage","text":""},{"location":"common/tier4_debug_tools/#tf2pose","title":"tf2pose","text":"

This tool converts any tf to pose topic. With this tool, for example, you can plot x values of tf in rqt_multiplot.

ros2 run tier4_debug_tools tf2pose {tf_from} {tf_to} {hz}\n

Example:

$ ros2 run tier4_debug_tools tf2pose base_link ndt_base_link 100\n\n$ ros2 topic echo /tf2pose/pose -n1\nheader:\n  seq: 13\nstamp:\n    secs: 1605168366\nnsecs: 549174070\nframe_id: \"base_link\"\npose:\n  position:\n    x: 0.0387684271191\n    y: -0.00320360406477\n    z: 0.000276674520819\n  orientation:\n    x: 0.000335221893885\n    y: 0.000122020672186\n    z: -0.00539673212896\n    w: 0.999985368502\n---\n
"},{"location":"common/tier4_debug_tools/#pose2tf","title":"pose2tf","text":"

This tool converts any pose topic to tf.

ros2 run tier4_debug_tools pose2tf {pose_topic_name} {tf_name}\n

Example:

$ ros2 run tier4_debug_tools pose2tf /localization/pose_estimator/pose ndt_pose\n\n$ ros2 run tf tf_echo ndt_pose ndt_base_link 100\nAt time 1605168365.449\n- Translation: [0.000, 0.000, 0.000]\n- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]\nin RPY (radian) [0.000, -0.000, 0.000]\nin RPY (degree) [0.000, -0.000, 0.000]\n
"},{"location":"common/tier4_debug_tools/#stop_reason2pose","title":"stop_reason2pose","text":"

This tool extracts pose from stop_reasons. Topics without numbers such as /stop_reason2pose/pose/detection_area are the nearest stop_reasons, and topics with numbers are individual stop_reasons that are roughly matched with previous ones.

ros2 run tier4_debug_tools stop_reason2pose {stop_reason_topic_name}\n

Example:

$ ros2 run tier4_debug_tools stop_reason2pose /planning/scenario_planning/status/stop_reasons\n\n$ ros2 topic list | ag stop_reason2pose\n/stop_reason2pose/pose/detection_area\n/stop_reason2pose/pose/detection_area_1\n/stop_reason2pose/pose/obstacle_stop\n/stop_reason2pose/pose/obstacle_stop_1\n\n$ ros2 topic echo /stop_reason2pose/pose/detection_area -n1\nheader:\n  seq: 1\nstamp:\n    secs: 1605168355\nnsecs:    821713\nframe_id: \"map\"\npose:\n  position:\n    x: 60608.8433457\n    y: 43886.2410876\n    z: 44.9078212441\n  orientation:\n    x: 0.0\n    y: 0.0\n    z: -0.190261378408\n    w: 0.981733470901\n---\n
"},{"location":"common/tier4_debug_tools/#stop_reason2tf","title":"stop_reason2tf","text":"

This is an all-in-one script that uses tf2pose, pose2tf, and stop_reason2pose. With this tool, you can view the relative position from base_link to the nearest stop_reason.

ros2 run tier4_debug_tools stop_reason2tf {stop_reason_name}\n

Example:

$ ros2 run tier4_debug_tools stop_reason2tf obstacle_stop\nAt time 1605168359.501\n- Translation: [0.291, -0.095, 0.266]\n- Rotation: in Quaternion [0.007, 0.011, -0.005, 1.000]\nin RPY (radian) [0.014, 0.023, -0.010]\nin RPY (degree) [0.825, 1.305, -0.573]\n
"},{"location":"common/tier4_debug_tools/#lateral_error_publisher","title":"lateral_error_publisher","text":"

This node calculate the control error and localization error in the trajectory normal direction as shown in the figure below.

Set the reference trajectory, vehicle pose and ground truth pose in the launch file.

ros2 launch tier4_debug_tools lateral_error_publisher.launch.xml\n
"},{"location":"planning/planning_debug_tools/","title":"Planning Debug Tools","text":""},{"location":"planning/planning_debug_tools/#planning-debug-tools","title":"Planning Debug Tools","text":"

This package contains several planning-related debug tools.

  • Trajectory analyzer: visualizes the information (speed, curvature, yaw, etc) along the trajectory
  • Closest velocity checker: prints the velocity information indicated by each modules
  • Perception reproducer: generates detected objects from rosbag data in planning simulator environment
  • processing time checker: displays processing_time of modules on the terminal
  • logging level updater: updates the logging level of the planning modules.
"},{"location":"planning/planning_debug_tools/#trajectory-analyzer","title":"Trajectory analyzer","text":"

The trajectory_analyzer visualizes the information (speed, curvature, yaw, etc) along the trajectory. This feature would be helpful for purposes such as \"investigating the reason why the vehicle decelerates here\". This feature employs the OSS PlotJuggler.

"},{"location":"planning/planning_debug_tools/#stop-reason-visualizer","title":"Stop reason visualizer","text":"

This is to visualize stop factor and reason. see the details

"},{"location":"planning/planning_debug_tools/#how-to-use","title":"How to use","text":"

please launch the analyzer node

ros2 launch planning_debug_tools trajectory_analyzer.launch.xml\n

and visualize the analyzed data on the plot juggler following below.

"},{"location":"planning/planning_debug_tools/#setup-plotjuggler","title":"setup PlotJuggler","text":"

For the first time, please add the following code to reactive script and save it as the picture below! (Looking for the way to automatically load the configuration file...)

You can customize what you plot by editing this code.

in Global code

behavior_path = '/planning/scenario_planning/lane_driving/behavior_planning/path_with_lane_id/debug_info'\nbehavior_velocity = '/planning/scenario_planning/lane_driving/behavior_planning/path/debug_info'\nmotion_avoid = '/planning/scenario_planning/lane_driving/motion_planning/obstacle_avoidance_planner/trajectory/debug_info'\nmotion_smoother_latacc = '/planning/scenario_planning/motion_velocity_smoother/debug/trajectory_lateral_acc_filtered/debug_info'\nmotion_smoother = '/planning/scenario_planning/trajectory/debug_info'\n

in function(tracker_time)

PlotCurvatureOverArclength('k_behavior_path', behavior_path, tracker_time)\nPlotCurvatureOverArclength('k_behavior_velocity', behavior_velocity, tracker_time)\nPlotCurvatureOverArclength('k_motion_avoid', motion_avoid, tracker_time)\nPlotCurvatureOverArclength('k_motion_smoother', motion_smoother, tracker_time)\n\nPlotVelocityOverArclength('v_behavior_path', behavior_path, tracker_time)\nPlotVelocityOverArclength('v_behavior_velocity', behavior_velocity, tracker_time)\nPlotVelocityOverArclength('v_motion_avoid', motion_avoid, tracker_time)\nPlotVelocityOverArclength('v_motion_smoother_latacc', motion_smoother_latacc, tracker_time)\nPlotVelocityOverArclength('v_motion_smoother', motion_smoother, tracker_time)\n\nPlotAccelerationOverArclength('a_behavior_path', behavior_path, tracker_time)\nPlotAccelerationOverArclength('a_behavior_velocity', behavior_velocity, tracker_time)\nPlotAccelerationOverArclength('a_motion_avoid', motion_avoid, tracker_time)\nPlotAccelerationOverArclength('a_motion_smoother_latacc', motion_smoother_latacc, tracker_time)\nPlotAccelerationOverArclength('a_motion_smoother', motion_smoother, tracker_time)\n\nPlotYawOverArclength('yaw_behavior_path', behavior_path, tracker_time)\nPlotYawOverArclength('yaw_behavior_velocity', behavior_velocity, tracker_time)\nPlotYawOverArclength('yaw_motion_avoid', motion_avoid, tracker_time)\nPlotYawOverArclength('yaw_motion_smoother_latacc', motion_smoother_latacc, tracker_time)\nPlotYawOverArclength('yaw_motion_smoother', motion_smoother, tracker_time)\n\nPlotCurrentVelocity('localization_kinematic_state', '/localization/kinematic_state', tracker_time)\n

in Function Library

function PlotValue(name, path, timestamp, value)\n  new_series = ScatterXY.new(name)\n  index = 0\n  while(true) do\n    series_k = TimeseriesView.find( string.format( \"%s/\"..value..\".%d\", path, index) )\n    series_s = TimeseriesView.find( string.format( \"%s/arclength.%d\", path, index) )\n    series_size = TimeseriesView.find( string.format( \"%s/size\", path) )\n\n    if series_k == nil or series_s == nil then break end\n\n    k = series_k:atTime(timestamp)\n    s = series_s:atTime(timestamp)\n    size = series_size:atTime(timestamp)\n\n    if index >= size then break end\n\n    new_series:push_back(s,k)\n    index = index+1\n  end\nend\n\nfunction PlotCurvatureOverArclength(name, path, timestamp)\n  PlotValue(name, path, timestamp,\"curvature\")\nend\n\nfunction PlotVelocityOverArclength(name, path, timestamp)\n  PlotValue(name, path, timestamp,\"velocity\")\nend\n\nfunction PlotAccelerationOverArclength(name, path, timestamp)\n  PlotValue(name, path, timestamp,\"acceleration\")\nend\n\nfunction PlotYawOverArclength(name, path, timestamp)\n  PlotValue(name, path, timestamp,\"yaw\")\nend\n\nfunction PlotCurrentVelocity(name, kinematics_name, timestamp)\n  new_series = ScatterXY.new(name)\n  series_v = TimeseriesView.find( string.format( \"%s/twist/twist/linear/x\", kinematics_name))\n  if series_v == nil then\n    print(\"error\")\n    return\n  end\n  v = series_v:atTime(timestamp)\n  new_series:push_back(0.0, v)\nend\n

Then, run the plot juggler.

"},{"location":"planning/planning_debug_tools/#how-to-customize-the-plot","title":"How to customize the plot","text":"

Add Path/PathWithLaneIds/Trajectory topics you want to plot in the trajectory_analyzer.launch.xml, then the analyzed topics for these messages will be published with TrajectoryDebugINfo.msg type. You can then visualize these data by editing the reactive script on the PlotJuggler.

"},{"location":"planning/planning_debug_tools/#requirements","title":"Requirements","text":"

The version of the plotJuggler must be > 3.5.0

"},{"location":"planning/planning_debug_tools/#closest-velocity-checker","title":"Closest velocity checker","text":"

This node prints the velocity information indicated by planning/control modules on a terminal. For trajectories calculated by planning modules, the target velocity on the trajectory point which is closest to the ego vehicle is printed. For control commands calculated by control modules, the target velocity and acceleration is directly printed. This feature would be helpful for purposes such as \"investigating the reason why the vehicle does not move\".

You can launch by

ros2 run planning_debug_tools closest_velocity_checker.py\n

"},{"location":"planning/planning_debug_tools/#trajectory-visualizer","title":"Trajectory visualizer","text":"

The old version of the trajectory analyzer. It is written in Python and more flexible, but very slow.

"},{"location":"planning/planning_debug_tools/#for-other-use-case-experimental","title":"For other use case (experimental)","text":"

To see behavior velocity planner's internal plath with lane id add below example value to behavior velocity analyzer and set is_publish_debug_path: true

crosswalk ='/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/debug/path_with_lane_id/crosswalk/debug_info'\nintersection ='/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/debug/path_with_lane_id/intersection/debug_info'\ntraffic_light ='/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/debug/path_with_lane_id/traffic_light/debug_info'\nmerge_from_private ='/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/debug/path_with_lane_id/merge_from_private/debug_info'\nocclusion_spot ='/planning/scenario_planning/lane_driving/behavior_planning/behavior_velocity_planner/debug/path_with_lane_id/occlusion_spot/debug_info'\n
PlotVelocityOverArclength('v_crosswalk', crosswalk, tracker_time)\nPlotVelocityOverArclength('v_intersection', intersection, tracker_time)\nPlotVelocityOverArclength('v_merge_from_private', merge_from_private, tracker_time)\nPlotVelocityOverArclength('v_traffic_light', traffic_light, tracker_time)\nPlotVelocityOverArclength('v_occlusion', occlusion_spot, tracker_time)\n\nPlotYawOverArclength('yaw_crosswalk', crosswalk, tracker_time)\nPlotYawOverArclength('yaw_intersection', intersection, tracker_time)\nPlotYawOverArclength('yaw_merge_from_private', merge_from_private, tracker_time)\nPlotYawOverArclength('yaw_traffic_light', traffic_light, tracker_time)\nPlotYawOverArclength('yaw_occlusion', occlusion_spot, tracker_time)\n\nPlotCurrentVelocity('localization_kinematic_state', '/localization/kinematic_state', tracker_time)\n
"},{"location":"planning/planning_debug_tools/#perception-reproducer","title":"Perception reproducer","text":"

This script can overlay the perception results from the rosbag on the planning simulator synchronized with the simulator's ego pose.

In detail, the ego pose in the rosbag which is closest to the current ego pose in the simulator is calculated. The perception results at the timestamp of the closest ego pose is extracted, and published.

"},{"location":"planning/planning_debug_tools/#how-to-use_1","title":"How to use","text":"

First, launch the planning simulator, and put the ego pose. Then, run the script according to the following command.

By designating a rosbag, perception reproducer can be launched.

ros2 run planning_debug_tools perception_reproducer.py -b <bag-file>\n

You can designate multiple rosbags in the directory.

ros2 run planning_debug_tools perception_reproducer.py -b <dir-to-bag-files>\n

Instead of publishing predicted objects, you can publish detected/tracked objects by designating -d or -t, respectively.

"},{"location":"planning/planning_debug_tools/#perception-replayer","title":"Perception replayer","text":"

A part of the feature is under development.

This script can overlay the perception results from the rosbag on the planning simulator.

In detail, this script publishes the data at a certain timestamp from the rosbag. The timestamp will increase according to the real time without any operation. By using the GUI, you can modify the timestamp by pausing, changing the rate or going back into the past.

"},{"location":"planning/planning_debug_tools/#how-to-use_2","title":"How to use","text":"

First, launch the planning simulator, and put the ego pose. Then, run the script according to the following command.

By designating a rosbag, perception replayer can be launched. The GUI is launched as well with which a timestamp of rosbag can be managed.

ros2 run planning_debug_tools perception_replayer.py -b <bag-file>\n

You can designate multiple rosbags in the directory.

ros2 run planning_debug_tools perception_replayer.py -b <dir-to-bag-files>\n

Instead of publishing predicted objects, you can publish detected/tracked objects by designating -d or -t, respectively.

"},{"location":"planning/planning_debug_tools/#processing-time-checker","title":"Processing time checker","text":"

The purpose of the Processing Time Subscriber is to monitor and visualize the processing times of various ROS 2 topics in a system. By providing a real-time terminal-based visualization, users can easily confirm the processing time performance as in the picture below.

You can run the program by the following command.

ros2 run planning_debug_tools processing_time_checker.py -f <update-hz> -m <max-bar-time>\n

This program subscribes to ROS 2 topics that have a suffix of processing_time_ms.

The program allows users to customize two parameters via command-line arguments:

  • --max_display_time (or -m): This sets the maximum display time in milliseconds. The default value is 150ms.
  • --display_frequency (or -f): This sets the frequency at which the terminal UI updates. The default value is 5Hz.

By adjusting these parameters, users can tailor the display to their specific monitoring needs.

"},{"location":"planning/planning_debug_tools/#logging-level-updater","title":"Logging Level Updater","text":"

The purpose of the Logging Level Updater is to update the logging level of the planning modules via ROS 2 service. Users can easily update the logging level for debugging.

ros2 run planning_debug_tools update_logger_level.sh <module-name> <logger-level>\n

<logger-level> will be DEBUG, INFO, WARN, or ERROR.

When you have a typo of the planning module, the script will show the available modules.

"},{"location":"planning/planning_debug_tools/doc-stop-reason-visualizer/","title":"Doc stop reason visualizer","text":""},{"location":"planning/planning_debug_tools/doc-stop-reason-visualizer/#stop_reason_visualizer","title":"stop_reason_visualizer","text":"

This module is to visualize stop factor quickly without selecting correct debug markers. This is supposed to use with virtual wall marker like below.

"},{"location":"planning/planning_debug_tools/doc-stop-reason-visualizer/#how-to-use","title":"How to use","text":"

Run this node.

ros2 run planning_debug_tools stop_reason_visualizer_exe\n

Add stop reason debug marker from rviz.

Note: ros2 process can be sometimes deleted only from killall stop_reason_visualizer_exe

Reference

"},{"location":"simulator/simulator_compatibility_test/","title":"simulator_compatibility_test","text":""},{"location":"simulator/simulator_compatibility_test/#simulator_compatibility_test","title":"simulator_compatibility_test","text":""},{"location":"simulator/simulator_compatibility_test/#purpose","title":"Purpose","text":"

Test procedures (e.g. test codes) to check whether a certain simulator is compatible with Autoware

"},{"location":"simulator/simulator_compatibility_test/#overview-of-the-test-codes","title":"Overview of the test codes","text":"

File structure

  • test_base
  • test_sim_common_manual_testing
  • test_morai_sim
  1. test_base provides shared methods for testing. Other test codes are created based on functions defined here.
  2. test_sim_common_manual_testing provides the most basic functions. Any simulator can be tested using codes here. However, to make these codes usable with any simulators, the codes do not include any features for test automation.
  3. test_morai_sim is an automated version of test_sim_common_manual_testing for MORAI SIM: Drive. Thus it includes 'MORAI SIM: Drive'-specific codes. Users of the other simulators may create similar version for their simulator of interest.
"},{"location":"simulator/simulator_compatibility_test/#test-procedures-for-test_sim_common_manual_testing","title":"Test Procedures for test_sim_common_manual_testing","text":""},{"location":"simulator/simulator_compatibility_test/#build-process-before-test","title":"Build process before test","text":"
source install/setup.bash\ncolcon build --packages-select simulator_compatibility_test\ncd src/universe/autoware.universe/tools/simulator_test/simulator_compatibility_test/test_sim_common_manual_testing\n

To run each test case manually

"},{"location":"simulator/simulator_compatibility_test/#test-case-1","title":"Test Case #1","text":"
  1. Run your simulator
  2. Load a map and an ego vehicle for the test
  3. Run the test using the following command

    python -m pytest test_01_control_mode_and_report.py\n
  4. Check if expected behavior is created within the simulator

    • Ego vehicle control mode is changed into Manual (If the simulator has a GUI for this one, it should display the ego is in Manual)
    • Ego vehicle control mode is changed into Auto (If the simulator has a GUI for this one, it should display the ego is in Auto)
  5. Check if pytest output is passed or failure
"},{"location":"simulator/simulator_compatibility_test/#test-case-2","title":"Test Case #2","text":"
  1. Run your simulator (If the simulator is already running, skip this part)
  2. Load a map and an ego vehicle for the test (If a map and an ego are loaded already, skip this part)
  3. Run the test using the following command

    python -m pytest test_02_change_gear_and_report.py\n
  4. Check if expected behavior is created within the simulator

    • Ego vehicle gear mode is changed into \"P\" (If the simulator has a GUI for this one, it should display the gear mode is in \"P\")
    • Ego vehicle gear mode is changed into \"N\" (If the simulator has a GUI for this one, it should display the gear mode is in \"N\")
    • Ego vehicle gear mode is changed into \"R\" (If the simulator has a GUI for this one, it should display the gear mode is in \"R\")
    • Ego vehicle gear mode is changed into \"D\" (If the simulator has a GUI for this one, it should display the gear mode is in \"D\")
  5. Check if pytest output is passed or failure
"},{"location":"simulator/simulator_compatibility_test/#test-case-3","title":"Test Case #3","text":"
  1. Run your simulator (If the simulator is already running, skip this part)
  2. Load a map and an ego vehicle for the test (If a map and an ego are loaded already, skip this part)
  3. Run the test using the following command

    python -m pytest test_03_longitudinal_command_and_report.py\n
  4. Check if expected behavior is created within the simulator

    • Ego vehicle longitudinal velocity is greater than 10 kph (If the simulator has a GUI for this one, it should display the longitudinal velocity is greater than 10 kph)
    • Ego vehicle longitudinal velocity is going below 10 kph. This is an ego vehicle initialize process to ensure the following acceleration is made by longitudinal.acceleration value (If the simulator has a GUI for this one, it should display the longitudinal velocity is less than 10 kph)
    • Ego vehicle longitudinal velocity is greater than 10 kph (If the simulator has a GUI for this one, it should display the longitudinal velocity is greater than 10 kph)
    • Ego vehicle longitudinal velocity is going below 10 kph. This is an ego vehicle reset process to tear down this test case.
  5. Check if pytest output is passed or failure
"},{"location":"simulator/simulator_compatibility_test/#test-case-4","title":"Test Case #4","text":"
  1. Run your simulator (If the simulator is already running, skip this part)
  2. Load a map and an ego vehicle for the test (If a map and an ego are loaded already, skip this part)
  3. Run the test using the following command

    python -m pytest test_04_lateral_command_and_report.py\n
  4. Check if expected behavior is created within the simulator

    • Ego vehicle steering and/or tire value is greater than 0 degree (If the simulator has a GUI for this one, it should display the steering and/or tire is greater than 0 degree)
    • Ego vehicle steering and/or tire value is 0 degree. This is a reset process. (If the simulator has a GUI for this one, it should display the steering and/or tire is 0 degree)
    • Ego vehicle steering and/or tire value is less than 0 degree (If the simulator has a GUI for this one, it should display the steering and/or tire is less than 0 degree)
    • Ego vehicle steering and/or tire value is 0 degree. This is a reset process. (If the simulator has a GUI for this one, it should display the steering and/or tire is 0 degree)
  5. Check if pytest output is passed or failure
"},{"location":"simulator/simulator_compatibility_test/#test-case-5","title":"Test Case #5","text":"
  1. Run your simulator (If the simulator is already running, skip this part)
  2. Load a map and an ego vehicle for the test (If a map and an ego are loaded already, skip this part)
  3. Run the test using the following command

    python -m pytest test_05_turn_indicators_cmd_and_report.py\n
  4. Check if expected behavior is created within the simulator

    • Ego vehicle left turn indicator is turned on (If the simulator has a GUI for this one, it should display the left turn indicator is turned on)
    • Ego vehicle right turn indicator is turned on (If the simulator has a GUI for this one, it should display the right turn indicator is turned on)
    • Ego vehicle both turn indicators are turned off. This is a reset process. (If the simulator has a GUI for this one, it should display both left and right turn indicators are turned off)
  5. Check if pytest output is passed or failure
"},{"location":"simulator/simulator_compatibility_test/#test-case-6","title":"Test Case #6","text":"
  1. Run your simulator (If the simulator is already running, skip this part)
  2. Load a map and an ego vehicle for the test (If a map and an ego are loaded already, skip this part)
  3. Run the test using the following command

    python -m pytest test_06_hazard_lights_cmd_and_report.py\n
  4. Check if expected behavior is created within the simulator

    • Ego vehicle hazard lights are turned on (If the simulator has a GUI for this one, it should display the hazard lights are turned on or blinking)
    • Ego vehicle hazard lights are turned off. This is a reset process. (If the simulator has a GUI for this one, it should display the hazard lights are turned off)
  5. Check if pytest output is passed or failure
"},{"location":"simulator/simulator_compatibility_test/#test-procedures-for-test_morai_sim","title":"Test Procedures for test_morai_sim","text":""},{"location":"simulator/simulator_compatibility_test/#build-process-before-test_1","title":"Build process before test","text":"
source install/setup.bash\ncolcon build --packages-select simulator_compatibility_test\ncd src/universe/autoware.universe/tools/simulator_test/simulator_compatibility_test/test_morai_sim\n

Detailed process

(WIP)

"},{"location":"simulator/simulator_compatibility_test/#inner-workings-algorithms","title":"Inner-workings / Algorithms","text":""},{"location":"simulator/simulator_compatibility_test/#inputs-outputs","title":"Inputs / Outputs","text":""},{"location":"simulator/simulator_compatibility_test/#input","title":"Input","text":"Name Type Description /vehicle/status/control_mode autoware_auto_vehicle_msgs::msg::ControlModeReport for [Test Case #1] /vehicle/status/gear_status autoware_auto_vehicle_msgs::msg::GearReport for [Test Case #2] /vehicle/status/velocity_status autoware_auto_vehicle_msgs::msg::VelocityReport for [Test Case #3] /vehicle/status/steering_status autoware_auto_vehicle_msgs::msg::SteeringReport for [Test Case #4] /vehicle/status/turn_indicators_status autoware_auto_vehicle_msgs::msg::TurnIndicatorsReport for [Test Case #5] /vehicle/status/hazard_lights_status autoware_auto_vehicle_msgs::msg::HazardLightsReport for [Test Case #6]"},{"location":"simulator/simulator_compatibility_test/#output","title":"Output","text":"Name Type Description /control/command/control_mode_cmd autoware_auto_vehicle_msgs/ControlModeCommand for [Test Case #1] /control/command/gear_cmd autoware_auto_vehicle_msgs/GearCommand for [Test Case #2] /control/command/control_cmd autoware_auto_vehicle_msgs/AckermannControlCommand for [Test Case #3, #4] /vehicle/status/steering_status autoware_auto_vehicle_msgs/TurnIndicatorsCommand for [Test Case #5] /control/command/turn_indicators_cmd autoware_auto_vehicle_msgs/HazardLightsCommand for [Test Case #6]"},{"location":"simulator/simulator_compatibility_test/#parameters","title":"Parameters","text":"

None.

"},{"location":"simulator/simulator_compatibility_test/#node-parameters","title":"Node Parameters","text":"

None.

"},{"location":"simulator/simulator_compatibility_test/#core-parameters","title":"Core Parameters","text":"

None.

"},{"location":"simulator/simulator_compatibility_test/#assumptions-known-limits","title":"Assumptions / Known limits","text":"

None.

"},{"location":"vehicle/accel_brake_map_calibrator/","title":"accel_brake_map_calibrator","text":""},{"location":"vehicle/accel_brake_map_calibrator/#accel_brake_map_calibrator","title":"accel_brake_map_calibrator","text":"

The role of this node is to automatically calibrate accel_map.csv / brake_map.csv used in the raw_vehicle_cmd_converter node.

The base map, which is lexus's one by default, is updated iteratively with the loaded driving data.

"},{"location":"vehicle/accel_brake_map_calibrator/#how-to-calibrate","title":"How to calibrate","text":""},{"location":"vehicle/accel_brake_map_calibrator/#launch-calibrator","title":"Launch Calibrator","text":"

After launching Autoware, run the accel_brake_map_calibrator by the following command and then perform autonomous driving. Note: You can collect data with manual driving if it is possible to use the same vehicle interface as during autonomous driving (e.g. using a joystick).

ros2 launch accel_brake_map_calibrator accel_brake_map_calibrator.launch.xml rviz:=true\n

Or if you want to use rosbag files, run the following commands.

ros2 launch accel_brake_map_calibrator accel_brake_map_calibrator.launch.xml rviz:=true use_sim_time:=true\nros2 bag play <rosbag_file> --clock\n

During the calibration with setting the parameter progress_file_output to true, the log file is output in [directory of accel_brake_map_calibrator]/config/ . You can also see accel and brake maps in [directory of accel_brake_map_calibrator]/config/accel_map.csv and [directory of accel_brake_map_calibrator]/config/brake_map.csv after calibration.

"},{"location":"vehicle/accel_brake_map_calibrator/#calibration-plugin","title":"Calibration plugin","text":"

The rviz:=true option displays the RViz with a calibration plugin as below.

The current status (velocity and pedal) is shown in the plugin. The color on the current cell varies green/red depending on the current data is valid/invalid. The data that doesn't satisfy the following conditions are considered invalid and will not be used for estimation since aggressive data (e.g. when the pedal is moving fast) causes bad calibration accuracy.

  • The velocity and pedal conditions are within certain ranges from the index values.
  • The steer value, pedal speed, pitch value, etc. are less than corresponding thresholds.
  • The velocity is higher than a threshold.

The detailed parameters are described in the parameter section.

Note: You don't need to worry about whether the current state is red or green during calibration. Just keep getting data until all the cells turn red.

The value of each cell in the map is gray at first, and it changes from blue to red as the number of valid data in the cell accumulates. It is preferable to continue the calibration until each cell of the map becomes close to red. In particular, the performance near the stop depends strongly on the velocity of 0 ~ 6m/s range and the pedal value of +0.2 ~ -0.4, range so it is desirable to focus on those areas.

"},{"location":"vehicle/accel_brake_map_calibrator/#diagnostics","title":"Diagnostics","text":"

The accel brake map_calibrator publishes diagnostics message depending on the calibration status. Diagnostic type WARN indicates that the current accel/brake map is estimated to be inaccurate. In this situation, it is strongly recommended to perform a re-calibration of the accel/brake map.

Status Diagnostics Type Diagnostics message Description No calibration required OK \"OK\" Calibration Required WARN \"Accel/brake map Calibration is required.\" The accuracy of current accel/brake map may be low.

This diagnostics status can be also checked on the following ROS topic.

ros2 topic echo /accel_brake_map_calibrator/output/update_suggest\n

When the diagnostics type is WARN, True is published on this topic and the update of the accel/brake map is suggested.

"},{"location":"vehicle/accel_brake_map_calibrator/#evaluation-of-the-accel-brake-map-accuracy","title":"Evaluation of the accel / brake map accuracy","text":"

The accuracy of map is evaluated by the Root Mean Squared Error (RMSE) between the observed acceleration and predicted acceleration.

TERMS:

  • Observed acceleration: the current vehicle acceleration which is calculated as a derivative value of the wheel speed.
  • Predicted acceleration: the output of the original accel/brake map, which the Autoware is expecting. The value is calculated using the current pedal and velocity.

You can check additional error information with the following topics.

  • /accel_brake_map_calibrator/output/current_map_error : The error of the original map set in the csv_path_accel/brake_map path. The original map is not accurate if this value is large.
  • /accel_brake_map_calibrator/output/updated_map_error : The error of the map calibrated in this node. The calibration quality is low if this value is large.
  • /accel_brake_map_calibrator/output/map_error_ratio : The error ratio between the original map and updated map (ratio = updated / current). If this value is less than 1, it is desirable to update the map.
"},{"location":"vehicle/accel_brake_map_calibrator/#how-to-visualize-calibration-data","title":"How to visualize calibration data","text":"

The process of calibration can be visualized as below. Since these scripts need the log output of the calibration, the pedal_accel_graph_output parameter must be set to true while the calibration is running for the visualization.

"},{"location":"vehicle/accel_brake_map_calibrator/#visualize-plot-of-relation-between-acceleration-and-pedal","title":"Visualize plot of relation between acceleration and pedal","text":"

The following command shows the plot of used data in the calibration. In each plot of velocity ranges, you can see the distribution of the relationship between pedal and acceleration, and raw data points with colors according to their pitch angles.

ros2 run accel_brake_map_calibrator view_plot.py\n

"},{"location":"vehicle/accel_brake_map_calibrator/#visualize-statistics-about-accelerationvelocitypedal-data","title":"Visualize statistics about acceleration/velocity/pedal data","text":"

The following command shows the statistics of the calibration:

  • mean value
  • standard deviation
  • number of data

of all data in each map cell.

ros2 run accel_brake_map_calibrator view_statistics.py\n

"},{"location":"vehicle/accel_brake_map_calibrator/#how-to-save-the-calibrated-accel-brake-map-anytime-you-want","title":"How to save the calibrated accel / brake map anytime you want","text":"

You can save accel and brake map anytime with the following command.

ros2 service call /accel_brake_map_calibrator/update_map_dir tier4_vehicle_msgs/srv/UpdateAccelBrakeMap \"path: '<accel/brake map directory>'\"\n

You can also save accel and brake map in the default directory where Autoware reads accel_map.csv/brake_map.csv using the RViz plugin (AccelBrakeMapCalibratorButtonPanel) as following.

  1. Click Panels tab, and select AccelBrakeMapCalibratorButtonPanel.

  2. Select the panel, and the button will appear at the bottom of RViz.

  3. Press the button, and the accel / brake map will be saved. (The button cannot be pressed in certain situations, such as when the calibrator node is not running.)

"},{"location":"vehicle/accel_brake_map_calibrator/#parameters","title":"Parameters","text":""},{"location":"vehicle/accel_brake_map_calibrator/#system-parameters","title":"System Parameters","text":"Name Type Description Default value update_method string you can select map calibration method. \"update_offset_each_cell\" calculates offsets for each grid cells on the map. \"update_offset_total\" calculates the total offset of the map. \"update_offset_each_cell\" get_pitch_method string \"tf\": get pitch from tf, \"none\": unable to perform pitch validation and pitch compensation \"tf\" pedal_accel_graph_output bool if true, it will output a log of the pedal accel graph. true progress_file_output bool if true, it will output a log and csv file of the update process. false default_map_dir str directory of default map [directory of raw_vehicle_cmd_converter]/data/default/ calibrated_map_dir str directory of calibrated map [directory of accel_brake_map_calibrator]/config/ update_hz double hz for update 10.0"},{"location":"vehicle/accel_brake_map_calibrator/#algorithm-parameters","title":"Algorithm Parameters","text":"Name Type Description Default value initial_covariance double Covariance of initial acceleration map (larger covariance makes the update speed faster) 0.05 velocity_min_threshold double Speeds smaller than this are not used for updating. 0.1 velocity_diff_threshold double When the velocity data is more than this threshold away from the grid reference speed (center value), the associated data is not used for updating. 0.556 max_steer_threshold double If the steer angle is greater than this value, the associated data is not used for updating. 0.2 max_pitch_threshold double If the pitch angle is greater than this value, the associated data is not used for updating. 0.02 max_jerk_threshold double If the ego jerk calculated from ego acceleration is greater than this value, the associated data is not used for updating. 0.7 pedal_velocity_thresh double If the pedal moving speed is greater than this value, the associated data is not used for updating. 0.15 pedal_diff_threshold double If the current pedal value is more then this threshold away from the previous value, the associated data is not used for updating. 0.03 max_accel double Maximum value of acceleration calculated from velocity source. 5.0 min_accel double Minimum value of acceleration calculated from velocity source. -5.0 pedal_to_accel_delay double The delay time between actuation_cmd to acceleration, considered in the update logic. 0.3 update_suggest_thresh double threshold of RMSE ratio that update suggest flag becomes true. ( RMSE ratio: [RMSE of new map] / [RMSE of original map] ) 0.7 max_data_count int For visualization. When the data num of each grid gets this value, the grid color gets red. 100 accel_brake_value_source string Whether to use actuation_status or actuation_command as accel/brake sources. value status"},{"location":"vehicle/accel_brake_map_calibrator/#test-utility-scripts","title":"Test utility scripts","text":""},{"location":"vehicle/accel_brake_map_calibrator/#constant-accelbrake-command-test","title":"Constant accel/brake command test","text":"

These scripts are useful to test for accel brake map calibration. These generate an ActuationCmd with a constant accel/brake value given interactively by a user through CLI.

  • accel_tester.py
  • brake_tester.py
  • actuation_cmd_publisher.py

The accel/brake_tester.py receives a target accel/brake command from CLI. It sends a target value to actuation_cmd_publisher.py which generates the ActuationCmd. You can run these scripts by the following commands in the different terminals, and it will be as in the screenshot below.

ros2 run accel_brake_map_calibrator accel_tester.py\nros2 run accel_brake_map_calibrator brake_tester.py\nros2 run accel_brake_map_calibrator actuation_cmd_publisher.py\n

"},{"location":"vehicle/accel_brake_map_calibrator/#calibration-method","title":"Calibration Method","text":"

Two algorithms are selectable for the acceleration map update, update_offset_four_cell_around and update_offset_each_cell. Please see the link for details.

"},{"location":"vehicle/accel_brake_map_calibrator/#data-preprocessing","title":"Data Preprocessing","text":"

Before calibration, missing or unusable data (e.g., too large handle angles) must first be eliminated. The following parameters are used to determine which data to remove.

"},{"location":"vehicle/accel_brake_map_calibrator/#parameters_1","title":"Parameters","text":"Name Description Default Value velocity_min_threshold Exclude minimal velocity 0.1 max_steer_threshold Exclude large steering angle 0.2 max_pitch_threshold Exclude large pitch angle 0.02 max_jerk_threshold Exclude large jerk 0.7 pedal_velocity_thresh Exclude large pedaling speed 0.15"},{"location":"vehicle/accel_brake_map_calibrator/#update_offset_each_cell","title":"update_offset_each_cell","text":"

Update by Recursive Least Squares(RLS) method using data close enough to each grid.

Advantage : Only data close enough to each grid is used for calibration, allowing accurate updates at each point.

Disadvantage : Calibration is time-consuming due to a large amount of data to be excluded.

"},{"location":"vehicle/accel_brake_map_calibrator/#parameters_2","title":"Parameters","text":"

Data selection is determined by the following thresholds. | Name | Default Value | | ----------------------- | ------------- | | velocity_diff_threshold | 0.556 | | pedal_diff_threshold | 0.03 |

"},{"location":"vehicle/accel_brake_map_calibrator/#update-formula","title":"Update formula","text":"\\[ \\begin{align} \\theta[n]=& \\theta[n-1]+\\frac{p[n-1]x^{(n)}}{\\lambda+p[n-1]{(x^{(n)})}^2}(y^{(n)}-\\theta[n-1]x^{(n)})\\\\ p[n]=&\\frac{p[n-1]}{\\lambda+p[n-1]{(x^{(n)})}^2} \\end{align} \\]"},{"location":"vehicle/accel_brake_map_calibrator/#variables","title":"Variables","text":"Variable name Symbol covariance \\(p[n-1]\\) map_offset \\(\\theta[n]\\) forgettingfactor \\(\\lambda\\) phi \\(x(=1)\\) measured_acc \\(y\\)"},{"location":"vehicle/accel_brake_map_calibrator/#update_offset_four_cell_around-1","title":"update_offset_four_cell_around [1]","text":"

Update the offsets by RLS in four grids around newly obtained data. By considering linear interpolation, the update takes into account appropriate weights. Therefore, there is no need to remove data by thresholding.

Advantage : No data is wasted because updates are performed on the 4 grids around the data with appropriate weighting. Disadvantage : Accuracy may be degraded due to extreme bias of the data. For example, if data \\(z(k)\\) is biased near \\(Z_{RR}\\) in Fig. 2, updating is performed at the four surrounding points ( \\(Z_{RR}\\), \\(Z_{RL}\\), \\(Z_{LR}\\), and \\(Z_{LL}\\)), but accuracy at \\(Z_{LL}\\) is not expected.

"},{"location":"vehicle/accel_brake_map_calibrator/#implementation","title":"Implementation","text":"

See eq.(7)-(10) in [1] for the updated formula. In addition, eq.(17),(18) from [1] are used for Anti-Windup.

"},{"location":"vehicle/accel_brake_map_calibrator/#references","title":"References","text":"

[1] Gabrielle Lochrie, Michael Doljevic, Mario Nona, Yongsoon Yoon, Anti-Windup Recursive Least Squares Method for Adaptive Lookup Tables with Application to Automotive Powertrain Control Systems, IFAC-PapersOnLine, Volume 54, Issue 20, 2021, Pages 840-845

"}]} \ No newline at end of file diff --git a/latest/simulator/simulator_compatibility_test/index.html b/latest/simulator/simulator_compatibility_test/index.html new file mode 100644 index 00000000..3fc365cf --- /dev/null +++ b/latest/simulator/simulator_compatibility_test/index.html @@ -0,0 +1,1273 @@ + + + + + + + + + + + + + + + + + + + + + + + + simulator_compatibility_test - Autoware Universe Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

simulator_compatibility_test#

+

Purpose#

+

Test procedures (e.g. test codes) to check whether a certain simulator is compatible with Autoware

+

Overview of the test codes#

+

File structure

+
    +
  • test_base
  • +
  • test_sim_common_manual_testing
  • +
  • test_morai_sim
  • +
+
    +
  1. test_base provides shared methods for testing. Other test codes are created based on functions defined here.
  2. +
  3. test_sim_common_manual_testing provides the most basic functions. Any simulator can be tested using codes here. However, to make these codes usable with any simulators, the codes do not include any features for test automation.
  4. +
  5. test_morai_sim is an automated version of test_sim_common_manual_testing for MORAI SIM: Drive. Thus it includes 'MORAI SIM: Drive'-specific codes. Users of the other simulators may create similar version for their simulator of interest.
  6. +
+

Test Procedures for test_sim_common_manual_testing#

+

Build process before test#

+
source install/setup.bash
+colcon build --packages-select simulator_compatibility_test
+cd src/universe/autoware.universe/tools/simulator_test/simulator_compatibility_test/test_sim_common_manual_testing
+
+

To run each test case manually

+

Test Case #1#

+
    +
  1. Run your simulator
  2. +
  3. Load a map and an ego vehicle for the test
  4. +
  5. +

    Run the test using the following command

    +
    python -m pytest test_01_control_mode_and_report.py
    +
    +
  6. +
  7. +

    Check if expected behavior is created within the simulator

    +
      +
    • Ego vehicle control mode is changed into Manual (If the simulator has a GUI for this one, it should display the ego is in Manual)
    • +
    • Ego vehicle control mode is changed into Auto (If the simulator has a GUI for this one, it should display the ego is in Auto)
    • +
    +
  8. +
  9. Check if pytest output is passed or failure
  10. +
+

Test Case #2#

+
    +
  1. Run your simulator (If the simulator is already running, skip this part)
  2. +
  3. Load a map and an ego vehicle for the test (If a map and an ego are loaded already, skip this part)
  4. +
  5. +

    Run the test using the following command

    +
    python -m pytest test_02_change_gear_and_report.py
    +
    +
  6. +
  7. +

    Check if expected behavior is created within the simulator

    +
      +
    • Ego vehicle gear mode is changed into "P" (If the simulator has a GUI for this one, it should display the gear mode is in "P")
    • +
    • Ego vehicle gear mode is changed into "N" (If the simulator has a GUI for this one, it should display the gear mode is in "N")
    • +
    • Ego vehicle gear mode is changed into "R" (If the simulator has a GUI for this one, it should display the gear mode is in "R")
    • +
    • Ego vehicle gear mode is changed into "D" (If the simulator has a GUI for this one, it should display the gear mode is in "D")
    • +
    +
  8. +
  9. Check if pytest output is passed or failure
  10. +
+

Test Case #3#

+
    +
  1. Run your simulator (If the simulator is already running, skip this part)
  2. +
  3. Load a map and an ego vehicle for the test (If a map and an ego are loaded already, skip this part)
  4. +
  5. +

    Run the test using the following command

    +
    python -m pytest test_03_longitudinal_command_and_report.py
    +
    +
  6. +
  7. +

    Check if expected behavior is created within the simulator

    +
      +
    • Ego vehicle longitudinal velocity is greater than 10 kph (If the simulator has a GUI for this one, it should display the longitudinal velocity is greater than 10 kph)
    • +
    • Ego vehicle longitudinal velocity is going below 10 kph. This is an ego vehicle initialize process to ensure the following acceleration is made by longitudinal.acceleration value (If the simulator has a GUI for this one, it should display the longitudinal velocity is less than 10 kph)
    • +
    • Ego vehicle longitudinal velocity is greater than 10 kph (If the simulator has a GUI for this one, it should display the longitudinal velocity is greater than 10 kph)
    • +
    • Ego vehicle longitudinal velocity is going below 10 kph. This is an ego vehicle reset process to tear down this test case.
    • +
    +
  8. +
  9. Check if pytest output is passed or failure
  10. +
+

Test Case #4#

+
    +
  1. Run your simulator (If the simulator is already running, skip this part)
  2. +
  3. Load a map and an ego vehicle for the test (If a map and an ego are loaded already, skip this part)
  4. +
  5. +

    Run the test using the following command

    +
    python -m pytest test_04_lateral_command_and_report.py
    +
    +
  6. +
  7. +

    Check if expected behavior is created within the simulator

    +
      +
    • Ego vehicle steering and/or tire value is greater than 0 degree (If the simulator has a GUI for this one, it should display the steering and/or tire is greater than 0 degree)
    • +
    • Ego vehicle steering and/or tire value is 0 degree. This is a reset process. (If the simulator has a GUI for this one, it should display the steering and/or tire is 0 degree)
    • +
    • Ego vehicle steering and/or tire value is less than 0 degree (If the simulator has a GUI for this one, it should display the steering and/or tire is less than 0 degree)
    • +
    • Ego vehicle steering and/or tire value is 0 degree. This is a reset process. (If the simulator has a GUI for this one, it should display the steering and/or tire is 0 degree)
    • +
    +
  8. +
  9. Check if pytest output is passed or failure
  10. +
+

Test Case #5#

+
    +
  1. Run your simulator (If the simulator is already running, skip this part)
  2. +
  3. Load a map and an ego vehicle for the test (If a map and an ego are loaded already, skip this part)
  4. +
  5. +

    Run the test using the following command

    +
    python -m pytest test_05_turn_indicators_cmd_and_report.py
    +
    +
  6. +
  7. +

    Check if expected behavior is created within the simulator

    +
      +
    • Ego vehicle left turn indicator is turned on (If the simulator has a GUI for this one, it should display the left turn indicator is turned on)
    • +
    • Ego vehicle right turn indicator is turned on (If the simulator has a GUI for this one, it should display the right turn indicator is turned on)
    • +
    • Ego vehicle both turn indicators are turned off. This is a reset process. (If the simulator has a GUI for this one, it should display both left and right turn indicators are turned off)
    • +
    +
  8. +
  9. Check if pytest output is passed or failure
  10. +
+

Test Case #6#

+
    +
  1. Run your simulator (If the simulator is already running, skip this part)
  2. +
  3. Load a map and an ego vehicle for the test (If a map and an ego are loaded already, skip this part)
  4. +
  5. +

    Run the test using the following command

    +
    python -m pytest test_06_hazard_lights_cmd_and_report.py
    +
    +
  6. +
  7. +

    Check if expected behavior is created within the simulator

    +
      +
    • Ego vehicle hazard lights are turned on (If the simulator has a GUI for this one, it should display the hazard lights are turned on or blinking)
    • +
    • Ego vehicle hazard lights are turned off. This is a reset process. (If the simulator has a GUI for this one, it should display the hazard lights are turned off)
    • +
    +
  8. +
  9. Check if pytest output is passed or failure
  10. +
+

Test Procedures for test_morai_sim#

+

Build process before test#

+
source install/setup.bash
+colcon build --packages-select simulator_compatibility_test
+cd src/universe/autoware.universe/tools/simulator_test/simulator_compatibility_test/test_morai_sim
+
+

Detailed process

+

(WIP)

+

Inner-workings / Algorithms#

+

Inputs / Outputs#

+

Input#

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
/vehicle/status/control_modeautoware_auto_vehicle_msgs::msg::ControlModeReportfor [Test Case #1]
/vehicle/status/gear_statusautoware_auto_vehicle_msgs::msg::GearReportfor [Test Case #2]
/vehicle/status/velocity_statusautoware_auto_vehicle_msgs::msg::VelocityReportfor [Test Case #3]
/vehicle/status/steering_statusautoware_auto_vehicle_msgs::msg::SteeringReportfor [Test Case #4]
/vehicle/status/turn_indicators_statusautoware_auto_vehicle_msgs::msg::TurnIndicatorsReportfor [Test Case #5]
/vehicle/status/hazard_lights_statusautoware_auto_vehicle_msgs::msg::HazardLightsReportfor [Test Case #6]
+

Output#

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
/control/command/control_mode_cmdautoware_auto_vehicle_msgs/ControlModeCommandfor [Test Case #1]
/control/command/gear_cmdautoware_auto_vehicle_msgs/GearCommandfor [Test Case #2]
/control/command/control_cmdautoware_auto_vehicle_msgs/AckermannControlCommandfor [Test Case #3, #4]
/vehicle/status/steering_statusautoware_auto_vehicle_msgs/TurnIndicatorsCommandfor [Test Case #5]
/control/command/turn_indicators_cmdautoware_auto_vehicle_msgs/HazardLightsCommandfor [Test Case #6]
+

Parameters#

+

None.

+

Node Parameters#

+

None.

+

Core Parameters#

+

None.

+

Assumptions / Known limits#

+

None.

+ + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/latest/sitemap.xml b/latest/sitemap.xml index 236218c3..49d271f7 100644 --- a/latest/sitemap.xml +++ b/latest/sitemap.xml @@ -2,17 +2,42 @@ https://autowarefoundation.github.io/autoware_tools/latest/ - 2024-02-16 + 2024-02-19 daily https://autowarefoundation.github.io/autoware_tools/latest/CONTRIBUTING/ - 2024-02-16 + 2024-02-19 daily https://autowarefoundation.github.io/autoware_tools/latest/DISCLAIMER/ - 2024-02-16 + 2024-02-19 + daily + + + https://autowarefoundation.github.io/autoware_tools/latest/common/tier4_debug_tools/ + 2024-02-19 + daily + + + https://autowarefoundation.github.io/autoware_tools/latest/planning/planning_debug_tools/ + 2024-02-19 + daily + + + https://autowarefoundation.github.io/autoware_tools/latest/planning/planning_debug_tools/doc-stop-reason-visualizer/ + 2024-02-19 + daily + + + https://autowarefoundation.github.io/autoware_tools/latest/simulator/simulator_compatibility_test/ + 2024-02-19 + daily + + + https://autowarefoundation.github.io/autoware_tools/latest/vehicle/accel_brake_map_calibrator/ + 2024-02-19 daily \ No newline at end of file diff --git a/latest/sitemap.xml.gz b/latest/sitemap.xml.gz index 342621e0..45a114d9 100644 Binary files a/latest/sitemap.xml.gz and b/latest/sitemap.xml.gz differ diff --git a/latest/vehicle/accel_brake_map_calibrator/index.html b/latest/vehicle/accel_brake_map_calibrator/index.html new file mode 100644 index 00000000..5b96de55 --- /dev/null +++ b/latest/vehicle/accel_brake_map_calibrator/index.html @@ -0,0 +1,1379 @@ + + + + + + + + + + + + + + + + + + + + + + accel_brake_map_calibrator - Autoware Universe Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + +

accel_brake_map_calibrator#

+

The role of this node is to automatically calibrate accel_map.csv / brake_map.csv used in the raw_vehicle_cmd_converter node.

+

The base map, which is lexus's one by default, is updated iteratively with the loaded driving data.

+

How to calibrate#

+

Launch Calibrator#

+

After launching Autoware, run the accel_brake_map_calibrator by the following command and then perform autonomous driving. Note: You can collect data with manual driving if it is possible to use the same vehicle interface as during autonomous driving (e.g. using a joystick).

+
ros2 launch accel_brake_map_calibrator accel_brake_map_calibrator.launch.xml rviz:=true
+
+

Or if you want to use rosbag files, run the following commands.

+
ros2 launch accel_brake_map_calibrator accel_brake_map_calibrator.launch.xml rviz:=true use_sim_time:=true
+ros2 bag play <rosbag_file> --clock
+
+

During the calibration with setting the parameter progress_file_output to true, the log file is output in [directory of accel_brake_map_calibrator]/config/ . You can also see accel and brake maps in [directory of accel_brake_map_calibrator]/config/accel_map.csv and [directory of accel_brake_map_calibrator]/config/brake_map.csv after calibration.

+

Calibration plugin#

+

The rviz:=true option displays the RViz with a calibration plugin as below.

+

+ +

+ +

The current status (velocity and pedal) is shown in the plugin. The color on the current cell varies green/red depending on the current data is valid/invalid. The data that doesn't satisfy the following conditions are considered invalid and will not be used for estimation since aggressive data (e.g. when the pedal is moving fast) causes bad calibration accuracy.

+
    +
  • The velocity and pedal conditions are within certain ranges from the index values.
  • +
  • The steer value, pedal speed, pitch value, etc. are less than corresponding thresholds.
  • +
  • The velocity is higher than a threshold.
  • +
+

The detailed parameters are described in the parameter section.

+

Note: You don't need to worry about whether the current state is red or green during calibration. Just keep getting data until all the cells turn red.

+

The value of each cell in the map is gray at first, and it changes from blue to red as the number of valid data in the cell accumulates. It is preferable to continue the calibration until each cell of the map becomes close to red. In particular, the performance near the stop depends strongly on the velocity of 0 ~ 6m/s range and the pedal value of +0.2 ~ -0.4, range so it is desirable to focus on those areas.

+

Diagnostics#

+

The accel brake map_calibrator publishes diagnostics message depending on the calibration status. +Diagnostic type WARN indicates that the current accel/brake map is estimated to be inaccurate. In this situation, it is strongly recommended to perform a re-calibration of the accel/brake map.

+ + + + + + + + + + + + + + + + + + + + + + + +
StatusDiagnostics TypeDiagnostics messageDescription
No calibration requiredOK"OK"
Calibration RequiredWARN"Accel/brake map Calibration is required."The accuracy of current accel/brake map may be low.
+

This diagnostics status can be also checked on the following ROS topic.

+
ros2 topic echo /accel_brake_map_calibrator/output/update_suggest
+
+

When the diagnostics type is WARN, True is published on this topic and the update of the accel/brake map is suggested.

+

Evaluation of the accel / brake map accuracy#

+

The accuracy of map is evaluated by the Root Mean Squared Error (RMSE) between the observed acceleration and predicted acceleration.

+

TERMS:

+
    +
  • Observed acceleration: the current vehicle acceleration which is calculated as a derivative value of the wheel speed.
  • +
+
    +
  • Predicted acceleration: the output of the original accel/brake map, which the Autoware is expecting. The value is calculated using the current pedal and velocity.
  • +
+

You can check additional error information with the following topics.

+
    +
  • /accel_brake_map_calibrator/output/current_map_error : The error of the original map set in the csv_path_accel/brake_map path. The original map is not accurate if this value is large.
  • +
  • /accel_brake_map_calibrator/output/updated_map_error : The error of the map calibrated in this node. The calibration quality is low if this value is large.
  • +
  • /accel_brake_map_calibrator/output/map_error_ratio : The error ratio between the original map and updated map (ratio = updated / current). If this value is less than 1, it is desirable to update the map.
  • +
+

How to visualize calibration data#

+

The process of calibration can be visualized as below. Since these scripts need the log output of the calibration, the pedal_accel_graph_output parameter must be set to true while the calibration is running for the visualization.

+

Visualize plot of relation between acceleration and pedal#

+

The following command shows the plot of used data in the calibration. In each plot of velocity ranges, you can see the distribution of the relationship between pedal and acceleration, and raw data points with colors according to their pitch angles.

+
ros2 run accel_brake_map_calibrator view_plot.py
+
+

sample pic

+

Visualize statistics about acceleration/velocity/pedal data#

+

The following command shows the statistics of the calibration:

+
    +
  • mean value
  • +
  • standard deviation
  • +
  • number of data
  • +
+

of all data in each map cell.

+
ros2 run accel_brake_map_calibrator view_statistics.py
+
+

sample pic2

+

How to save the calibrated accel / brake map anytime you want#

+

You can save accel and brake map anytime with the following command.

+
ros2 service call /accel_brake_map_calibrator/update_map_dir tier4_vehicle_msgs/srv/UpdateAccelBrakeMap "path: '<accel/brake map directory>'"
+
+

You can also save accel and brake map in the default directory where Autoware reads accel_map.csv/brake_map.csv using the RViz plugin (AccelBrakeMapCalibratorButtonPanel) as following.

+
    +
  1. +

    Click Panels tab, and select AccelBrakeMapCalibratorButtonPanel.

    +

    add_panel

    +
  2. +
  3. +

    Select the panel, and the button will appear at the bottom of RViz.

    +

    calibrator_button_panel

    +
  4. +
  5. +

    Press the button, and the accel / brake map will be saved. + (The button cannot be pressed in certain situations, such as when the calibrator node is not running.)

    +

    push_calibration_button

    +
  6. +
+

Parameters#

+

System Parameters#

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault value
update_methodstringyou can select map calibration method. "update_offset_each_cell" calculates offsets for each grid cells on the map. "update_offset_total" calculates the total offset of the map."update_offset_each_cell"
get_pitch_methodstring"tf": get pitch from tf, "none": unable to perform pitch validation and pitch compensation"tf"
pedal_accel_graph_outputboolif true, it will output a log of the pedal accel graph.true
progress_file_outputboolif true, it will output a log and csv file of the update process.false
default_map_dirstrdirectory of default map[directory of raw_vehicle_cmd_converter]/data/default/
calibrated_map_dirstrdirectory of calibrated map[directory of accel_brake_map_calibrator]/config/
update_hzdoublehz for update10.0
+

Algorithm Parameters#

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault value
initial_covariancedoubleCovariance of initial acceleration map (larger covariance makes the update speed faster)0.05
velocity_min_thresholddoubleSpeeds smaller than this are not used for updating.0.1
velocity_diff_thresholddoubleWhen the velocity data is more than this threshold away from the grid reference speed (center value), the associated data is not used for updating.0.556
max_steer_thresholddoubleIf the steer angle is greater than this value, the associated data is not used for updating.0.2
max_pitch_thresholddoubleIf the pitch angle is greater than this value, the associated data is not used for updating.0.02
max_jerk_thresholddoubleIf the ego jerk calculated from ego acceleration is greater than this value, the associated data is not used for updating.0.7
pedal_velocity_threshdoubleIf the pedal moving speed is greater than this value, the associated data is not used for updating.0.15
pedal_diff_thresholddoubleIf the current pedal value is more then this threshold away from the previous value, the associated data is not used for updating.0.03
max_acceldoubleMaximum value of acceleration calculated from velocity source.5.0
min_acceldoubleMinimum value of acceleration calculated from velocity source.-5.0
pedal_to_accel_delaydoubleThe delay time between actuation_cmd to acceleration, considered in the update logic.0.3
update_suggest_threshdoublethreshold of RMSE ratio that update suggest flag becomes true. ( RMSE ratio: [RMSE of new map] / [RMSE of original map] )0.7
max_data_countintFor visualization. When the data num of each grid gets this value, the grid color gets red.100
accel_brake_value_sourcestringWhether to use actuation_status or actuation_command as accel/brake sources. valuestatus
+

Test utility scripts#

+

Constant accel/brake command test#

+

These scripts are useful to test for accel brake map calibration. These generate an ActuationCmd with a constant accel/brake value given interactively by a user through CLI.

+
    +
  • accel_tester.py
  • +
  • brake_tester.py
  • +
  • actuation_cmd_publisher.py
  • +
+

The accel/brake_tester.py receives a target accel/brake command from CLI. It sends a target value to actuation_cmd_publisher.py which generates the ActuationCmd. You can run these scripts by the following commands in the different terminals, and it will be as in the screenshot below.

+
ros2 run accel_brake_map_calibrator accel_tester.py
+ros2 run accel_brake_map_calibrator brake_tester.py
+ros2 run accel_brake_map_calibrator actuation_cmd_publisher.py
+
+

actuation_cmd_publisher_util

+

Calibration Method#

+

Two algorithms are selectable for the acceleration map update, update_offset_four_cell_around and update_offset_each_cell. Please see the link for details.

+

Data Preprocessing#

+

Before calibration, missing or unusable data (e.g., too large handle angles) must first be eliminated. The following parameters are used to determine which data to remove.

+

Parameters#

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionDefault Value
velocity_min_thresholdExclude minimal velocity0.1
max_steer_thresholdExclude large steering angle0.2
max_pitch_thresholdExclude large pitch angle0.02
max_jerk_thresholdExclude large jerk0.7
pedal_velocity_threshExclude large pedaling speed0.15
+

update_offset_each_cell#

+

Update by Recursive Least Squares(RLS) method using data close enough to each grid.

+

Advantage : Only data close enough to each grid is used for calibration, allowing accurate updates at each point.

+

Disadvantage : Calibration is time-consuming due to a large amount of data to be excluded.

+

Parameters#

+

Data selection is determined by the following thresholds. +| Name | Default Value | +| ----------------------- | ------------- | +| velocity_diff_threshold | 0.556 | +| pedal_diff_threshold | 0.03 |

+

Update formula#

+
\[ +\begin{align} + \theta[n]=& + \theta[n-1]+\frac{p[n-1]x^{(n)}}{\lambda+p[n-1]{(x^{(n)})}^2}(y^{(n)}-\theta[n-1]x^{(n)})\\ + p[n]=&\frac{p[n-1]}{\lambda+p[n-1]{(x^{(n)})}^2} +\end{align} +\]
+

Variables#

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variable nameSymbol
covariance\(p[n-1]\)
map_offset\(\theta[n]\)
forgettingfactor\(\lambda\)
phi\(x(=1)\)
measured_acc\(y\)
+

update_offset_four_cell_around [1]#

+

Update the offsets by RLS in four grids around newly obtained data. By considering linear interpolation, the update takes into account appropriate weights. Therefore, there is no need to remove data by thresholding.

+

Advantage : No data is wasted because updates are performed on the 4 grids around the data with appropriate weighting. +Disadvantage : Accuracy may be degraded due to extreme bias of the data. For example, if data \(z(k)\) is biased near \(Z_{RR}\) in Fig. 2, updating is performed at the four surrounding points ( \(Z_{RR}\), \(Z_{RL}\), \(Z_{LR}\), and \(Z_{LL}\)), but accuracy at \(Z_{LL}\) is not expected.

+ +

+ +

+ +

Implementation#

+

See eq.(7)-(10) in [1] for the updated formula. In addition, eq.(17),(18) from [1] are used for Anti-Windup.

+

References#

+ + +

[1] Gabrielle Lochrie, Michael Doljevic, Mario Nona, Yongsoon Yoon, Anti-Windup Recursive Least Squares Method for Adaptive Lookup Tables with Application to Automotive Powertrain Control Systems, IFAC-PapersOnLine, Volume 54, Issue 20, 2021, Pages 840-845

+ + + + + + +
+
+ + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/latest/vehicle/accel_brake_map_calibrator/media/actuation_cmd_publisher_util.png b/latest/vehicle/accel_brake_map_calibrator/media/actuation_cmd_publisher_util.png new file mode 100644 index 00000000..c29781b2 Binary files /dev/null and b/latest/vehicle/accel_brake_map_calibrator/media/actuation_cmd_publisher_util.png differ diff --git a/latest/vehicle/accel_brake_map_calibrator/media/add_panel.png b/latest/vehicle/accel_brake_map_calibrator/media/add_panel.png new file mode 100644 index 00000000..f045042e Binary files /dev/null and b/latest/vehicle/accel_brake_map_calibrator/media/add_panel.png differ diff --git a/latest/vehicle/accel_brake_map_calibrator/media/calib_rviz_image_sample.png b/latest/vehicle/accel_brake_map_calibrator/media/calib_rviz_image_sample.png new file mode 100644 index 00000000..f21a2549 Binary files /dev/null and b/latest/vehicle/accel_brake_map_calibrator/media/calib_rviz_image_sample.png differ diff --git a/latest/vehicle/accel_brake_map_calibrator/media/calibrator_button_panel.png b/latest/vehicle/accel_brake_map_calibrator/media/calibrator_button_panel.png new file mode 100644 index 00000000..28db957c Binary files /dev/null and b/latest/vehicle/accel_brake_map_calibrator/media/calibrator_button_panel.png differ diff --git a/latest/vehicle/accel_brake_map_calibrator/media/fourcell_RLS.png b/latest/vehicle/accel_brake_map_calibrator/media/fourcell_RLS.png new file mode 100644 index 00000000..8929f3d6 Binary files /dev/null and b/latest/vehicle/accel_brake_map_calibrator/media/fourcell_RLS.png differ diff --git a/latest/vehicle/accel_brake_map_calibrator/media/log_sample.png b/latest/vehicle/accel_brake_map_calibrator/media/log_sample.png new file mode 100644 index 00000000..13887a42 Binary files /dev/null and b/latest/vehicle/accel_brake_map_calibrator/media/log_sample.png differ diff --git a/latest/vehicle/accel_brake_map_calibrator/media/push_calibration_button.png b/latest/vehicle/accel_brake_map_calibrator/media/push_calibration_button.png new file mode 100644 index 00000000..e57ed269 Binary files /dev/null and b/latest/vehicle/accel_brake_map_calibrator/media/push_calibration_button.png differ diff --git a/latest/vehicle/accel_brake_map_calibrator/media/statistics_sample.png b/latest/vehicle/accel_brake_map_calibrator/media/statistics_sample.png new file mode 100644 index 00000000..c36ce9a5 Binary files /dev/null and b/latest/vehicle/accel_brake_map_calibrator/media/statistics_sample.png differ