Home        Store        Learn        Blog

MAVlink messages form MATLAB to pixhawk(Ardusub firmware)

Hi,
From the below link
https://www.ardusub.com/developers/pymavlink.html

I found a particular text which says

All system components that communicate via MAVLink are expected to send a HEARTBEAT message at a constant rate of at least 1 Hz. If the autopilot does not receive a heartbeat from your application after this interval, it will trigger a [failsafe]

When the autopilot is being commanded to move via RC_CHANNELS_RAW or MANUAL_CONTROL messages, the messages must be sent at a constant rate like the HEARTBEAT message. Otherwise, the autopilot will execute a failsafe if it has not received an updated command after a timeout period.

My concern is i have connected pixhawk to companion computer and to two applications (MATLAB and qground control ) running on PC are interacting with the pixhawk via companion computer.

To send the following Mavlink messages from MATLAB ( RC_CHANNELS_RAW or MANUAL_CONTROL or RC_OVERRIDE ) in order to obtain the change in servo outputs ,
In my understanding do i have to send HEARTBEAT MAVlink msg first and then send MAVLINK message for (ARM/DISARM) inorder to arm the motors , and then send the messages related to RC ( RC_CHANNELS_RAW or MANUAL_CONTROL or RC_OVERRIDE ) so that it gets accepted and obtain the servo_out which i can see in my qgroundcontrol ?

I want to know the sequence of which MAVlink message has to be sent first .
And also should the HEARTBEAT message always be sent continuously along with other MAVlink messages (ex RC_CHANNELS_RAW ) or is it only once at the start?

Can you please help me understand this scenario?