From d56f5c846485ff4fbce81186e0887b909080371d Mon Sep 17 00:00:00 2001 From: Aris Date: Fri, 7 Feb 2025 10:37:26 +0100 Subject: [PATCH] Added arming in sbs motion commander --- docs/user-guides/sbs_motion_commander.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/user-guides/sbs_motion_commander.md b/docs/user-guides/sbs_motion_commander.md index 79876107e..883a7b6d8 100644 --- a/docs/user-guides/sbs_motion_commander.md +++ b/docs/user-guides/sbs_motion_commander.md @@ -55,6 +55,9 @@ Since this tutorial won't be a table top tutorial like last time, but an actual We want to know if the deck is correctly attached before flying, therefore we will add a callback for the `"deck.bcFlow2"` parameter. Add the following line after the `...SyncCrazyflie(...)` in `__main__` ```python with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf: + # Arm the Crazyflie + scf.cf.platform.send_arming_request(True) + time.sleep(1.0) scf.cf.param.add_update_callback(group="deck", name="bcFlow2", cb=param_deck_flow) @@ -120,6 +123,9 @@ if __name__ == '__main__': cflib.crtp.init_drivers() with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf: + # Arm the Crazyflie + scf.cf.platform.send_arming_request(True) + time.sleep(1.0) scf.cf.param.add_update_callback(group='deck', name='bcFlow2', cb=param_deck_flow) @@ -133,6 +139,9 @@ So now we are going to start up the SyncCrazyflie and start a function in the `_ ```python with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf: + # Arm the Crazyflie + scf.cf.platform.send_arming_request(True) + time.sleep(1.0) if not deck_attached_event.wait(timeout=5): print('No flow deck detected!') @@ -216,6 +225,9 @@ if __name__ == '__main__': cflib.crtp.init_drivers() with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf: + # Arm the Crazyflie + scf.cf.platform.send_arming_request(True) + time.sleep(1.0) scf.cf.param.add_update_callback(group='deck', name='bcFlow2', cb=param_deck_flow) @@ -305,6 +317,9 @@ if __name__ == '__main__': cflib.crtp.init_drivers() with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf: + # Arm the Crazyflie + scf.cf.platform.send_arming_request(True) + time.sleep(1.0) scf.cf.param.add_update_callback(group='deck', name='bcFlow2', cb=param_deck_flow) @@ -408,6 +423,9 @@ if __name__ == '__main__': cflib.crtp.init_drivers() with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf: + # Arm the Crazyflie + scf.cf.platform.send_arming_request(True) + time.sleep(1.0) scf.cf.param.add_update_callback(group='deck', name='bcFlow2', cb=param_deck_flow) @@ -521,6 +539,9 @@ if __name__ == '__main__': cflib.crtp.init_drivers() with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf: + # Arm the Crazyflie + scf.cf.platform.send_arming_request(True) + time.sleep(1.0) scf.cf.param.add_update_callback(group='deck', name='bcFlow2', cb=param_deck_flow) @@ -648,6 +669,9 @@ if __name__ == '__main__': cflib.crtp.init_drivers() with SyncCrazyflie(URI, cf=Crazyflie(rw_cache='./cache')) as scf: + # Arm the Crazyflie + scf.cf.platform.send_arming_request(True) + time.sleep(1.0) scf.cf.param.add_update_callback(group='deck', name='bcFlow2', cb=param_deck_flow)