^ This is the documentation that my MAVLink library gives for the REQUEST_DATA_STREAM packing function. I said system_id to 32 (from what I understand this is an arbitrary number between 1 and 255, though I’ve also tried using 1 and 255 and nothing improved), for component_id I used 1, for target_system I used 1, for target_component I used 220 aka MAV_COMP_ID_GPS (GPS’s component ID), start_stop is set to 1.
I’m assuming that the req_stream_id is supposed to be the id # of the MAVLink message that I want ArduCopter to send. I’ve tried 24, 25, 63, etc.
req_message_rate is something that I am wary of. I’ve set it to 100, 1000, 100000, and 38400 (baud rate of GPS component) but nothing has improved.
No matter what I do, the only thing ArduCopter sends back is the same constant heartbeat messages as always. I’ve tried using PARAM_REQUEST and that actually worked so I don’t know what’s up with REQUEST_DATA_STREAM.
Any help would be greatly appreciated, this is driving me crazy.
This might be working, but there is no reason why you are sending the message with that ID. You want to target the autopilot, not a GPS (and there’s no GPS that talks MAVLink that I’m aware). The system is the vehicle, the autopilot is one of the components, a MAVLink gimbal is another component, a companion computer another, etc.
No, you can’t select individual messages with REQUEST_DATA_STREAM, you can only select streams. The available streams are defined in the MAV_DATA_STREAM (http://mavlink.org/messages/common).
Thanks yeah I ended up figuring it out a bit after stumbling across the MAV_DATA_STREAM enum. For some reason I can only get it to send all of the statuses (stream id 0) and not just position (stream id 6).
More is better than nothing though so I’ve been able to get on with my work regardless, thank you all for the help!
Did you success with enable some types of data streaming and disable some types? I am getting too many packets and want just to get specific packets like MAV_DATA_STREAM_POSITION but I still get other types.
Do you keep sending heartbeats or not?
Can you help me with a complete example ?