I am following the motion commander tutorial, after copy pasting the code below direct fromt the tutorial, I cannot detect a deck.
The CF is running the latest release firmware with a blank config.mk file.
I get the following from the console, no matter if a deck is attached OR what kind of deck is attached, (flow, lighhouse, led...)
Code: Select all
Connecting to radio://0/80/2M/E7E7E7E7E7
Connected to radio://0/80/2M/E7E7E7E7E7
0
Deck is attached!
Process finished with exit code 0
Code: Select all
import logging
import time
import cflib.crtp
from cflib.crazyflie import Crazyflie
from cflib.crazyflie.syncCrazyflie import SyncCrazyflie
from cflib.positioning.motion_commander import MotionCommander
URI = 'radio://0/80/2M/E7E7E7E7E7'
is_deck_attached = False
logging.basicConfig(level=logging.ERROR)
def param_deck_flow(name, value):
global is_deck_attached
print(value)
if value:
is_deck_attached = True
print('Deck is attached!')
else:
is_deck_attached = False
print('Deck is NOT attached!')
if __name__ == '__main__':
cflib.crtp.init_drivers(enable_debug_driver=False)
with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf:
scf.cf.param.add_update_callback(group='deck', name='bcFlow2',
cb=param_deck_flow)
time.sleep(1)