Servers by jDrones

ArduCopter Message Request API - Data Stream or Message Interval?

(Jonathan Currie) #1

Hi everyone,

I’m writing my own MAVLink driver using MAVLink c_library_v1, in order to communicate with a Pixhawk I’ve just bought, with firmware APM:Copter v3.3.3 that I’ve loaded on. I’ve followed the C-UART example provided on Github (but modified for Windows), and realised that in order to receive any message from the Pixhawk (via Telem1) other than the heart beat, you have to request it (the example doesn’t seem to do this?).

Anyhow, I can’t find the exact message definition list that APM:Copter is using, but I’ve assumed it is based on common.xml, MAVLink v1.0, and I can receive (& decode) messages and send commands fine. But when it comes to enabling messages I want via MAV_CMD_SET_MESSAGE_INTERVAL - I get back the result code for “Command UNKNOWN/UNSUPPORTED” - value 3 of MAV_RESULT enum. According to the command definition:

This is the preferred way of requesting messages now (and the way I want to use), but it doesn’t seem to be supported? If I use REQUEST_DATA_STREAM instead (noting “THIS INTERFACE IS DEPRECATED. USE SET_MESSAGE_INTERVAL INSTEAD.”), I get back the messages I want (plus quite a few others…).

Can anyone confirm whether MAV_CMD_SET_MESSAGE_INTERVAL is supported in ArduCopter v3.3.3, and if not, whether more granular control of which messages I want can be set?


(Michael Platz) #2

Hi! I am working on the same task, did you get any further with solving the problem?

(Michael Platz) #3

Enable MAVLink stream of position data over TELEM2 on Pixhawk1 running ArduPilot 3.4.5: Enable at a certain rate [Hz] by setting parameter SR2_POSITION