MotionCommander Interface

Firmware/software/electronics/mechanics
Post Reply
msorocky
Beginner
Posts: 7
Joined: Mon Jan 08, 2018 2:46 pm

MotionCommander Interface

Post by msorocky »

In the MotionCommander interface, there are the following lines of code:

def _reset_position_estimator(self):
self._cf.param.set_value('kalman.resetEstimation', '1')
time.sleep(0.1)
self._cf.param.set_value('kalman.resetEstimation', '0')
time.sleep(2)

What are the reasons for resetting the position estimator prior to takeoff, and sleeping for 2 seconds?

Also, is there a way to obtain the current battery level from the python client? I can't find any code for that from searching the repository.

Last Q: what is the maximum charging current of that battery? I've been using my computer USB port, but that takes a while. Can I used my phone (Samsung galaxy s6) charger instead? It supplies 5V at 2A.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: MotionCommander Interface

Post by arnaud »

Hi,

The reason for reseting the kalman filter is done to make sure the kalman filter has converged before take-off, this is assuming the Crazyflie is placed flat in an hoizontal surface and facing X (in case a positioning system is used). It is mostly useful in the LPS where it is very important that the Kalman filter starts when the crazyflie is facing X.

Sleeping 2 seconds is just a crude way of waiting for the kalman filter to converge. With the flow sensor it is usually enough, when using the LPS we have used logged variable to check the convergence.

You can use the log subsystem to get the battery voltage. There is a couple of example on how to receive log values in the crazyflie-lib-python example folder. The battery voltage is in the log variable "pm.vbat".

The battery charging current is handled by the lipo charging chip, it is currently set to 500mA. The battery chipped with the Crazyflie will deteriorate quicker if more current is used. If you do not care about reducing the battery life or if you have a battery that can handle higher charge current, it is possible to charge with ~1A, it requires to change the nRF51 firmware. The code that has to be modified is there: https://github.com/bitcraze/crazyflie2- ... #L181-L186.
Post Reply