Changing the data stream rate

DIYDrones,

I've been tinkering with the ArduPlane code some.  I have written my own mavlink message that sends down specific information from the UAV.  In GCS_MAVLink I have written the function to send the message (just like all the other MAVLink messages), and I have added a send_message() function call for my message (in the GCS_MAVLINK::data_stream_send function).  This all works great, sending my message along with the many other MAVLink messages.

Now, I want to limit ArduPlane to only send my message and heartbeat messages.  I tried commenting out all of the other "send_message" function calls(in the GCS_MAVLINK::data_stream_send function) so that only heartbeat messages and my message get sent, but this forced the data stream rate to 1 Hz (I only received 1 packet per second), regardless of what I set the SR0_POSITION and SR3_POSITION parameters to.  As much as a tried, I couldn't change this frequency (it was stuck at 1Hz).  Another thing I tried, in ArduPlane.pde, I completely commented out the "gcs_data_stream_send()" function call and replaced it with gcs_send_message(MY_MESSAGE), but this completely messed up the sequence numbers for the packets.

Essentially, I'm trying to make ArduPlane only send heartbeat and my message.  I want to be able to control the rate at which my message is sent (so I can change it from 1Hz, to 2Hz, to 4 Hz... and so on).  Also, the sequence numbers need to stay consecutive (meaning after you receive packet sequence 1, the next packet should be 2, then 3...and so on).  Does anyone know where I went wrong with the changes I attempted?  Or, does anyone have any different ideas?  If you have any questions, feel free to ask.  Also, I can post code if necessary, just ask...

Best regards,

David

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer

    I would have thought that you could change those parameters through the mission planner's Config, Planner screen and make them all 0 except for the one you want to send.  ..but it sounds like you've already found the parameters that these drop-downs update so it's unlikely that i'm helping any.

    3692627406?profile=original

  • Ok, I've done some more testing and it seems that if I edit anything in GCS_MAVLink it messes up the stream.  I tried editing in the GCS_MAVLINK::data_stream_send function and I also tried editing the send_message function, but it seems like if I change anything, than nothing gets sent.  The reason I thought the stream was getting set to 1Hz is because there was a MSG_HEARTBEAT still getting sent every second (in the one second loop).  

    Anyone have any suggestions on how to make only my message get sent through the stream so that I can use the SR0_POSITION or SR3_POSITION parameters to change the frequency at which it is sent??

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…