How to get drone speed

How to get drone speed with Olympe?

Hello Kain,

You can get the drone speed by getting the last SpeedChanged eventmessage:

drone.get_state(SpeedChanged)

I wrote a short function that calculates the velocity in the direction that the drone is facing:

 def get_speed(drone):
    drone_speed = drone.get_state(SpeedChanged)
    speed = math.sqrt((drone_speed['speedX'] * drone_speed['speedX']) + (drone_speed['speedY'] * drone_speed['speedY']))
    return speed

Hope this helps you,
Domi

1 Like

Hello Domi.

Thank you for your reply.
I get the speed of the drone.

Kain

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.