mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
Copter: RangeFinder now handles RFND logging
This commit is contained in:
parent
540d4ae796
commit
3e51d8c7d7
@ -13,6 +13,7 @@ void Copter::read_barometer(void)
|
|||||||
void Copter::init_rangefinder(void)
|
void Copter::init_rangefinder(void)
|
||||||
{
|
{
|
||||||
#if RANGEFINDER_ENABLED == ENABLED
|
#if RANGEFINDER_ENABLED == ENABLED
|
||||||
|
rangefinder.set_log_rfnd_bit(MASK_LOG_CTUN);
|
||||||
rangefinder.init(ROTATION_PITCH_270);
|
rangefinder.init(ROTATION_PITCH_270);
|
||||||
rangefinder_state.alt_cm_filt.set_cutoff_frequency(RANGEFINDER_WPNAV_FILT_HZ);
|
rangefinder_state.alt_cm_filt.set_cutoff_frequency(RANGEFINDER_WPNAV_FILT_HZ);
|
||||||
rangefinder_state.enabled = rangefinder.has_orientation(ROTATION_PITCH_270);
|
rangefinder_state.enabled = rangefinder.has_orientation(ROTATION_PITCH_270);
|
||||||
@ -25,11 +26,6 @@ void Copter::read_rangefinder(void)
|
|||||||
#if RANGEFINDER_ENABLED == ENABLED
|
#if RANGEFINDER_ENABLED == ENABLED
|
||||||
rangefinder.update();
|
rangefinder.update();
|
||||||
|
|
||||||
if (rangefinder.num_sensors() > 0 &&
|
|
||||||
should_log(MASK_LOG_CTUN)) {
|
|
||||||
logger.Write_RFND(rangefinder);
|
|
||||||
}
|
|
||||||
|
|
||||||
rangefinder_state.alt_healthy = ((rangefinder.status_orient(ROTATION_PITCH_270) == RangeFinder::RangeFinder_Good) && (rangefinder.range_valid_count_orient(ROTATION_PITCH_270) >= RANGEFINDER_HEALTH_MAX));
|
rangefinder_state.alt_healthy = ((rangefinder.status_orient(ROTATION_PITCH_270) == RangeFinder::RangeFinder_Good) && (rangefinder.range_valid_count_orient(ROTATION_PITCH_270) >= RANGEFINDER_HEALTH_MAX));
|
||||||
|
|
||||||
int16_t temp_alt = rangefinder.distance_cm_orient(ROTATION_PITCH_270);
|
int16_t temp_alt = rangefinder.distance_cm_orient(ROTATION_PITCH_270);
|
||||||
|
Loading…
Reference in New Issue
Block a user