whoenig / crazyflie_ros

ROS Driver for Bitcraze Crazyflie
MIT License
192 stars 205 forks source link

High-level controller causing failed takeoff #112

Closed DennisMelamed closed 5 years ago

DennisMelamed commented 6 years ago

I have been trying to get the code in test_high_level.py to run with my Crazyflie and have been unsuccessful. I was hoping you could help me if you have some extra time. Every time I try to run test_high_level.py, the UAV launches, then immediately flips over and crashes. Sometimes there is a big spike in the position estimates rqt_plot is displaying, but not always. I have tried adjusting the roll and pitch trims in the crazyflie_add call, but to no avail. My CF does have a 5 gram camera, a transmitter, and a non-stock battery attached to it. However, I am able to fly manually with these attachments so I don't think they're causing the issue.

Here is what I have done:

Here is the plot of the x,y,z state estimates coming from the UAV during the flight in the video linked below:

flight_pose_estimate

An image of my crazyflie, in case something in my configuration might be the issue: 20181105_140307

And here is a video of it taking off and immediately flipping over: https://drive.google.com/file/d/167p2aUdvXw286ok1-6lwMShYQFU-1haT/view?usp=sharing this occurs regardless of the pitch and roll trims. I am launching from the stand seen in the video to remove any issues caused by the shock absorbing springs on each arm of the UAV.

Is there something I should be changing in the firmware to handle the different weight of the UAV from the stock model? What else might be causing this issue? Thanks in advance for you help!

whoenig commented 6 years ago
DennisMelamed commented 5 years ago

Hi Wolfgang, Sorry for the delay in getting back to this, and thank you for your help. I stripped all the extras off my CF and am just using the stock configuration to eliminate possible issues.

I am not sure where the issue here lies, especially since it seems like a step back from where I was before.

From the firmware side:

Thanks again for your help

whoenig commented 5 years ago

Sorry for the delay. I just got around testing it. I used the firmware you specified without changes and I flashed it using rosrun crazyflie_tools flash --target stm32 --filename ../cf2-2018.10.bin. Then, I updated the high-level python script to switch to the EKF/Mellinger on demand (which the new firmware release supports): https://github.com/whoenig/crazyflie_ros/blob/master/crazyflie_demo/scripts/test_high_level.py#L14-L15.

It was working for me, but not reliably (some messages seem to get lost). Unlike your report, I also did get the logging data. Nevertheless, I did receive some other reports that the safelink feature I recently added causes strange issues in some cases. I disabled it by default (see https://github.com/whoenig/crazyflie_cpp/blob/master/include/crazyflie_cpp/Crazyflie.h#L14). Perhaps you could give it a try and tell me if it fixed your issues (everything is tested and pushed to master.)

DennisMelamed commented 5 years ago

Seems like it may have been the safelink feature and some mis-configuration on my part, it works now! Thank you so much for your help, and for continuing to support this fantastic project.