No version for distro humble. Known supported distros are highlighted in the buttons above.
No version for distro jazzy. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.

accel_brake_map_calibrator package from autodrrt repo

autonomous_emergency_braking control_performance_analysis control_validator external_cmd_selector joy_controller lane_departure_checker mpc_lateral_controller obstacle_collision_checker operation_mode_transition_manager pid_longitudinal_controller predicted_path_checker pure_pursuit shift_decider trajectory_follower_base trajectory_follower_node vehicle_cmd_gate diagnostic_converter kinematic_evaluator localization_evaluator planning_evaluator ekf_localizer geo_pose_projector gyro_odometer ar_tag_based_localizer landmark_manager localization_error_monitor localization_util ndt_scan_matcher pose2twist pose_initializer pose_instability_detector stop_filter tree_structured_parzen_estimator twist2accel yabloc_common yabloc_image_processing yabloc_monitor yabloc_particle_filter yabloc_pose_initializer map_height_fitter map_loader map_projection_loader map_tf_generator lanelet2_map_preprocessor ros2_bevdet ros2_bevformer bevfusion bytetrack cluster_merger compare_map_segmentation crosswalk_traffic_light_estimator detected_object_feature_remover detected_object_validation detection_by_tracker elevation_map_loader euclidean_cluster front_vehicle_velocity_estimator ground_segmentation heatmap_visualizer image_projection_based_fusion lidar_apollo_instance_segmentation lidar_apollo_segmentation_tvm lidar_apollo_segmentation_tvm_nodes lidar_centerpoint lidar_centerpoint_tvm map_based_prediction multi_object_tracker object_merger object_range_splitter object_velocity_splitter occupancy_grid_map_outlier_filter probabilistic_occupancy_grid_map radar_crossing_objects_noise_filter radar_fusion_to_detected_object radar_object_clustering radar_object_tracker radar_tracks_msgs_converter shape_estimation simple_object_merger tensorrt_classifier tensorrt_yolo tensorrt_yolox tracking_object_merger traffic_light_arbiter traffic_light_classifier traffic_light_fine_detector traffic_light_map_based_detector traffic_light_multi_camera_fusion traffic_light_occlusion_predictor traffic_light_ssd_fine_detector traffic_light_visualization behavior_path_avoidance_by_lane_change_module behavior_path_avoidance_module behavior_path_external_request_lane_change_module behavior_path_goal_planner_module behavior_path_lane_change_module behavior_path_planner behavior_path_planner_common behavior_path_side_shift_module behavior_path_start_planner_module behavior_velocity_blind_spot_module behavior_velocity_crosswalk_module behavior_velocity_detection_area_module behavior_velocity_intersection_module behavior_velocity_no_drivable_lane_module behavior_velocity_no_stopping_area_module behavior_velocity_occlusion_spot_module behavior_velocity_out_of_lane_module behavior_velocity_planner behavior_velocity_planner_common behavior_velocity_run_out_module behavior_velocity_speed_bump_module behavior_velocity_stop_line_module behavior_velocity_template_module behavior_velocity_traffic_light_module behavior_velocity_virtual_traffic_light_module behavior_velocity_walkway_module costmap_generator external_velocity_limit_selector freespace_planner freespace_planning_algorithms mission_planner motion_velocity_smoother objects_of_interest_marker_interface obstacle_avoidance_planner obstacle_cruise_planner obstacle_stop_planner obstacle_velocity_limiter path_smoother planning_debug_tools planning_test_utils planning_topic_converter planning_validator route_handler rtc_interface rtc_replayer bezier_sampler frenet_planner path_sampler sampler_common scenario_selector static_centerline_optimizer surround_obstacle_checker gnss_poser image_diagnostics image_transport_decompressor imu_corrector livox_tag_filter pointcloud_preprocessor radar_scan_to_pointcloud2 radar_static_pointcloud_filter radar_threshold_filter radar_tracks_noise_filter tier4_pcl_extensions vehicle_velocity_converter autoware_auto_msgs_adapter bluetooth_monitor component_state_monitor default_ad_api ad_api_adaptors ad_api_visualizers automatic_pose_initializer diagnostic_graph_aggregator dummy_diag_publisher dummy_infrastructure duplicated_node_checker emergency_handler mrm_comfortable_stop_operator mrm_emergency_stop_operator system_error_monitor system_monitor topic_state_monitor velodyne_monitor accel_brake_map_calibrator external_cmd_converter raw_vehicle_cmd_converter steer_offset_estimator vehicle_info_util launch launch_ros autoware_ad_api_specs autoware_adapi_v1_msgs autoware_adapi_version_msgs autoware_auto_common autoware_auto_geometry autoware_auto_control_msgs autoware_auto_geometry_msgs autoware_auto_mapping_msgs autoware_auto_msgs autoware_auto_perception_msgs autoware_auto_planning_msgs autoware_auto_system_msgs autoware_auto_vehicle_msgs autoware_auto_perception_rviz_plugin autoware_auto_tf2 autoware_cmake autoware_lint_common autoware_utils lanelet2_extension autoware_common_msgs autoware_control_msgs autoware_localization_msgs autoware_map_msgs autoware_perception_msgs autoware_planning_msgs autoware_sensing_msgs autoware_system_msgs autoware_vehicle_msgs autoware_point_types autoware_testing bag_time_manager_rviz_plugin component_interface_specs component_interface_tools component_interface_utils cuda_utils fake_test_node geography_utils global_parameter_loader glog_component goal_distance_calculator grid_map_utils interpolation kalman_filter motion_utils object_recognition_utils osqp_interface path_distance_calculator perception_utils polar_grid qp_interface rtc_manager_rviz_plugin signal_processing tensorrt_common tier4_adapi_rviz_plugin tier4_api_utils tier4_automatic_goal_rviz_plugin tier4_autoware_utils tier4_calibration_rviz_plugin tier4_camera_view_rviz_plugin tier4_control_rviz_plugin tier4_datetime_rviz_plugin tier4_debug_rviz_plugin tier4_debug_tools tier4_localization_rviz_plugin tier4_perception_rviz_plugin tier4_planning_rviz_plugin tier4_screen_capture_rviz_plugin tier4_simulated_clock_rviz_plugin tier4_state_rviz_plugin tier4_system_rviz_plugin tier4_target_object_type_rviz_plugin tier4_traffic_light_rviz_plugin tier4_vehicle_rviz_plugin time_utils simulator_compatibility_test traffic_light_recognition_marker_publisher traffic_light_utils tvm_utility dma_customer_msg dma_transfer eagleye_coordinate eagleye_navigation eagleye_msgs eagleye_rt eagleye_can_velocity_converter eagleye_fix2kml eagleye_geo_pose_converter eagleye_geo_pose_fusion eagleye_gnss_converter eagleye_tf llh_converter morai_msgs mussp ndt_omp orocos_kdl python_orocos_kdl pointcloud_to_laserscan rtklib_bridge rtklib_msgs autoware_external_api_msgs autoware_iv_external_api_adaptor autoware_iv_internal_api_adaptor awapi_awiv_adapter tier4_api_msgs tier4_auto_msgs_converter tier4_control_msgs tier4_debug_msgs tier4_external_api_msgs tier4_hmi_msgs tier4_localization_msgs tier4_map_msgs tier4_perception_msgs tier4_planning_msgs tier4_rtc_msgs tier4_simulation_msgs tier4_system_msgs tier4_v2x_msgs tier4_vehicle_msgs io_opt tier4_autoware_api_launch tier4_control_launch tier4_localization_launch tier4_map_launch tier4_perception_launch tier4_planning_launch tier4_sensing_launch tier4_simulator_launch tier4_system_launch tier4_vehicle_launch fastrtps cyclonedds lanelet2 lanelet2_core lanelet2_examples lanelet2_io lanelet2_maps lanelet2_matching lanelet2_projection lanelet2_python lanelet2_routing lanelet2_traffic_rules lanelet2_validation sophus angles behaviortree_cpp_v3 bond bond_core bondcpp bondpy smclib test_bond cudnn_cmake_module diagnostic_aggregator diagnostic_common_diagnostics diagnostic_updater diagnostics self_test filters geodesy geographic_info geographic_msgs grid_map grid_map_cmake_helpers grid_map_core grid_map_costmap_2d grid_map_cv grid_map_demos grid_map_filters grid_map_loader grid_map_msgs grid_map_octomap grid_map_pcl grid_map_ros grid_map_rviz_plugin grid_map_sdf grid_map_visualization mrt_cmake_modules nav2_amcl nav2_behavior_tree nav2_behaviors nav2_bringup nav2_bt_navigator nav2_collision_monitor nav2_common nav2_controller nav2_core nav2_costmap_2d costmap_queue dwb_core dwb_critics dwb_msgs dwb_plugins nav2_dwb_controller nav_2d_msgs nav_2d_utils nav2_lifecycle_manager nav2_map_server nav2_msgs nav2_navfn_planner nav2_planner nav2_regulated_pure_pursuit_controller nav2_rotation_shim_controller nav2_rviz_plugins nav2_simple_commander nav2_smac_planner nav2_smoother nav2_system_tests nav2_theta_star_planner nav2_util nav2_velocity_smoother nav2_voxel_grid nav2_waypoint_follower navigation2 dynamic_edt_3d octomap octovis octomap_msgs osqp_vendor pacmod3_msgs pcl_msgs pcl_conversions pcl_ros perception_pcl point_cloud_msg_wrapper radar_msgs can_msgs rqt_tf_tree tensorrt_cmake_module topic_tools topic_tools_interfaces tvm_vendor cv_bridge image_geometry opencv_tests vision_opencv xacro rviz2 rviz_assimp_vendor rviz_common rviz_default_plugins rviz_ogre_vendor rviz_rendering rviz_rendering_tests rviz_visual_testing_framework dummy_perception_publisher fault_injection simple_planning_simulator classformsg node_v2x image_view v4l2_camera can_interface_custom cgi430_can_driver cgi610_driver ARS408_driver data_format_dump data_preprocess_launch lidar_centerpoint_collect lidar_saver message_sync time_cal camera_calibration direct_visual_lidar_calibration multi_lidar_calibration

