rebooting crazyflie

Discussions about all things Bitcraze
Post Reply
1016
Beginner
Posts: 6
Joined: Tue Mar 27, 2018 7:10 am

rebooting crazyflie

Post by 1016 »

Hi!

from cflib.drivers.crazyradio import Crazyradio
import cflib.drivers.crazyradio
import time
import cflib.crtp
cflib.crtp.init_drivers(enable_debug_driver=False)

cr = Crazyradio()

address = [0xD8]

cr.set_channel(120)
cr.set_data_rate(cr.DR_2MPS)

cr.set_address((0xE7, 0xE7, 0xE7, 0xE7, address ))
cr.send_packet((0xFF, 0xFE, 0xFF ))
cr.send_packet((0xFF, 0xFE, 0xF0, 1 ))



I found the code to reboot or shut down the drones. This code works well when the drones are first turned on by the push of a button. However, running this code again after running example code like autonomousSequence.py will not reboot the drones. Also, when you run this code and then run the example code, you get an error in the example code. What's wrong with the code?
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: rebooting crazyflie

Post by whoenig »

Your code is fine. The problem seems to be with the safelink interface in the NRF51 firmware, see also viewtopic.php?f=5&t=3046. A quick workaround will be to disable safelink, by sending (0xFF, 0x05, 0x0) first.

I think the firmware can be fixed by replacing the conditions here and here with a condition similar to the one used here.

Edit: PR is here. I did test that this fixes the issue for crazyflie_ros. For your example, since you use the radio directly, you likely need to disable the safelink first anyways.
Post Reply