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

Gremsy liked Gremsy's profile
Mar 12
DIY Robocars via Twitter
RT @chr1sa: Donkeycar 4.4 released with tons of new features, including path learning (useful with GPS outdoors), better Web and Lidar supp…
Nov 27, 2022
DIY Robocars via Twitter
RT @NXP: We are already biting our nails in anticipation of the #NXPCupEMEA challenge! 😉 Did you know there are great cash prizes to be won…
Nov 24, 2022
DIY Robocars via Twitter
RT @gclue_akira: レースまであと3日。今回のコースは激ムズかも。あと一歩 #jetracer https://t.co/GKcEjImQ3t
Nov 24, 2022
DIY Robocars via Twitter
UC Berkeley's DIY robocar program https://roar.berkeley.edu/
Nov 24, 2022
DIY Robocars via Twitter
RT @chr1sa: The next @DIYRobocars autonomous car race at @circuitlaunch will be on Sat, Dec 10. Thrills, spills and a Brazilian BBQ. Fun…
Nov 24, 2022
DIY Robocars via Twitter
RT @arthiak_tc: Donkey car platform ... Still training uses behavioral cloning #TCXpo #diyrobocar @OttawaAVGroup https://t.co/PHBYwlFlnE
Nov 20, 2022
DIY Robocars via Twitter
RT @emurmur77: Points for style. @donkeycar racing in @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/Y2hMyj1…
Nov 20, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Going to @diyrobocars race at @UCSDJacobs https://t.co/Rrf9vDJ8TJ
Nov 8, 2022
DIY Robocars via Twitter
RT @SmallpixelCar: Race @diyrobocars at @UCSDJacobs thanks @chr1sa for taking the video. https://t.co/kK686Hb9Ej
Nov 8, 2022
DIY Robocars via Twitter
RT @PiWarsRobotics: Presenting: the Hacky Racers Robotic Racing Series in collaboration with #PiWars. Find out more and register your inter…
Oct 23, 2022
DIY Robocars via Twitter
RT @Hacky_Racers: There will be three classes at this event: A4, A2, and Hacky Racer! A4 and A2 are based around UK paper sizing and existi…
Oct 23, 2022
DIY Robocars via Twitter
Oct 23, 2022
DIY Robocars via Twitter
Oct 19, 2022
DIY Robocars via Twitter
Oct 18, 2022
DIY Robocars via Twitter
RT @NeaveEng: Calling all UK based folks interested in @diyrobocars, @f1tenth, @donkey_car, and similar robot racing competitions! @hacky_r…
Oct 13, 2022
More…