mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-02 14:08:45 -04:00
AP_RangeFinder: MAV only accepts DISTANCE_SENSOR with orient 25
25 is MAV_SENSOR_ROTATION_PITCH_270 meaning downward facing
This commit is contained in:
parent
653030b038
commit
8215b92371
@ -51,9 +51,12 @@ void AP_RangeFinder_MAVLink::handle_msg(mavlink_message_t *msg)
|
|||||||
mavlink_distance_sensor_t packet;
|
mavlink_distance_sensor_t packet;
|
||||||
mavlink_msg_distance_sensor_decode(msg, &packet);
|
mavlink_msg_distance_sensor_decode(msg, &packet);
|
||||||
|
|
||||||
|
// only accept distances for downward facing sensors
|
||||||
|
if (packet.orientation == MAV_SENSOR_ROTATION_PITCH_270) {
|
||||||
last_update_ms = AP_HAL::millis();
|
last_update_ms = AP_HAL::millis();
|
||||||
distance_cm = packet.current_distance;
|
distance_cm = packet.current_distance;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
update the state of the sensor
|
update the state of the sensor
|
||||||
|
Loading…
Reference in New Issue
Block a user