Page 1 of 1

Non-blocking goto function

Posted: Sat May 15, 2021 7:59 am
by Naidala
Hi, I have a Vicon Wand and the idea is to send the current position of the wand as reference for the drone while flying, as a pursuit. This way, I cannot use anymore a sequence defined offline, and I cannot use the go_to() function inside PositionHlCommander, since it is blocking.
One idea is to use the start_forward, start_left commands in MotionCommander, which are non blocking, and wrap them into IFs to check whether the position is reached.
Are there any simpler goto-like commands that are non-blocking? Should I use the send_position_setpoint in Commander?

Re: Non-blocking goto function

Posted: Mon May 17, 2021 9:17 am
by arnaud
Hi,

You can send goto commands to the high-level commander directly using the same function used in the go_to() method: https://github.com/bitcraze/crazyflie-l ... er.py#L247.

Each time the Crazyflie receives a go_to packet, it will plan a trajectory to reach the setpoint. If a new go_to is sent before the end of the trajectory, a new trajectory is planned stating from the current state to the new setpoint. So the Crazyflie supports changing setpoint mid-flight, I have previously used that as a nice way to easily make smooth trajectory, so I am surprised it is not possible in the lib out of the box anymore. This is likely something we should better expose in the lib. My assumption is that we tried to help the user by adding a sleep in the go_to() method on the python side.