From 7ed81e5edbe2e1279693791fedaebf9d4600d2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 20 Oct 2016 16:06:35 +0200 Subject: [PATCH] simulator_mavlink: send MAV_CMD_SET_MESSAGE_INTERVAL to enable ground truth --- src/modules/simulator/simulator_mavlink.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/simulator/simulator_mavlink.cpp b/src/modules/simulator/simulator_mavlink.cpp index 53fd732467..d23d5e973a 100644 --- a/src/modules/simulator/simulator_mavlink.cpp +++ b/src/modules/simulator/simulator_mavlink.cpp @@ -610,6 +610,13 @@ void Simulator::pollForMAVLinkMessages(bool publish, int udp_port) const unsigned max_wait_ms = 6; + //send MAV_CMD_SET_MESSAGE_INTERVAL for HIL_STATE_QUATERNION ground truth + mavlink_command_long_t cmd_long = {}; + cmd_long.command = MAV_CMD_SET_MESSAGE_INTERVAL; + cmd_long.param1 = MAVLINK_MSG_ID_HIL_STATE_QUATERNION; + cmd_long.param2 = 5e3; + send_mavlink_message(MAVLINK_MSG_ID_COMMAND_LONG, &cmd_long, 200); + // wait for new mavlink messages to arrive while (true) {