DroneKit Position command refresh rate

Hi all,
I want to send position and velocity commands to my drone using dronekit, can i send new command every 0.1 sec or the minimum time is 1 sec?
I saw this note in the documentation:


I’m not sure if they recomend 1 sec or is it the minimum time.

In another case, what is the bitmask for sending velocity commands with dronekit?
I found multiple places saying different things but I was never able to send the commands.

Thanks

Hi @Amit5001! You can send it at any intervals you want. When you send the position set point, you need to send it only once. However, if you want to send a velocity or acceleration target, you need to send it continuously in a loop, recommended at least at 1 Hz.

For the velocity target (xyz), the bitmask will be something like 0b0000111111000111, or the integer equivalent 4039

just to make sure I understand you correctly- in case I want to send velocity commands, i can send it every 0.1 sec but need to send it continuosly for as long as i need to.

currently i tried to send velocity commands with this function:
image
beside the bitmask, do you think theres anything else tha problamatic?
I use MAV_FRAME_BODY_FRD because i use optical flow and not GPS

about the bitmask, the ardupilot documentation is outdated?
image

@Amit5001, try this:
mavutil.mavlink.MAV_FRAME_BODY_NED, int(0b0000111111000111),
0, 0, 0,
x, y, z,
0, 0, 0, 0, 0
)

Also only valid frames are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9

You can refer to: Messages (common) · MAVLink Developer Guide

I looked at this reference before, as for my understanding the MAV_FRAME_BODY_NED are deprecated

Thanks for the function

Oh ya! You are right! It’s depreciated. Thanks for the correction
Let me know if the function work for you and need any further help

Hi! Your suggestion worked and I managed to send velocity commands to the drone.

Thanks!

1 Like