def osc_reboot(self, address, reboot_bootloader=False, **path_args): """ Set the position of LPS nodes with IDs {nodes}. WARNING : Needs a connected drone. OSC listen: /{nodes}/reboot :param {nodes}: nodes ids separated by a ';'. * for all :type {nodes}: str. :param reboot_bootloader: default to False.\ Either it should be rebooted in bootloader mode instead of firmware. :type reboot_bootloader: bool. :param y: the Y position. :type y: float. :param z: the Z position. :type z: float. """ node_id = int(path_args['node_id']) self._debug('rebooting node', node_id) _, drones = self.server.get_module('CRAZYFLIE').get_connected_drones() anchor = LoPoAnchor(drones[0]['cf']) anchor.reboot( node_id, LoPoAnchor.REBOOT_TO_BOOTLOADER if reboot_bootloader else LoPoAnchor.REBOOT_TO_FIRMWARE)
def _reboot_thread(self): anchors = LoPoAnchor(self._cf) print('Sending reboot signal to all anchors 10 times in a row ...') for retry in range(10): for anchor_id in range(6): anchors.reboot(anchor_id, anchors.REBOOT_TO_BOOTLOADER) time.sleep(0.1) self._cf.close_link()