Skip to content

Commit 94ca733

Browse files
committed
feat: update style and readme
Signed-off-by: Berkay Karaman <brkay54@gmail.com>
1 parent 3c480f1 commit 94ca733

File tree

6 files changed

+165
-119
lines changed

6 files changed

+165
-119
lines changed

tools/reaction_analyzer/README.md

+83-34
Original file line numberDiff line numberDiff line change
@@ -55,68 +55,77 @@ pre-defined topics you want to measure their reaction times.
5555

5656
### Prepared Test Environment
5757

58-
Firstly, you need to download the demonstration test map from the
59-
link [here](https://github.com/tier4/AWSIM/releases/download/v1.1.0/nishishinjuku_autoware_map.zip). After downloading,
60-
extract the zip file and use its path as `[MAP_PATH]` in the following commands.
58+
- Download the demonstration test map from the
59+
link [here](https://github.com/tier4/AWSIM/releases/download/v1.1.0/nishishinjuku_autoware_map.zip). After
60+
downloading,
61+
extract the zip file and use its path as `[MAP_PATH]` in the following commands.
6162

6263
#### Planning Control Mode
6364

64-
Firstly, you need to define only Planning and Control nodes in the `reaction_chain` list. With the default parameters,
65-
you can start to test with the following command:
65+
- You need to define only Planning and Control nodes in the `reaction_chain` list. With the default parameters,
66+
you can start to test with the following command:
6667

6768
```bash
6869
ros2 launch reaction_analyzer reaction_analyzer.launch.xml running_mode:=planning_control vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit map_path:=[MAP_PATH]
6970
```
7071

71-
After the command, the simple_planning_simulator and the reaction_analyzer will be launched. It will automatically start
72-
to test. After the test is completed, the results will be stored in the `output_file_path` you defined.
72+
After the command, the `simple_planning_simulator` and the `reaction_analyzer` will be launched. It will automatically
73+
start to test. After the test is completed, the results will be stored in the `output_file_path` you defined.
7374

7475
#### Perception Planning Mode
7576

76-
Firstly, you need to download the rosbag files from the
77-
link [here](https://drive.google.com/file/d/1_P-3oy_M6eJ7fk8h5CP8V6s6da6pPrBu/view?usp=sharing). After downloading,
78-
extract the zip file and set the path of the `.db3` files to parameters `path_bag_without_object`
79-
and `path_bag_with_object`. Because custom sensor setup, you need to checkout the following branches before launch the
80-
reaction analyzer: For the `autoware_individual_params` repository, checkout the
81-
branch [here](https://github.com/brkay54/autoware_individual_params/tree/bk/reaction-analyzer-config). For
82-
the `awsim_sensor_kit_launch` repository, checkout the
83-
branch [here](https://github.com/brkay54/awsim_sensor_kit_launch/tree/bk/reaction-analyzer-config).
84-
After you checkouted the branches, you can start to test with the following command:
77+
- Download the rosbag files from the Google Drive
78+
link [here](https://drive.google.com/file/d/1_P-3oy_M6eJ7fk8h5CP8V6s6da6pPrBu/view?usp=sharing).
79+
- Extract the zip file and set the path of the `.db3` files to parameters `path_bag_without_object`
80+
and `path_bag_with_object`.
81+
- Because custom sensor setup, you need to check out the following branches before launch the
82+
reaction analyzer: For the `autoware_individual_params` repository, check out the
83+
branch [here](https://github.com/brkay54/autoware_individual_params/tree/bk/reaction-analyzer-config).
84+
- For the `awsim_sensor_kit_launch` repository, check out the
85+
branch [here](https://github.com/brkay54/awsim_sensor_kit_launch/tree/bk/reaction-analyzer-config).
86+
- After you check outed the branches, you can start to test with the following command:
8587

8688
```bash
8789
ros2 launch reaction_analyzer reaction_analyzer.launch.xml running_mode:=perception_planning vehicle_model:=sample_vehicle sensor_model:=awsim_sensor_kit map_path:=[MAP_PATH]
8890
```
8991

90-
After the command, the e2e_simulator and the reaction_analyzer will be launched. It will automatically start
92+
After the command, the `e2e_simulator` and the `reaction_analyzer` will be launched. It will automatically start
9193
to test. After the test is completed, the results will be stored in the `output_file_path` you defined.
9294

9395
### Custom Test Environment
9496

95-
If you want to run the reaction analyzer with your custom test environment, you need to redefine some of the parameters.
96-
The parameters you need to redefine are `initialization_pose`, `entity_params`, `goal_pose`, and `topic_publisher`
97-
parameters.
98-
For `initialization_pose`, `entity_params`, `goal_pose`, you can upload your `.osm` map file into
99-
the [scenario editor](https://scenario.ci.tier4.jp/scenario_editor/) to define the position of the position parameters.
100-
You can define the positions with respect to you desired root. Firstly, add EGO vehicle from edit/add entity/Ego to map.
101-
Set destination to EGO vehicle and add another dummy object in same way. The dummy object represents the object spawn
102-
suddenly in the reaction analyzer test. After you set up the positions in the map, we should get the positions of these
103-
entities in the map frame. To achieve this, you should convert the positions to map frame by changing Map/Coordinate to
104-
World and Map/Orientation to Euler. After these steps, you can see the positions in map frame and euler angles. You can
105-
change the `initialization_pose`, `entity_params`, `goal_pose` parameters with the values you get from the website.
106-
107-
For the `topic_publisher` parameters, you need to record the rosbags from the AWSIM. After opened your AWSIM
97+
**If you want to run the reaction analyzer with your custom test environment, you need to redefine some of the parameters.
98+
The parameters you need to redefine are `initialization_pose`, `entity_params`, `goal_pose`, and `topic_publisher` (
99+
for `perception_planning` mode) parameters.**
100+
101+
- To set `initialization_pose`, `entity_params`, `goal_pose`:
102+
- Upload your `.osm` map file into the [scenario editor](https://scenario.ci.tier4.jp/scenario_editor/) to define the position of the position parameters.
103+
- Add EGO vehicle from edit/add entity/Ego to map.
104+
- Set destination to EGO vehicle and add another dummy object in same way. The dummy object represents the object spawn
105+
suddenly in the reaction analyzer test.
106+
107+
**After you set up the positions in the map, we should get the positions of these entities in the map frame. To achieve this:**
108+
109+
- Convert the positions to map frame by changing Map/Coordinate to World and Map/Orientation to Euler in Scenario Editor.
110+
111+
- After these steps, you can see the positions in map frame and euler angles. You can change the `initialization_pose`, `entity_params`, `goal_pose` parameters with the values you get from the website.
112+
113+
**For the `topic_publisher` parameters, you need to record the rosbags from the AWSIM. After opened your AWSIM
108114
environment, you should record two different rosbags. However, the environment should be static and the position of the
109-
vehicle should be same. Firstly, record a rosbag in empty environment. After that, record another rosbag in the same
110-
environment except add an object in front of the vehicle. After you record the rosbags, you can set
111-
the `path_bag_without_object` and `path_bag_with_object` parameters with the paths of the recorded rosbags.
115+
vehicle should be same.**
116+
117+
- Record a rosbag in empty environment (without an obstacle in front of the vehicle).
118+
- After that, record another rosbag in the same environment except add an object in front of the vehicle.
119+
120+
**After you record the rosbags, you can set the `path_bag_without_object` and `path_bag_with_object` parameters with the paths of the recorded rosbags.**
112121

113122
## Parameters
114123

115124
| Name | Type | Description |
116125
| ---------------------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
117126
| `timer_period` | double | [s] Period for the main processing timer. |
118127
| `test_iteration` | int | Number of iterations for the test. |
119-
| `output_file_path` | string | Directory path where test results and statictics will be stored. |
128+
| `output_file_path` | string | Directory path where test results and statistics will be stored. |
120129
| `object_search_radius_offset` | double | [m] Additional radius added to the search area when looking for objects. |
121130
| `spawn_time_after_init` | double | [s] Time delay after initialization before spawning objects. Only valid `perception_planning` mode. |
122131
| `spawn_distance_threshold` | double | [m] Distance threshold for spawning objects. Only valid `planning_control` mode. |
@@ -136,3 +145,43 @@ the `path_bag_without_object` and `path_bag_with_object` parameters with the pat
136145
| `reaction_params.search_zero_vel_params.max_looking_distance` | double | [m] Maximum looking distance for zero velocity on trajectory |
137146
| `reaction_params.search_entity_params.search_radius` | double | [m] Searching radius for spawned entity. Distance between ego pose and entity pose. |
138147
| `reaction_chain` | struct | List of the nodes with their topics and topic's message types. |
148+
149+
## Limitations
150+
151+
- Reaction analyzer has some limitation like `PublisherMessageType`, `SubscriberMessageType` and `ReactionType`. It is
152+
currently supporting following list:
153+
154+
- **Publisher Message Types:**
155+
156+
- `sensor_msgs/msg/PointCloud2`
157+
- `sensor_msgs/msg/CameraInfo`
158+
- `sensor_msgs/msg/Image`
159+
- `geometry_msgs/msg/PoseWithCovarianceStamped`
160+
- `sensor_msgs/msg/Imu`
161+
- `autoware_auto_vehicle_msgs/msg/ControlModeReport`
162+
- `autoware_auto_vehicle_msgs/msg/GearReport`
163+
- `autoware_auto_vehicle_msgs/msg/HazardLightsReport`
164+
- `autoware_auto_vehicle_msgs/msg/SteeringReport`
165+
- `autoware_auto_vehicle_msgs/msg/TurnIndicatorsReport`
166+
- `autoware_auto_vehicle_msgs/msg/VelocityReport`
167+
168+
- **Subscriber Message Types:**
169+
170+
- `sensor_msgs/msg/PointCloud2`
171+
- `autoware_auto_perception_msgs/msg/DetectedObjects`
172+
- `autoware_auto_perception_msgs/msg/TrackedObjects`
173+
- `autoware_auto_msgs/msg/PredictedObject`
174+
- `autoware_auto_planning_msgs/msg/Trajectory`
175+
- `autoware_auto_control_msgs/msg/AckermannControlCommand`
176+
177+
- **Reaction Types:**
178+
- `FIRST_BRAKE`
179+
- `SEARCH_ZERO_VEL`
180+
- `SEARCH_ENTITY`
181+
182+
## Future improvements
183+
184+
- The reaction analyzer can be improved by adding more reaction types. Currently, it is supporting only `FIRST_BRAKE`,
185+
`SEARCH_ZERO_VEL`, and `SEARCH_ENTITY` reaction types. It can be extended by adding more reaction types for each of
186+
the
187+
message types.

tools/reaction_analyzer/include/topic_publisher.hpp

+15-15
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ using nav_msgs::msg::Odometry;
5454
using sensor_msgs::msg::PointCloud2;
5555

5656
enum class PublisherMessageType {
57-
Unknown = 0,
58-
CameraInfo = 1,
59-
Image = 2,
60-
PointCloud2 = 3,
61-
PoseWithCovarianceStamped = 4,
62-
Imu = 5,
63-
ControlModeReport = 6,
64-
GearReport = 7,
65-
HazardLightsReport = 8,
66-
SteeringReport = 9,
67-
TurnIndicatorsReport = 10,
68-
VelocityReport = 11,
57+
UNKNOWN = 0,
58+
CAMERA_INFO = 1,
59+
IMAGE = 2,
60+
POINTCLOUD2 = 3,
61+
POSE_WITH_COVARIANCE_STAMPED = 4,
62+
IMU = 5,
63+
CONTROL_MODE_REPORT = 6,
64+
GEAR_REPORT = 7,
65+
HAZARD_LIGHTS_REPORT = 8,
66+
STEERING_REPORT = 9,
67+
TURN_INDICATORS_REPORT = 10,
68+
VELOCITY_REPORT = 11,
6969
};
7070

7171
struct TopicPublisherParams
@@ -77,9 +77,9 @@ struct TopicPublisherParams
7777
};
7878

7979
enum class PointcloudPublisherType {
80-
AsyncPublisher = 0, // Asynchronous publisher
81-
SyncHeaderSyncPublisher = 1, // Synchronous publisher with header synchronization
82-
AsyncHeaderSyncPublisher = 2, // Asynchronous publisher with header synchronization
80+
ASYNC_PUBLISHER = 0, // Asynchronous publisher
81+
SYNC_HEADER_SYNC_PUBLISHER = 1, // Synchronous publisher with header synchronization
82+
ASYNC_HEADER_SYNC_PUBLISHER = 2, // Asynchronous publisher with header synchronization
8383
};
8484

8585
/**

tools/reaction_analyzer/param/reaction_analyzer.param.yaml

+16-16
Original file line numberDiff line numberDiff line change
@@ -53,64 +53,64 @@
5353
obstacle_stop_planner:
5454
topic_name: /planning/scenario_planning/lane_driving/trajectory
5555
time_debug_topic_name: /planning/scenario_planning/lane_driving/trajectory/debug/published_time
56-
message_type: autoware_auto_planning_msgs::msg::Trajectory
56+
message_type: autoware_auto_planning_msgs/msg/Trajectory
5757
scenario_selector:
5858
topic_name: /planning/scenario_planning/scenario_selector/trajectory
5959
time_debug_topic_name: /planning/scenario_planning/scenario_selector/trajectory/debug/published_time
60-
message_type: autoware_auto_planning_msgs::msg::Trajectory
60+
message_type: autoware_auto_planning_msgs/msg/Trajectory
6161
motion_velocity_smoother:
6262
topic_name: /planning/scenario_planning/motion_velocity_smoother/trajectory
6363
time_debug_topic_name: /planning/scenario_planning/motion_velocity_smoother/trajectory/debug/published_time
64-
message_type: autoware_auto_planning_msgs::msg::Trajectory
64+
message_type: autoware_auto_planning_msgs/msg/Trajectory
6565
planning_validator:
6666
topic_name: /planning/scenario_planning/trajectory
6767
time_debug_topic_name: /planning/scenario_planning/trajectory/debug/published_time
68-
message_type: autoware_auto_planning_msgs::msg::Trajectory
68+
message_type: autoware_auto_planning_msgs/msg/Trajectory
6969
# trajectory_follower:
7070
# topic_name: /control/trajectory_follower/control_cmd
7171
# time_debug_topic_name: /control/trajectory_follower/control_cmd/debug/published_time
72-
# message_type: autoware_auto_control_msgs::msg::AckermannControlCommand
72+
# message_type: autoware_auto_control_msgs/msg/AckermannControlCommand
7373
# vehicle_cmd_gate:
7474
# topic_name: /control/command/control_cmd
7575
# time_debug_topic_name: /control/command/control_cmd/debug/published_time
76-
# message_type: autoware_auto_control_msgs::msg::AckermannControlCommand
76+
# message_type: autoware_auto_control_msgs/msg/AckermannControlCommand
7777
common_ground_filter:
7878
topic_name: /perception/obstacle_segmentation/single_frame/pointcloud_raw
7979
time_debug_topic_name: /perception/obstacle_segmentation/single_frame/pointcloud_raw/debug/published_time
80-
message_type: sensor_msgs::msg::PointCloud2
80+
message_type: sensor_msgs/msg/PointCloud2
8181
occupancy_grid_map_outlier:
8282
topic_name: /perception/obstacle_segmentation/pointcloud
8383
time_debug_topic_name: /perception/obstacle_segmentation/pointcloud/debug/published_time
84-
message_type: sensor_msgs::msg::PointCloud2
84+
message_type: sensor_msgs/msg/PointCloud2
8585
multi_object_tracker:
8686
topic_name: /perception/object_recognition/tracking/near_objects
8787
time_debug_topic_name: /perception/object_recognition/tracking/near_objects/debug/published_time
88-
message_type: autoware_auto_perception_msgs::msg::TrackedObjects
88+
message_type: autoware_auto_perception_msgs/msg/TrackedObjects
8989
lidar_centerpoint:
9090
topic_name: /perception/object_recognition/detection/centerpoint/objects
9191
time_debug_topic_name: /perception/object_recognition/detection/centerpoint/objects/debug/published_time
92-
message_type: autoware_auto_perception_msgs::msg::DetectedObjects
92+
message_type: autoware_auto_perception_msgs/msg/DetectedObjects
9393
obstacle_pointcloud_based_validator:
9494
topic_name: /perception/object_recognition/detection/centerpoint/validation/objects
9595
time_debug_topic_name: /perception/object_recognition/detection/centerpoint/validation/objects/debug/published_time
96-
message_type: autoware_auto_perception_msgs::msg::DetectedObjects
96+
message_type: autoware_auto_perception_msgs/msg/DetectedObjects
9797
decorative_tracker_merger:
9898
topic_name: /perception/object_recognition/tracking/objects
9999
time_debug_topic_name: /perception/object_recognition/tracking/objects/debug/published_time
100-
message_type: autoware_auto_perception_msgs::msg::TrackedObjects
100+
message_type: autoware_auto_perception_msgs/msg/TrackedObjects
101101
detected_object_feature_remover:
102102
topic_name: /perception/object_recognition/detection/clustering/objects
103103
time_debug_topic_name: /perception/object_recognition/detection/clustering/objects/debug/published_time
104-
message_type: autoware_auto_perception_msgs::msg::DetectedObjects
104+
message_type: autoware_auto_perception_msgs/msg/DetectedObjects
105105
detection_by_tracker:
106106
topic_name: /perception/object_recognition/detection/detection_by_tracker/objects
107107
time_debug_topic_name: /perception/object_recognition/detection/detection_by_tracker/objects/debug/published_time
108-
message_type: autoware_auto_perception_msgs::msg::DetectedObjects
108+
message_type: autoware_auto_perception_msgs/msg/DetectedObjects
109109
object_lanelet_filter:
110110
topic_name: /perception/object_recognition/detection/objects
111111
time_debug_topic_name: /perception/object_recognition/detection/objects/debug/published_time
112-
message_type: autoware_auto_perception_msgs::msg::DetectedObjects
112+
message_type: autoware_auto_perception_msgs/msg/DetectedObjects
113113
map_based_prediction:
114114
topic_name: /perception/object_recognition/objects
115115
time_debug_topic_name: /perception/object_recognition/objects/debug/published_time
116-
message_type: autoware_auto_perception_msgs::msg::PredictedObjects
116+
message_type: autoware_auto_perception_msgs/msg/PredictedObjects

tools/reaction_analyzer/src/reaction_analyzer_node.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ void ReactionAnalyzerNode::onTimer()
162162
mutex_.unlock();
163163

164164
// Init the test environment
165-
166165
if (!test_environment_init_time_) {
167166
initEgoForTest(initialization_state_ptr, route_state_ptr, operation_mode_ptr);
168167
return;
@@ -176,7 +175,6 @@ void ReactionAnalyzerNode::onTimer()
176175

177176
if (message_buffers) {
178177
// if reacted, calculate the results
179-
180178
calculateResults(message_buffers.value(), spawn_cmd_time.value());
181179
reset();
182180
}

0 commit comments

Comments
 (0)