From 72e9390985e51a7b2ff8c3ebc7b5dab064e2d808 Mon Sep 17 00:00:00 2001 From: TSC21 Date: Sun, 24 May 2015 16:03:01 +0100 Subject: [PATCH] distance_sensor: minor changes --- ROMFS/px4fmu_common/init.d/rc.usb | 1 + src/drivers/drv_range_finder.h | 2 +- src/modules/mavlink/mavlink_receiver.cpp | 2 +- src/modules/sdlog2/sdlog2_messages.h | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rc.usb b/ROMFS/px4fmu_common/init.d/rc.usb index 0442637941..4c2119aa2f 100644 --- a/ROMFS/px4fmu_common/init.d/rc.usb +++ b/ROMFS/px4fmu_common/init.d/rc.usb @@ -9,6 +9,7 @@ mavlink stream -d /dev/ttyACM0 -s PARAM_VALUE -r 300 mavlink stream -d /dev/ttyACM0 -s MISSION_ITEM -r 50 mavlink stream -d /dev/ttyACM0 -s NAMED_VALUE_FLOAT -r 10 mavlink stream -d /dev/ttyACM0 -s OPTICAL_FLOW_RAD -r 10 +mavlink stream -d /dev/ttyACM0 -s DISTANCE_SENSOR -r 10 mavlink stream -d /dev/ttyACM0 -s VFR_HUD -r 20 mavlink stream -d /dev/ttyACM0 -s ATTITUDE -r 20 mavlink stream -d /dev/ttyACM0 -s ACTUATOR_CONTROL_TARGET0 -r 30 diff --git a/src/drivers/drv_range_finder.h b/src/drivers/drv_range_finder.h index 035eb92e0c..725835cc0a 100644 --- a/src/drivers/drv_range_finder.h +++ b/src/drivers/drv_range_finder.h @@ -49,7 +49,7 @@ #define MB12XX_MAX_RANGEFINDERS 12 // Maximum number of Maxbotix sensors on bus /* - * ObjDev tag for px4flow data. + * ObjDev tag for distance sensor data. */ ORB_DECLARE(distance_sensor); diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 25d577dd00..4ed7ffc501 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -420,7 +420,7 @@ MavlinkReceiver::handle_message_optical_flow_rad(mavlink_message_t *msg) struct distance_sensor_s d; memset(&d, 0, sizeof(d)); - d.time_boot_ms = hrt_absolute_time(); + d.time_boot_ms = flow.integration_time_us; d.min_distance = 0.3f; d.max_distance = 5.0f; d.current_distance = flow.distance; diff --git a/src/modules/sdlog2/sdlog2_messages.h b/src/modules/sdlog2/sdlog2_messages.h index eee44c43b9..062ab88f4f 100644 --- a/src/modules/sdlog2/sdlog2_messages.h +++ b/src/modules/sdlog2/sdlog2_messages.h @@ -488,7 +488,6 @@ struct log_PARM_s { }; #pragma pack(pop) - /* construct list of all message formats */ static const struct log_format_s log_formats[] = { /* business-level messages, ID < 0x80 */ @@ -516,7 +515,7 @@ static const struct log_format_s log_formats[] = { LOG_FORMAT(ESC, "HBBBHHffiffH", "count,nESC,Conn,N,Ver,Adr,Volt,Amp,RPM,Temp,SetP,SetPRAW"), LOG_FORMAT(GVSP, "fff", "VX,VY,VZ"), LOG_FORMAT(BATT, "ffff", "V,VFilt,C,Discharged"), - LOG_FORMAT(DIST, "ffB", "Bottom,BottomRate,Flags"), + LOG_FORMAT(DIST, "iiff", "Type,Orientation,Distance,Covariance"), LOG_FORMAT_S(TEL0, TEL, "BBBBHHBQ", "RSSI,RemRSSI,Noise,RemNoise,RXErr,Fixed,TXBuf,HbTime"), LOG_FORMAT_S(TEL1, TEL, "BBBBHHBQ", "RSSI,RemRSSI,Noise,RemNoise,RXErr,Fixed,TXBuf,HbTime"), LOG_FORMAT_S(TEL2, TEL, "BBBBHHBQ", "RSSI,RemRSSI,Noise,RemNoise,RXErr,Fixed,TXBuf,HbTime"),