mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
Add distance sensor id to the the MavlinkStreamDistanceSensor class and format whitespace in mavlink_messages.cpp.
This commit is contained in:
@@ -4183,8 +4183,6 @@ protected:
|
|||||||
|
|
||||||
msg.time_boot_ms = dist_sensor.timestamp / 1000; /* us to ms */
|
msg.time_boot_ms = dist_sensor.timestamp / 1000; /* us to ms */
|
||||||
|
|
||||||
/* TODO: use correct ID here */
|
|
||||||
msg.id = 0;
|
|
||||||
|
|
||||||
switch (dist_sensor.type) {
|
switch (dist_sensor.type) {
|
||||||
case MAV_DISTANCE_SENSOR_ULTRASOUND:
|
case MAV_DISTANCE_SENSOR_ULTRASOUND:
|
||||||
@@ -4204,11 +4202,12 @@ protected:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.orientation = dist_sensor.orientation;
|
msg.current_distance = dist_sensor.current_distance * 1e2f; // m to cm
|
||||||
msg.min_distance = dist_sensor.min_distance * 100.0f; /* m to cm */
|
msg.id = dist_sensor.id;
|
||||||
msg.max_distance = dist_sensor.max_distance * 100.0f; /* m to cm */
|
msg.max_distance = dist_sensor.max_distance * 1e2f; // m to cm
|
||||||
msg.current_distance = dist_sensor.current_distance * 100.0f; /* m to cm */
|
msg.min_distance = dist_sensor.min_distance * 1e2f; // m to cm
|
||||||
msg.covariance = dist_sensor.variance * 1e4f; // m^2 to cm^2
|
msg.orientation = dist_sensor.orientation;
|
||||||
|
msg.covariance = dist_sensor.variance * 1e4f; // m^2 to cm^2
|
||||||
|
|
||||||
mavlink_msg_distance_sensor_send_struct(_mavlink->get_channel(), &msg);
|
mavlink_msg_distance_sensor_send_struct(_mavlink->get_channel(), &msg);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user