Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
brkay54 committed Jan 3, 2024
1 parent 370ffe2 commit 4cb81a3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions tools/reaction_analyzer/README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,65 @@
# Reaction Analyzer

The main purpose of the reaction analayzer package is measuring reaction times of the nodes by listening the output
The main purpose of the reaction analyzer package is measuring reaction times of the nodes by listening the
pre-determined output
topics.

## Design For Psim

![PsimObserver.png](media%2FPsimObserver.png)

Two main modules are running: Spawner and Observer.

### Spawner

The main purpose of the `Spawner` is to create the entities within a condition. The `Spawner` takes the object
The main purpose of the `Spawner` is imitating the perception pipeline outputs by creating the entities within a
condition. The `Spawner` takes the object
and ego pose as inputs, and it creates obstacles with respect to position and orientation of center of mass and
dimension of the objects. After creating pointcloud and predicted objects, it waits for `Spawn Conditioning Mechanism`
to publish the messages to topics.

**Spawn Conditioning Mechanism**
Distance_between_ref_point_and_ego < some_threshold -> spawn obstacle

### RosObserver
### Observer

The `RosObserver Node` is responsible for watching the messages inside the topics by subscription and analyze them to
The `Observer` is responsible for watching the messages inside the pre-determined topics by subscription and analyze
them to
understand node is reacted or not. After `Spawner` publishes the Entities, it activates the observer's search functions.
For the PSim, after `Spawner` activates the `RosObserver`, it detects reaction messages and measure reaction time.
Currently, it measures following durations:
For the PSim, after `Spawner` activates the `Observer`, it detects reaction messages and measure reaction time.
Currently, it supports following message types:

- Duration between spawn_cmd_time - trajectory_follower reaction
- Duration between trajectory_follower - vehicle_cmd_gate reaction
- autoware_auto_control_msgs::msg::AckermannControlCommand
- autoware_auto_planning_msgs::msg::Trajectory

### Usage

Firstly, we need to set obstacle position to reaction_analyzer parameter file. Reaction_analyzer takes entity's map
position. After deciding which map will be used, you can upload your map to scenario_editor, and put an entity to
lanelet map. Then, convert the coordinate frame to map, you can see the entity's position in the map frame. Save the
position, orientation, and dimensions to parameter file of the node.
Download the demonstration test map from the link here:
https://drive.google.com/file/d/1zHdSazcH9uQvw1Afj_6TL9N8d7_Z88Yu/view?usp=sharing

If you want to make this test on another map, you need to arrange the test environment variables in parameter file. To
do this:

- Upload your map to scenario_editor
- Locate the ego, entity, and goal pose
- After locate necessary entities, change coordinate to world and orientation to euler from map section of scenario
editor.
- Change initial position, goal position, and entity's position and dimension in parameter file w.r.t. values in
scenario editor.

For quick test, you can use the default parameter values with the map shared above.

After entity parameters are set into parameter file, you can start to test. To do this:

- Launch PSim.

`ros2 launch autoware_launch planning_simulator.launch.xml map_path:=[MAP_PATH] vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit`

- Initialize the EGO in your test area and set a goal behind the entity.
- Launch `reaction_analyzer.launch.xml`

`ros2 launch reaction_analyzer reaction_analyzer.launch.xml`

- Set the Autonomous Driving Mode and wait until the Spawner is triggered, after it spawns the obstacles, you can see the reaction durations in the
terminal.
- For the next test, re-open the reaction_analyzer.
- Reaction analyzer initializes the test environment, and starts to test automatically.

**PS**: While running the reaction_analyzer, you should be sure that dummy_perception and other perception modules are
not running. In current branch of the package, all perception related modules are removed from the simulator launch
file (src/universe/autoware.universe/launch/tier4_simulator_launch/launch/simulator.launch.xml), and you can start PSim
directly.
**PS**: This tool is currently under development. To do better measurements, some temporarily commits for other packages
are added to branch. After checkout the branch, build all the Autoware before launch reaction analyzer.
Binary file modified tools/reaction_analyzer/media/PsimObserver.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4cb81a3

Please sign in to comment.