Integrator double to float and hrt_abstime type useage #12935
Merged
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.
Describe problem solved by the proposed pull request
The Integrator class integral delta
dt
is currently created as adouble
type and then immediately recast in the next line of code to a float type:const matrix::Vector3f delta_alpha = (val + _last_val) * dt * 0.5f;
This PR simply creates the
dt
as a float to save resources and employs thehrt_abstime
typedef in the obvious instances withinintegrator.cpp
.Test data / coverage
This PR was test flown on a 250 size quad with pixhawk 4 mini until the battery gave out, tests perform identical to PX4:master branch:
Please let me know if you have any questions on this PR. Thanks!
-Mark