def _update_subswarm(self, new_subswarm): ''' Performs all required actions upon assignment to a new subswarm @param new_subswarm: ID of the subswarm to which the UAV is assigned ''' self._subswarm_id = new_subswarm self._new_subswarm_publisher.publish(stdmsg.UInt8(new_subswarm)) self.log_info("Subswarm updated to %d" % self._subswarm_id)
def _update_swarm_state(self, new_state): ''' Performs all required actions when the swarm state changes @param new_state: new swarm state value ''' self._swarm_state = new_state self._new_swarm_state_publisher.publish(stdmsg.UInt8(new_state)) self.log_info("Swarm state updated to %s" \ %enums.STATE_STRINGS[self._swarm_state])
def _update_swarm_behavior(self, new_behavior): ''' Performs all required post-swarm-behavior-initiation actions @param new_behavior: behavior_id of the initiated swarm behavior ''' self._swarm_behavior = new_behavior self._new_swarm_behavior_publisher.publish(stdmsg.UInt8(new_behavior)) self._behavior_pub_ctr = SwarmController.BHVR_PUB_INTERVAL self.log_info("Active swarm behavior updated to %s"\ %self._behavior_records[self._swarm_behavior].name)
def getAnimationMode(): return stdmsg.UInt8(api.getAnimationMode())
def pub_states_timer_callback(self): msg = std_msgs.UInt8(planner_instance.controller_states) publisher.publish(msg)