def start_detect(self): FunctionUnit.init_node(self) #print 'hello 1' #print self._receive_topic receive_1 = FunctionUnit.create_receive(self, self._receive_topic, Image, self.receive_1_cb) #print 'hello 2' FunctionUnit.spin(self)
def run(self): FunctionUnit.init_node(self) thread.start_new_thread(self.timer,()) heartbeat_receive = FunctionUnit.create_receive(self, self._heartbeat_topic, Heartbeat, self.heartbeat_on_received) self._heartbeat_send = FunctionUnit.create_send(self, 'heart_beat', Heartbeat) self._switch_send = FunctionUnit.create_send(self, self._switch_topic, Bool) #sensory_receive = FunctionUnit.create_receive(self, self._node_name+"/sensory_feedback", Bool, self.sensory_on_received) FunctionUnit.spin(self)
def start_follow(self): FunctionUnit.init_node(self) #print 'hello 1' #print self._receive_topic receive_1 = FunctionUnit.create_receive(self, self._receive_topic_follower, Odometry, self.receive_1_cb) receive_2 = FunctionUnit.create_receive(self, self._receive_topic_intruder, Odometry, self.receive_2_cb) #print 'hello 2' FunctionUnit.spin(self)
def run(self): FunctionUnit.init_node(self) receive_3 = FunctionUnit.create_receive( self, self._motive_topic_1, Bool, self.motivational_shared_var_update) self.set_switch() FunctionUnit.spin(self) pass
def start_switch(self): FunctionUnit.init_node(self) #print 'run' if not(self._topic_1 == None): receive_1 = FunctionUnit.create_receive(self, self._topic_1, self._msg_type_1, self.receive_cb_1) if not(self._topic_2 == None): receive_2 = FunctionUnit.create_receive(self, self._topic_2, self._msg_type_2, self.receive_cb_2) receive_3 = FunctionUnit.create_receive(self, self._motive_topic_1, Bool, self.motivational_shared_var_update) FunctionUnit.spin(self)
def run(self): FunctionUnit.init_node(self) self.user() self._robot_id=rospy.get_param('~robot_id',0) self._behavior_id = rospy.get_param('~behavior_id',0) thread.start_new_thread(self.timer,()) heartbeat_receive = FunctionUnit.create_receive(self, self._heartbeat_topic, Heartbeat, self.heartbeat_on_received) self._heartbeat_send = FunctionUnit.create_send(self, '/heart_beat', Heartbeat) self._switch_send = FunctionUnit.create_send(self, self._switch_topic, Bool) #sensory_receive = FunctionUnit.create_receive(self, self._node_name+"/sensory_feedback", Bool, self.sensory_on_received) FunctionUnit.spin(self)
def run(self): FunctionUnit.init_node(self) self._num = rospy.get_param('~num', 1) for i in range(0, self._num): #bs_id self._shared_list.append([]) for j in range(0, self._num): #r_id self._shared_list[i].append(False) receive_3 = FunctionUnit.create_receive( self, '/heart_beat', Bool, self.motivational_shared_var_update) self.set_type(Twist) for i in range(0, self._num): self._output_list.append( FunctionUnit.create_send(self, 'output_' + str(i), self._type)) for i in range(0, self._num): self._cb_list.append( MultiSwitchCallback(self._output_list, self._shared_list, self._num, i)) self._input_list.append( FunctionUnit.create_receive(self, 'input_' + str(i), self._type, self._cb_list[i])) FunctionUnit.spin(self) pass
def run(self): FunctionUnit.init_node(self) receive_3 = FunctionUnit.create_receive(self, self._motive_topic_1, Bool, self.motivational_shared_var_update) self.set_switch() FunctionUnit.spin(self) pass