-
-
Notifications
You must be signed in to change notification settings - Fork 189
BUG: Unecessary Gyroscope Rotation and Wrong Acceleremoter Rotation #811
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
Conversation
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.
Pull Request Overview
This PR fixes bugs in sensor rotation handling and clarifies sensor behavior by correcting the rotation transformations and updating docstrings for clarity. Key changes include:
- Removing an extra rotation for gyroscopes and correcting the accelerometer’s rotation direction.
- Updating tests to use the new sensor rotation naming and comparing individual sensor outputs.
- Refining flight class documentation to clearly reflect the inertial and body frame conventions.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/unit/test_sensor.py | Updated test cases to compare against the new rotation_sensor_to_body and adjusted transposition. |
tests/integration/test_sensor.py | Separated axis comparisons for accelerometer and gyroscope to match the fixed sensor rotations. |
rocketpy/simulation/flight.py | Revised docstrings for flight attributes and added body frame functions for clarity. |
rocketpy/sensors/sensor.py, gyroscope.py, accelerometer.py, sensors_prints.py | Replaced rotation_matrix with rotation_sensor_to_body and adjusted related matrix operations. |
Comments suppressed due to low confidence (4)
rocketpy/simulation/flight.py:2176
- The docstring for Flight.alpha2 incorrectly refers to the x direction. Since yaw acceleration typically corresponds to the y-axis, please update this to reflect the correct axis.
Angular acceleration of the rocket in the x direction of the rocket's body frame as a function of time, in rad/s. Sometimes referred to as yaw acceleration.
rocketpy/simulation/flight.py:2184
- The docstring for Flight.alpha3 incorrectly refers to the x direction. Roll acceleration should be associated with the z-axis, so please update the description accordingly.
Angular acceleration of the rocket in the x direction of the rocket's body frame as a function of time, in rad/s. Sometimes referred to as roll acceleration.
rocketpy/simulation/flight.py:2215
- For Flight.M2, the description should likely refer to the y-axis (not the x-axis) to correctly match its intended behavior.
Aerodynamic moment acting along the x-axis of the rocket's body frame as a function of time. Expressed in Newtons (N).
rocketpy/simulation/flight.py:2222
- For Flight.M3, the description should likely refer to the z-axis (not the x-axis) to correctly reflect its role, so please update the docstring.
Aerodynamic moment acting along the x-axis of the rocket's body frame as a function of time. Expressed in Newtons (N).
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.
LGTM,
Nice work solving the BUG so promptly. Thanks, @MateusStano !!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #811 +/- ##
===========================================
+ Coverage 79.11% 79.83% +0.71%
===========================================
Files 96 97 +1
Lines 11575 11930 +355
===========================================
+ Hits 9158 9524 +366
+ Misses 2417 2406 -11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Pull request type
Description
Some rotations were wrong in the sensors class:
.transpose
I also took the chance to improve/correct some of the docs strings of some Flight attributes