Skip to content

Commit

Permalink
added AP_PERIPH check in rangefinder get_reading to surround AHRS
Browse files Browse the repository at this point in the history
  • Loading branch information
jkronk committed Jan 10, 2024
1 parent 208b8c3 commit f535837
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/AP_RangeFinder/AP_RangeFinder_Ainstein_LR_D1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ bool AP_RangeFinder_Ainstein_LR_D1::get_reading(float &reading_m)
(Azimuth 43°,Elevation 30°). The ideal case is
keeping radar perpendicular to ground.
*/
#ifndef HAL_BUILD_AP_PERIPH // we may need to move this elsewhere to the entire function or driver?
const auto &ahrs = AP::ahrs();
if (fabs(ahrs.roll) > radians(43)) {
return false;
}
if (fabs(ahrs.pitch) > radians(30)) {
return false;
}
#endif

snr = u.packet.object1_snr;

Expand Down

0 comments on commit f535837

Please sign in to comment.