Page 1 of 1
Programming Approach of client
Posted: Mon Aug 19, 2019 1:12 pm
by RyanMco
Alright
Re: HEIGHT MEASUREMENT developing
Posted: Tue Aug 20, 2019 7:25 am
by arnaud
Hi,
The height measurement is done in the z-ranger deck driver and pushed into the estimator:
https://github.com/bitcraze/crazyflie-f ... er2.c#L146
When using the flow, the kalman filter estimator is used. The height measurement is entered in the kalman filter by the function
kalmanCoreUpdateWithTof:
https://github.com/bitcraze/crazyflie-f ... ore.c#L538
Eventually the kalman filter generates an estimated pose including the current estimated height.
Then, the controller, outputs motor control in order to get the current estimated height closer to the desired height setpoint. The height PID is generating a velocity setpoint to get closer to the height setpoint there:
https://github.com/bitcraze/crazyflie-f ... pid.c#L190.
Similarly there will be a velocity PID that calculate the needed mean thrust to get closer to the wanted velocity setpoint:
https://github.com/bitcraze/crazyflie-f ... pid.c#L217
This should give you enough pointer to follow a bit how the height control is achieved when using the flow deck.