-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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 IMU sensor readings #33836
base: master
Are you sure you want to change the base?
fix IMU sensor readings #33836
Conversation
- Add PreviousState class to track vehicle state for IMU calculations. - added variables for : - - timestamp - - velocity - - bearing - - Position
- added function for calculation of accelerometer - function also does for calculation of gyroscopes values
- update for including above changes
- Reset IMU state tracking on vehicle reset
- minor refactor to add dependencies etc .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:
- Convert your PR to a draft unless it's ready to review
- Read the contributing docs
- Before marking as "ready for review", ensure:
- the goal is clearly stated in the description
- all the tests are passing
- the change is something we merge
- include a route or your device' dongle ID if relevant
- refactored code to be back to tab for 2 spaces .
This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity. |
@sshane can you review this ? else this will close in 2 days . |
This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity. |
@sshane could you review this please ? |
This PR has had no activity for 9 days. It will be automatically closed in 2 days if there is no activity. |
any changes needed here ? |
Description
The simulator's IMU sensors were not being populated with realistic values, causing issues with:
This led to:
Proposed Solution & Implementation
Implemented IMU sensor value calculation using vehicle state data from MetaDrive. The solution:
Added IMU calculation logic in read_sensors()
Added IMU calculation function that:
Computes realistic accelerometer values considering:
Calculates gyroscope values from bearing changes
Applies appropriate coordinate transformations
Enforces realistic physical limits on sensor values
Testing and Validation
NOTE: This file was not added in this PR because -
a) This appeared out of scope of the bounty
b) more importantly , it made the PR big in LOC . will add this this as a separate PR if required .
Sample output and Inference
Here is a small screen recording of the outputs generated:
Screen.Recording.2024-10-21.at.11.20.20.PM.mov
This output was generated with the parameters :
The inference drawn from this output was :
Impact
This fix:
The implementation maintains clean code organization while adding essential simulator functionality, making the simulation environment more realistic and useful for testing vehicle control systems.
Related Issues