Hi, the FMU by default sends MAVLINK_MSG_ID_SERVO_OUTPUT_RAW at 2 Hz. I need faster updates 10Hz. But when I request this, it stops sending any MAVLINK_MSG_ID_SERVO_OUTPUT_RAW messages. Can someone please see what I have done wrong with this message: -
target_sys = FMU’s SYSID_THISMAV, target_comp = FMU component “1”.
static void SendComRequestSERVO_OUTPUT_RAWInterval (uint8_t target_sys, uint8_t target_comp)
{
/*
-
@brief Pack a on board off / on message
-
@param OnBoardState float32_t <0.5f off >0.5f on
-
@param target_sys uint8_t target system
-
@param target_comp uint8_t target component
-
@param conf uint8_t confirmation
-
@param componentId uint8_t component id
-
@return length of the message in bytes (excluding serial stream start sign)
*/
mavlink_command_long_t command = { 0u }; // Command Type
mavlink_message_t msg; // encoder type
command.target_system = target_sys;
command.target_component = target_comp;
command.command = MAV_CMD_SET_MESSAGE_INTERVAL;
command.confirmation = 0;
command.param1 = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
command.param2 = 1000000; // 10 Hz
/* encode */
mavlink_msg_command_long_encode(target_sys, target_comp, &msg, &command);
/* Copy the message to send buffer when buf is uint8_t buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN]; */
msg_send(&msg);
std::cout<<"> Requesting Servo Data\n";
}
Thanks
Anthony