[SOLVED] Crazyflie 2.0 restarts after sending external position packet

Post here to get support
Post Reply
larry12193
Beginner
Posts: 7
Joined: Tue Oct 17, 2017 7:32 pm

[SOLVED] Crazyflie 2.0 restarts after sending external position packet

Post by larry12193 »

I am attempting to send the crazyflie external position updates from a motion capture system. Everytime I send the external position packet via the crazyflie ROS package implementation, the copter restarts (motors beep, lights flash, etc.) and then sits idle flashing the M1 LED red at ~5 rapid flashes every second. I am running with the stock crazyflie firmware.

I have tried,
- different, fully charged batteries
- 3 different radios
- 2 different crazyflies
- 300-0.1 Hz external position packet send frequency

Once one external position packet is sent, the copter resets.
Last edited by larry12193 on Tue Dec 05, 2017 4:28 pm, edited 1 time in total.
Korrelator
Beginner
Posts: 9
Joined: Fri Jun 02, 2017 12:49 pm

Re: Crazyflie 2.0 restarts after sending external position packet

Post by Korrelator »

can you show us the console output?
larry12193
Beginner
Posts: 7
Joined: Tue Oct 17, 2017 7:32 pm

Re: Crazyflie 2.0 restarts after sending external position packet

Post by larry12193 »

I solved this issue by forcing the crazyflie to use the onboard kalman filter for state estimation and performing a reset of the estimator upon first connection to the quad.

in src/modules/src/system.c

Code: Select all

158       estimator = kalmanEstimator;
and in my python script right after creating an new an instance Crazyflie

Code: Select all

cf.param.set_value('kalman.resetEstimation', '1')
time.sleep(0.1)
cf.param.set_value('kalman.resetEstimation', '0')
time.sleep(2)
cf.param.set_value('flightmode.posSet', '1')
Now, when it boots up and starts sending the external position from my moccap, it does not reset and will accept xyz setpoints.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: [SOLVED] Crazyflie 2.0 restarts after sending external position packet

Post by arnaud »

Hi,
Great that you got it to work! That would have been my suggestion.

This should be documented, I am thinking of creating an autonomous flight page on the wiki. Would you have found the information there if it was posted on the wiki?
larry12193
Beginner
Posts: 7
Joined: Tue Oct 17, 2017 7:32 pm

Re: [SOLVED] Crazyflie 2.0 restarts after sending external position packet

Post by larry12193 »

arnaud wrote: Wed Dec 06, 2017 9:26 am Hi,
Great that you got it to work! That would have been my suggestion.

This should be documented, I am thinking of creating an autonomous flight page on the wiki. Would you have found the information there if it was posted on the wiki?
I think it would defiantly help out. It took a bit to start connecting the dots between the what the autonomous flight sequence python examples were doing and what I needed to port to ROS to get everything working.
Post Reply