def start(self, task_manager_instance): client.logger.info("Init ROS node") rospy.init_node('Swarm_client', anonymous=True) if self.USE_LEDS: LedLib.init_led(self.LED_PIN) task_manager_instance.start() super(CopterClient, self).start()
def start(self, task_manager_instance): rospy.loginfo("Init ROS node") rospy.init_node('clever_show_client') if self.USE_LEDS: LedLib.init_led(self.LED_PIN) task_manager_instance.start() if self.FRAME_ID == "floor": if self.FLOOR_FRAME_EXISTS: self.start_floor_frame_broadcast() else: rospy.logerror("Can't make floor frame!") start_subscriber() telemetry_thread.start() super(CopterClient, self).start()
USE_LEDS = config.getboolean('PRIVATE', 'use_leds') play_animation.USE_LEDS = USE_LEDS COPTER_ID = config.get('PRIVATE', 'id') if COPTER_ID == 'default': COPTER_ID = 'copter' + str(random.randrange(9999)).zfill(4) write_to_config('PRIVATE', 'id', COPTER_ID) elif COPTER_ID == '/hostname': COPTER_ID = socket.gethostname() load_config() rospy.init_node('Swarm_client', anonymous=True) if USE_LEDS: LedLib.init_led() print("Client started on copter:", COPTER_ID) if USE_NTP: print("NTP time:", time.ctime(get_ntp_time(NTP_HOST, NTP_PORT))) print("System time", time.ctime(time.time())) reconnect() print("Connected to server") try: while True: try: message = recive_message() if message: