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

sensors: refactor common corrections and rotation helpers #14036

Merged
merged 1 commit into from
Feb 4, 2020

Conversation

dagar
Copy link
Member

@dagar dagar commented Jan 27, 2020

This PR refactors the duplicated board rotation and sensor correction (if available) handling in the sensors module.

It saves about 1.5 kB of flash.

@dagar dagar force-pushed the pr-sensors_corrections_lib branch 2 times, most recently from 1386a11 to 4be4b27 Compare January 29, 2020 22:31
@dagar dagar mentioned this pull request Jan 31, 2020
5 tasks
@dagar dagar force-pushed the pr-sensors_corrections_lib branch from 4be4b27 to de086ae Compare February 3, 2020 21:00
@dagar dagar changed the title [WIP] sensors: refactor common corrections and rotation helpers sensors: refactor common corrections and rotation helpers Feb 3, 2020
@dagar dagar marked this pull request as ready for review February 3, 2020 21:00
@PX4 PX4 deleted a comment from codecov bot Feb 3, 2020
@dagar dagar force-pushed the pr-sensors_corrections_lib branch from de086ae to 5f9fb45 Compare February 3, 2020 21:09
@dagar dagar requested review from jlecoeur and dakejahl February 3, 2020 21:11
@codecov
Copy link

codecov bot commented Feb 3, 2020

Codecov Report

Merging #14036 into master will decrease coverage by 6.15%.
The diff coverage is 37.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14036      +/-   ##
==========================================
- Coverage   42.33%   36.18%   -6.16%     
==========================================
  Files         605      546      -59     
  Lines       51208    46834    -4374     
==========================================
- Hits        21680    16946    -4734     
- Misses      29528    29888     +360
Flag Coverage Δ
#mavsdk 36.18% <37.37%> (-0.08%) ⬇️
#python ?
#sitl_mission_FW ?
#sitl_mission_MC_box ?
#sitl_mission_MC_offboard_att ?
#sitl_mission_MC_offboard_pos ?
#sitl_mission_Rover ?
#sitl_mission_VTOL_standard ?
#sitl_mission_VTOL_tailsitter ?
#sitl_python_FW ?
#sitl_python_MC_box ?
#sitl_python_MC_offboard_att ?
#sitl_python_MC_offboard_pos ?
#sitl_python_Rover ?
#sitl_python_VTOL_standard ?
#sitl_python_VTOL_tailsitter ?
#unittest ?
Impacted Files Coverage Δ
...nsors/vehicle_acceleration/VehicleAcceleration.hpp 100% <100%> (ø) ⬆️
...ehicle_angular_velocity/VehicleAngularVelocity.hpp 100% <100%> (ø) ⬆️
...s/sensors/sensor_corrections/SensorCorrections.cpp 22.53% <22.53%> (ø)
...s/sensors/sensor_corrections/SensorCorrections.hpp 33.33% <33.33%> (ø)
src/modules/sensors/vehicle_imu/VehicleIMU.cpp 76.19% <70%> (+32.31%) ⬆️
...nsors/vehicle_acceleration/VehicleAcceleration.cpp 79.59% <80%> (+5.34%) ⬆️
...ehicle_angular_velocity/VehicleAngularVelocity.cpp 82.81% <83.33%> (+5.93%) ⬆️
...modules/rover_pos_control/RoverPositionControl.hpp 0% <0%> (-100%) ⬇️
src/modules/land_detector/RoverLandDetector.cpp 0% <0%> (-100%) ⬇️
src/modules/vtol_att_control/tailsitter.cpp 0% <0%> (-94.45%) ⬇️
... and 118 more

dakejahl
dakejahl previously approved these changes Feb 3, 2020
Copy link
Contributor

@dakejahl dakejahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks good to me.

@dagar dagar force-pushed the pr-sensors_corrections_lib branch from e1fa69b to 4339ce9 Compare February 4, 2020 02:41
Copy link
Contributor

@jlecoeur jlecoeur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

How about doing the same for sensor biases?

BTW, isn't vehicle_imu bias compensated? I understand that this data is consumed by the estimator, who is responsible for bias estimation, however it would be useful to have unbiased data in vehicle_imu in case it is consumed elsewhere.

@dagar
Copy link
Member Author

dagar commented Feb 4, 2020

BTW, isn't vehicle_imu bias compensated? I understand that this data is consumed by the estimator, who is responsible for bias estimation, however it would be useful to have unbiased data in vehicle_imu in case it is consumed elsewhere.

The vehicle_imu's are without bias, however we're publishing one for each IMU (accel + gyro paired), so it's not necessarily appropriate for other usage. At the moment sensor_combined is still that primary IMU that can be used systemwide. I haven't quite decided on the least bad option for carrying all options semi-intuitively.

@dagar
Copy link
Member Author

dagar commented Feb 4, 2020

This was bench tested.

@dagar dagar merged commit 36c6e36 into master Feb 4, 2020
@dagar dagar deleted the pr-sensors_corrections_lib branch February 4, 2020 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants