This page shows how to analyze Autoware with CARET
- Get Autoware project
- Install CARET
- Build Autoware with CARET
- Run Autoware to record trace data
- Create analysis report
- Follow the instruction (Source installation) to install Autoware
- Run the tutorial (Rosbag replay simulation)
- Note:
- We will re-build Autoware with CARET later, but it's recommended to make sure Autoware itself works appropriately in your PC
- This explanation assumes you install Autoware to
${autoware_dir}
(e.g.export autoware_dir=~/autoware
)
- Follow the instruction
- Note:
- This explanation assumes you install CARET to
${caret_dir}
(e.g.export caret_dir=~/ros2_caret_ws/
)
- This explanation assumes you install CARET to
- Note:
- Before building Autoware, CARET needs to be enabled like the following commands
- It's also important to set
BUILD_TESTING=Off
cd ${autoware_dir}
rm -rf build/ install/ log/
source ${caret_dir}/install/local_setup.bash
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=Off -DCMAKE_CXX_FLAGS="-w"
The following command checks if Autoware is built with CARET. It outputs warnings if a package is built without CARET. You can ignore them unless package names which you want to analyze are included in the warning message
cd ${autoware_dir}
ros2 caret check_caret_rclcpp ./
# Expected result
INFO : 2023-01-17 14:12:28 | All packages are built using caret-rclcpp.
# Acceptable result (these packages are not necessary to analyze performance)
WARNING : 2022-08-25 18:14:31 | The following packages have not been built using caret-rclcpp:
tier4_calibration_rviz_plugin
initial_pose_button_panel
autoware_auto_perception_rviz_plugin
tier4_vehicle_rviz_plugin
tier4_control_rviz_plugin
localization_error_monitor
- Note:
- Before running Autoware, some environmental settings need to be done like the following commands
- Please modify map_path and rosbag file for your environment
- Make sure that object detection works and path is created when you set a 2D Goal Pose, so that you can analyze end-to-end path later
- Autoware has lots of nodes and topics. Tracing all events causes huge trace data size and load. So, it's recommended to apply a filter to ignore less important nodes and topics
cd ${autoware_dir}
cp ${path-to-this-repo}/sample_autoware/caret_topic_filter.bash .
- Recording can be started via CLI while autoware is running
- The trace data will be created in
~/.ros/tracing/session-yyyymmddhhmmss
cd ${autoware_dir}
ulimit -n 16384
source ${caret_dir}/setenv_caret.bash
source ./install/local_setup.bash
source ./caret_topic_filter.bash
ros2 launch autoware_launch logging_simulator.launch.xml map_path:=$HOME/work/rosbag_map/universe/sample-map-rosbag vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit
# on another terminal
cd ${autoware_dir}
source ./install/local_setup.bash
ros2 bag play ~/work/rosbag_map/universe/sample-rosbag
# on another terminal
source ${caret_dir}/install/local_setup.bash
ros2 caret record -f 10000 --light
## press enter to start recording, then press enter to stop recording
- The following command checks if trace data is valid
- Please refer to the following explanation for warning messages
- Also, the size of the trace data is usually 1 MByte per second. It's recommended to check trace data size, as well
ros2 caret check_ctf ~/.ros/tracing/session_yyyymmddhhmmss
source ${caret_dir}/install/local_setup.bash
cd ${path-to-this-repo}/sample_autoware
sh ./run.sh
- Before running the script, please modify the settings in
sample_autoware/run.sh
trace_data
: Set path to trace datatarget_path_json
: Use./target_path_latest.json
if you runs the latest Autoware or modify the json file- Setting files in this directory are just a sample, and may not work with your trace data.
- Please modify them for your case. (Explanation)
- Reports are created in
sample_autoware/output/
report_{trace_data_name}/index.html
: general analysis reportval_{trace_data_name}/index.html
: validation report
https://tier4.github.io/caret_doc/latest/faq/faq
-
Build for a package which uses
pcl_ros
fails (e.g.static_centerline_optimizer
,map_loader
)- Please refer to this issue
-
Build fails due to
too few arguments to function ‘void ros_trace_rclcpp_publish(const void*, const void*, uint64_t)’
- Please refer to this issue
- Trace data size is extremely small
- If you use LTTng 2.13+, run the following command before starting Autoware
ulimit -n 65535
- If you use LTTng 2.13+, run the following command before starting Autoware
- Path results in a created report is blank
- Please find
Target path not found
error message in script log and modifytarget_path.json
- If a node in
target_path.json
doesn't run at all while recording, the path will be blank- e.g. If route (2D GOAL) is not set, a path including planning module will be blank
target_path.json
is just a sample and path may be changed as Autoware is modified
- Please find