mavlink_receiver: fix DISTANCE_SENSOR covariance handling

This commit is contained in:
Oleg Kalachev 2019-02-22 16:23:41 +03:00 committed by Nuno Marques
parent b818b07df3
commit ec3f1fd5c2
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ uint64 timestamp # time since system start (microseconds)
float32 min_distance # Minimum distance the sensor can measure (in m)
float32 max_distance # Maximum distance the sensor can measure (in m)
float32 current_distance # Current distance reading (in m)
float32 covariance # Measurement covariance (in m), 0 for unknown / invalid readings
float32 covariance # Measurement covariance (in m^2), 0 for unknown / invalid readings
int8 signal_quality # Signal quality in percent (0...100%), where 0 = invalid signal, 100 = perfect signal, and -1 = unknown signal quality.
uint8 type # Type from MAV_DISTANCE_SENSOR enum

View File

@ -797,7 +797,7 @@ MavlinkReceiver::handle_message_distance_sensor(mavlink_message_t *msg)
d.type = dist_sensor.type;
d.id = MAV_DISTANCE_SENSOR_LASER;
d.orientation = dist_sensor.orientation;
d.covariance = dist_sensor.covariance;
d.covariance = dist_sensor.covariance * 1e-4f; // cm^2 to m^2
/// TODO Add sensor rotation according to MAV_SENSOR_ORIENTATION enum