Page 1 of 1

[SOLVED] Autonomous landing with the Zranger

Posted: Tue Feb 20, 2018 4:01 pm
by matthieuleonie
Hi,

We are trying to make the drone land autonomously using the ZRanger. For that, we have to find the code which enables the drone to maintain 40cm. Then, we want to know how the drone uses the sensor's data to maintain this altitude :
- where is the planner (which defines the setpoints entering the controller) ?
- how are the motors controled and where in the code ?
Finally, we want to change the command of 40cm into a ramp.
Unfortunately, we haven't managed to do it yet. Could you help us ?
It is quite urgent so can you give us an answer as soon as possible please?

Thanks a lot :)

Re: Autonomous landing with the Zranger

Posted: Wed Feb 21, 2018 9:08 am
by arnaud
Hi,

The control happens in the stabilization loop: https://github.com/bitcraze/crazyflie-f ... #L124-L145. The zranger deck driver pushes height measurement to the estimator (the deck drivers are in src/deck/drivers/), the estimator estimates the current height, the setpoint contains the requested height and the controller generates thrust commands to make the current heigth closer the the requested height.

- The set-point is sent from the ground. For height control there is a setpoint packet that sets the absolute height and roll/pitch/yaw: https://github.com/bitcraze/crazyflie-l ... er.py#L105. If you want to make a script that sends the sequence of setpoint you can look in the example folder of the crazyflie lib for example on how to connect a Crazyflie and start sending setpoints. The easiest might be to work with the synchronous API: https://github.com/bitcraze/crazyflie-l ... nceSync.py

- The motors are controlled in the stabilizer loop, the actual control is done in the power_distribution function.

Re: Autonomous landing with the Zranger

Posted: Thu Feb 22, 2018 6:07 pm
by matthieuleonie
Ok we will check that. Thank you :)