Package Summary

Tags No category tags.
Version 0.1.0
License Apache License 2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ieiauto/autodrrt.git
VCS Type git
VCS Version main
Last Updated 2024-09-19
Dev Status UNMAINTAINED
CI status No Continuous Integration
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

The accel_brake_map_calibrator

Additional Links

No additional links.

Maintainers

  • Tomoya Kimura
  • Taiki Tanaka
  • Takeshi Miura

Authors

No additional authors.

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.

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

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. Select the panel, and the button will appear at the bottom of RViz.

    calibrator_button_panel

  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.)

    push_calibration_button

Parameters

System Parameters

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

Algorithm Parameters

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

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

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

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 name Symbol
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

CHANGELOG
No CHANGELOG found.

Wiki Tutorials

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

  • launch/accel_brake_map_calibrator.launch.xml
      • accel_brake_map_calib_param [default: $(find-pkg-share accel_brake_map_calibrator)/config/accel_brake_map_calibrator.param.yaml]
      • csv_default_map_dir [default: $(find-pkg-share raw_vehicle_cmd_converter)/data/default/]
      • csv_calibrated_map_dir [default: $(find-pkg-share accel_brake_map_calibrator)/config/]
      • logger_level [default: info]
      • rviz [default: true]
      • pedal_accel_graph_output [default: true]
      • progress_file_output [default: false]
      • use_sim_time [default: false]
      • calibration_method [default: each_cell]

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged accel_brake_map_calibrator at Robotics Stack Exchange

No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro iron. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.