Refresh Rates for Instruments and ManualCopterPilotingItf

How often should we expect updates from instruments (such as GPS and Altimeter), and how often can we send updates to interfaces like ManualCopterPilotingItf.setVerticalSpeed?

I am observing what looks like 200ms for instruments (over wifi connection, RC connection doesn’t work for some reason), and maybe 500+ms for setVerticalSpeed, which results in very “jumpy” movements.

  • Instrument updates are forwarded by GroundSdk as soon as they arrive from the drone, there is no rate limiting mechanism here. Now I don’t know exactly how frequently the ANAFI may send updates for GPS and Altimeter, maybe someone working on the ANAFI firmware team would know better.

  • For piloting commands (i.e. setPitch/setRoll/setYawRotationSpeed/setVerticalSpeed), those four values are all packed together in a single message that is sent to the ANAFI every 50ms.

I’m trying to control the Drone via ManualCopterPilotingItf towards a specified destination coordinate while gradually rotating the drones yaw from a start value to a end value.

  • Based on the GPS position (WGS84) I convert the coordinates to UTM and use these to calculate the distance(d) and direction(alpha) from my current location to the target location (polar coordinates).
  • The new velocity(v) value is computed based on the distance(d).
  • The alpha angle is altered with the current heading of the drone to get the correct angle from the local coordinate system of the drone towards the destination.
  • Using SIN and COS the velocity is applied to the roll and pitch values.

During the Simulation in Sphinx the refresh rate for the GPS position of the drone is quite irregular. Sometimes it takes 15 seconds to receive a new position. With this refresh rate it’s impossible to control the drone using the above workflow, as the drone overshoots the destination. Does anyone know if the refresh rate is just a problem/bug in the simulation environment, or does it also happen in the real world?

I think this is limited to just sphinx as I’ve done similar “directed” moves myself many times in the real world.

Oddly, I use sphinx for validating MAVLINK stuff all the time and the drone never has any issues getting to where I send it or doing the things I ask it to do along the way.