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: filter sample rate calculate with simple interval average instead of perf count #14098

Merged
merged 1 commit into from
Feb 7, 2020

Conversation

dagar
Copy link
Member

@dagar dagar commented Feb 3, 2020

The perf counter intervals aren't numerically stable over extended periods (#14046), so are obviously not ideal for automatically setting filter sample rates. Here's a simpler solution.

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 except for the hard periodic reset.

Have you verified that this solves the decreasing sampling rate issue?

@dagar dagar force-pushed the pr-sensors_sample_rate branch from 7c08b05 to da1489a Compare February 4, 2020 16:33
@dagar dagar force-pushed the pr-sensors_sample_rate branch from da1489a to 46aca39 Compare February 4, 2020 17:03
@codecov
Copy link

codecov bot commented Feb 4, 2020

Codecov Report

Merging #14098 into master will decrease coverage by 17.53%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #14098       +/-   ##
===========================================
- Coverage   53.72%   36.18%   -17.54%     
===========================================
  Files         606      546       -60     
  Lines       51218    46843     -4375     
===========================================
- Hits        27517    16952    -10565     
- Misses      23701    29891     +6190
Flag Coverage Δ
#mavsdk 36.18% <100%> (+0.07%) ⬆️
#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 Δ
...ehicle_angular_velocity/VehicleAngularVelocity.hpp 100% <ø> (ø) ⬆️
...nsors/vehicle_acceleration/VehicleAcceleration.hpp 100% <ø> (ø) ⬆️
...ehicle_angular_velocity/VehicleAngularVelocity.cpp 86.15% <100%> (-9.09%) ⬇️
...nsors/vehicle_acceleration/VehicleAcceleration.cpp 82.35% <100%> (-11.53%) ⬇️
src/systemcmds/tests/test_bezierQuad.cpp 0% <0%> (-100%) ⬇️
src/lib/controllib/BlockLimitSym.cpp 0% <0%> (-100%) ⬇️
src/modules/navigator/mission_block.h 0% <0%> (-100%) ⬇️
src/systemcmds/tests/test_search_min.cpp 0% <0%> (-100%) ⬇️
src/systemcmds/tests/test_hrt.cpp 0% <0%> (-100%) ⬇️
...c/modules/mavlink/mavlink_tests/mavlink_ftp_test.h 0% <0%> (-100%) ⬇️
... and 293 more

@dagar
Copy link
Member Author

dagar commented Feb 4, 2020

Have you verified that this solves the decreasing sampling rate issue?

I'd like to run it overnight again, but so far I don't see it decreasing over time (rarely changing at all past boot).

@jlecoeur
Copy link
Contributor

jlecoeur commented Feb 4, 2020

All right, let's see

@dagar
Copy link
Member Author

dagar commented Feb 6, 2020

On fmu-v3 there were a few resets over several hours (down ~ 10 Hz, then back up), but if anything I'm surprised it's not more erratic given how overloaded that board is at the moment (many sensors on the same bus, very high cpu load) combined with the questionable sensor oversampling.

On fmu-v5 it only changed once at boot.

@dagar dagar merged commit 8df2254 into master Feb 7, 2020
@dagar dagar deleted the pr-sensors_sample_rate branch February 7, 2020 18:04
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.

2 participants