Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(reaction_analyzer): add reaction anaylzer tool to measure end-to-end delay in sudden obstacle braking response #5954

Merged
merged 14 commits into from
May 17, 2024

Conversation

brkay54
Copy link
Member

@brkay54 brkay54 commented Dec 25, 2023

Description

Main issue:

Strictly depends on:

Optionally depends on:

The main purpose of the reaction analyzer package is to measure the reaction times of the nodes by listening to the
pre-determined topics. It can be used for measuring the reaction time of the perception pipeline, planning pipeline, and
control pipeline. To be able to measure both control outputs and perception outputs, it is necessary to divide the node
into two running_mode: planning_control and perception_planning.

Planning Control Mode

In this mode, the reaction analyzer creates a dummy publisher for the PredictedObjects and PointCloud topics. In the
beginning of the test, it publishes the initial position of the ego vehicle and the goal position to set the test
environment. Then, it spawns a sudden obstacle in front of the ego vehicle. After the obstacle is spawned, it starts to
measure the pre-determined topics to catch the reacted messages of the planning and control nodes. When all the topics are reacted, it calculates the reaction time of the nodes and statistics, and it creates a csv file to store the
results.

Perception Planning Mode

In this mode, the reaction analyzer reads the rosbag files which are recorded from AWSIM, and it creates a topic
publisher for each topic to replay the rosbag. It reads two rosbag files: path_bag_without_object
and path_bag_with_object. Firstly, it replays the path_bag_without_object to set the initial position of the ego
vehicle and the goal position. After spawn_time_after_init seconds, it replays the path_bag_with_object to spawn a
sudden obstacle in front of the ego vehicle. After the obstacle is spawned, it starts to measure the pre-determined
topics to catch the reacted messages of the perception and planning nodes. When all the topics are reacted, it
calculates
the reaction time of the nodes and statistics, and it creates a CSV file to store the results.

Related links

Related Issue:

Tests performed

You can see the results in the Excel table here. You can see the test dates below the page.
Also, some tests were shared in issues comments: #5540

Notes for reviewers

This PR currently depends on other PR below:

Interface changes

Effects on system behavior

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@brkay54 brkay54 self-assigned this Dec 25, 2023
@brkay54 brkay54 marked this pull request as draft December 25, 2023 06:02
@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:control Vehicle control algorithms and mechanisms. (auto-assigned) component:tools Utility and debugging software. (auto-assigned) component:launch Launch files, scripts and initialization tools. (auto-assigned) labels Dec 25, 2023
@brkay54 brkay54 force-pushed the feat/reaction-measure-tool branch 5 times, most recently from eaff394 to ecf4c0f Compare December 28, 2023 11:29
@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Dec 28, 2023
@brkay54 brkay54 requested a review from xmfcx January 3, 2024 14:44
@brkay54 brkay54 force-pushed the feat/reaction-measure-tool branch from 356b216 to 4cb81a3 Compare January 3, 2024 14:44
@brkay54 brkay54 force-pushed the feat/reaction-measure-tool branch 3 times, most recently from 79b9056 to ae041f9 Compare January 21, 2024 17:03
@brkay54 brkay54 force-pushed the feat/reaction-measure-tool branch from 5d693bc to 5cc6583 Compare January 24, 2024 14:43
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jan 25, 2024
@brkay54 brkay54 force-pushed the feat/reaction-measure-tool branch 5 times, most recently from efdd814 to 7d7adba Compare January 31, 2024 12:38
@brkay54 brkay54 force-pushed the feat/reaction-measure-tool branch from 7103a8c to 995bab5 Compare May 14, 2024 12:49
@brkay54
Copy link
Member Author

brkay54 commented May 14, 2024

@mitsudome-r -san, I guess, I found the problem. When we start to publish the empty pointcloud before the initialization, it causes the crash above. We should publish the pointcloud message after the vehicle is initialized. I tried 7 times in planning_control mode and I didn't get the error we mentioned above. When you have time, could you test it again with the latest commit?

@beyzanurkaya
Copy link
Contributor

Very nice work @brkay54
I tried this PR on my own computer and I think a few minor improvements can be made.

  • Firstly, when running the planning_control mode without making any changes to the param file, including file paths, I noticed that even with invalid file paths in the param file, the node worked without giving any error or warning. You can throw an error when an invalid file path is given to make sure the user can see the results after testing.

  • Secondly, in the scenario created for the planning_control mode, the vehicle starts driving and stops for an object close to the goal point, abruptly ending the test. However, since the object is far from the ego's starting point, it may not be immediately clear whether there is an object at that point until the vehicle moves forward for a while. This could lead to confusion about why the test ends at that specific point. To improve clarity, you can add a marker symbolizing the object there or start the next test a few seconds after the vehicle has stopped completely.

  • When I ran the perception_planning mode (with no changes made to the param file other than the bag and output file paths), I encountered an issue where the test did not complete. Although the vehicle was initialized, the goal was set, and the route was generated with objects properly detected, the test did not proceed beyond this point. No output file was created. However, when I commented out the control topics in the yaml file and retried, the tests were completed successfully, and the result file was created. In this regard, it would be useful for users to specify the reaction topics that the mods expect separately or to add a warning about this to the readme.

Also, I did not encounter any node crashes like in the last comment. I think the README file was quite descriptive. Overall, it's a well-done piece of work!

brkay54 and others added 13 commits May 17, 2024 03:24
…-end delay in sudden obstacle braking response

Signed-off-by: Berkay Karaman <[email protected]>
Signed-off-by: Berkay Karaman <[email protected]>
…_pointcloud_with_object

Signed-off-by: Berkay Karaman <[email protected]>
Signed-off-by: Berkay Karaman <[email protected]>
Signed-off-by: Berkay Karaman <[email protected]>
Signed-off-by: Berkay Karaman <[email protected]>
Signed-off-by: Berkay Karaman <[email protected]>
…ine latency, update readme

Signed-off-by: Berkay Karaman <[email protected]>
Signed-off-by: Berkay Karaman <[email protected]>
@brkay54 brkay54 force-pushed the feat/reaction-measure-tool branch 2 times, most recently from 18a452d to 3b6ef51 Compare May 17, 2024 00:28
@brkay54
Copy link
Member Author

brkay54 commented May 17, 2024

@beyzanurkaya Thank you for the review.

Firstly, when running the planning_control mode without making any changes to the param file, including file paths, I noticed that even with invalid file paths in the param file, the node worked without giving any error or warning. You can throw an error when an invalid file path is given to make sure the user can see the results after testing.

I have added a condition for checking whether the output path is valid or not at the beginning of the node.

Secondly, in the scenario created for the planning_control mode, the vehicle starts driving and stops for an object close to the goal point, abruptly ending the test. However, since the object is far from the ego's starting point, it may not be immediately clear whether there is an object at that point until the vehicle moves forward for a while. This could lead to confusion about why the test ends at that specific point. To improve clarity, you can add a marker symbolizing the object there or start the next test a few seconds after the vehicle has stopped completely.

Thank you for the suggestion. I added a debug marker for the entity that will be spawned.

When I ran the perception_planning mode (with no changes made to the param file other than the bag and output file paths), I encountered an issue where the test did not complete. Although the vehicle was initialized, the goal was set, and the route was generated with objects properly detected, the test did not proceed beyond this point. No output file was created. However, when I commented out the control topics in the yaml file and retried, the tests were completed successfully, and the result file was created. In this regard, it would be useful for users to specify the reaction topics that the mods expect separately or to add a warning about this to the readme.

Because the vehicle is not moving in perception_planning mode, the control topics may not react. Thus the reaction_analyzer waits for them to react. I added this warning in the readme, I also added a warning message prints reaction_analyzer is waiting for which node.

I appreciate your review. Could you also try with the last commit?

@brkay54 brkay54 force-pushed the feat/reaction-measure-tool branch from 3b6ef51 to 98df256 Compare May 17, 2024 02:15
@brkay54 brkay54 force-pushed the feat/reaction-measure-tool branch from c10fb5c to f74c83f Compare May 17, 2024 02:18
Copy link
Member

@mitsudome-r mitsudome-r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brkay54 brkay54 dismissed yukkysaito’s stale review May 17, 2024 08:12

It was old review.

Copy link
Contributor

@beyzanurkaya beyzanurkaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brkay54 brkay54 merged commit 90f50b7 into autowarefoundation:main May 17, 2024
22 of 28 checks passed
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…-end delay in sudden obstacle braking response (autowarefoundation#5954)

* feat(reaction_analyzer): add reaction anaylzer tool to measure end-to-end delay in sudden obstacle braking response 

Signed-off-by: Berkay Karaman <[email protected]>

* feat: implement message_filters package, clean up

Signed-off-by: Berkay Karaman <[email protected]>

* feat: update style and readme

Signed-off-by: Berkay Karaman <[email protected]>

* feat: add predicted path for the PredictedObject and add publish_only_pointcloud_with_object

Signed-off-by: Berkay Karaman <[email protected]>

* feat: add wrong initialize localization protection, improve code readability

Signed-off-by: Berkay Karaman <[email protected]>

* feat: launch occupancy_grid_map from reaction analyzer's own launch file

Signed-off-by: Berkay Karaman <[email protected]>

* feat: update

Signed-off-by: Berkay Karaman <[email protected]>

* feat: change function names

Signed-off-by: Berkay Karaman <[email protected]>

* feat: update

Signed-off-by: Berkay Karaman <[email protected]>

* feat: improve style, change csv output stringstream

Signed-off-by: Berkay Karaman <[email protected]>

* fix: ci/cd

Signed-off-by: Berkay Karaman <[email protected]>

* feat: update for new sensor setup, fix bug, optimize code, show pipeline latency, update readme

Signed-off-by: Berkay Karaman <[email protected]>

* fix: container die problem

Signed-off-by: Berkay Karaman <[email protected]>

* feat: update stats, check path param, add marker, warn user for wrong reaction_chain

Signed-off-by: Berkay Karaman <[email protected]>

---------

Signed-off-by: Berkay Karaman <[email protected]>
@sribrundav
Copy link

running reaction analyzer but the vehicle is not initializing.. I was able to initialize the vehicle by giving a current pose and goal pose through rviz but the dynamic obstacle is still not spawning in the map. (using the default nishishinjuku map). Is this an ongoing issue or is there a work around for this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:tools Utility and debugging software. (auto-assigned) tag:pr-agent Mark to enable PR-Agent for automated reviews. (used-by-ci) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add a new tool to measure end-to-end delay of the Autoware for sudden obstacles
9 participants