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

fix(emergency_handler,mrm_handler): check for ego speed when determining the gear command #7264

Conversation

danielsanchezaran
Copy link
Contributor

Description

Currently, both handlers always output a DRIVE gear when an emergency message makes the ego stop, which causes a very dangerous behavior (at least in simulations) when the ego vehicle is going backwards and an emergency is triggered -> since the gear is changed to Drive and the ego is going backwards, the simulator gives a positive velocity to the ego and makes it shoot forward (See video). Note that I used a script to simulate the AEB module activating to make these tests easier.

Screencast.from.2024.05.28.15.24.35.webm

After this PR fix:

cap-.2024-06-04-16-21-19.mp4

Related links

Tests performed

PSIM

Notes for reviewers

Interface changes

ROS Topic Changes

ROS Parameter 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.

@github-actions github-actions bot added the component:system System design and integration. (auto-assigned) label Jun 4, 2024
@danielsanchezaran danielsanchezaran marked this pull request as ready for review June 4, 2024 07:33
@danielsanchezaran danielsanchezaran added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jun 4, 2024
@danielsanchezaran danielsanchezaran force-pushed the fix/output_correct_gear_when_reversing branch from 01088c2 to ecfabfe Compare June 6, 2024 02:10
@danielsanchezaran danielsanchezaran force-pushed the fix/output_correct_gear_when_reversing branch from ecfabfe to 3cde0c2 Compare June 6, 2024 02:12
Signed-off-by: veqcc <[email protected]>
@veqcc veqcc force-pushed the fix/output_correct_gear_when_reversing branch from 3cde0c2 to f50c018 Compare June 6, 2024 04:44
@danielsanchezaran danielsanchezaran merged commit 6fb5221 into autowarefoundation:main Jun 6, 2024
22 of 25 checks passed
@danielsanchezaran danielsanchezaran deleted the fix/output_correct_gear_when_reversing branch June 6, 2024 08:19
@Autumn60
Copy link
Contributor

Autumn60 commented Jun 6, 2024

@danielsanchezaran
@veqcc

Hi, I think the Line 585 changed in this PR contains a bug.
Can I fix it in my PR?

bool MrmHandler::isStopped()
{
constexpr auto th_stopped_velocity = 0.001;
return std::abs((odom_->twist.twist.linear.x < th_stopped_velocity) < th_stopped_velocity);
}

@veqcc
Copy link
Contributor

veqcc commented Jun 6, 2024

@Autumn60
Oh I missed it..
Yes please, thank you.

KhalilSelyan pushed a commit that referenced this pull request Jul 22, 2024
…ing the gear command (#7264)

* check for ego speed when determining the gear command

Signed-off-by: Daniel Sanchez <[email protected]>

* add gear history

Signed-off-by: Daniel Sanchez <[email protected]>

* update msg types

Signed-off-by: veqcc <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: veqcc <[email protected]>
Co-authored-by: veqcc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:system System design and integration. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants