-
Notifications
You must be signed in to change notification settings - Fork 5
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
Motion computation ctrv angle fix #233
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JonSmet
requested changes
Jun 10, 2024
MishkaMN
changed the title
Motion compuration ctrv angle fix
Motion computation ctrv angle fix
Jun 12, 2024
JonSmet
requested changes
Jun 14, 2024
Quality Gate passedIssues Measures |
JonSmet
approved these changes
Jun 14, 2024
NOTE: We are currently just passing the oriectiontation. It means it might look like vehicle moving along correct path, but may look as if facing constant direction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Details
Description
This PR fixes the issue where predicted states of CTRV motion model is showing opposite direction (often flips back and forth). This is seriously impacting yielding behavior of carma due to bad prediction.
So I put an example scenario where heavy vehicle is red, carma is green (you can see the camera view on right) and predicted states are showing as transforms.
Truck is actually travelling lower left corner of the intersection as you can see from the truck's front being shown in the camera, but it is predicted backwards.
Before:
Because velocity is already in the map frame, if we add that angle to orientation like the old code, it will flip the direction to the opposite:
This is because old code assumed velocity was in base_link frame (which often just non-zero x value without noise which is the direction of travel) and pose orientation was the mostly the main yaw in CTRV. However, in simulation, all objects reported and used in carma's world model are already in map frame velocity, so it was "double counting".
atan fix:
previously the function was only getting the angle from y value and not accounting x, which means angle in 3rd quadrant will be in 4th erroneously:
after atan and frame fix:
I think technically the original code is correct, however, without this fix the current logic will not work.
I have documented why we needed this "workaround" at the moment in the code and in here:
usdot-fhwa-stol/carma-platform#2401
Related GitHub Issue
fixes: usdot-fhwa-stol/carma-platform#2398
Related Jira Key
https://usdot-carma.atlassian.net/browse/CAR-6058
Motivation and Context
During HASS and VOICE demo, it was discovered that vehicles's prediction would flip back and forith going opposite direction
How Has This Been Tested?
sim pc 2, made scenario-runner heavy vehicle to travel lower left of the intersection and observed the prediction.
And also tested successfully on VOICES with simulated carma detecting real life carma's trajectory correctly using CTRV
Types of changes
Checklist: