def end_sim(self):
		self.log_event_request()
		
		if self.debug:
			rospy.logwarn('Utility Monitor Nodes: {}'.format(self.utility_monitors_nodes))
		
		
		while len(self.collected_logs) <= len(self.utility_monitors_nodes):
			if self.debug:
				rospy.logwarn('Waiting for results...')
			self.sleep_rate.sleep()
					
		
		if self.debug:	
			self.compile_results()		
		
		self.mission_launch.shutdown()
		self.utility_monitors_launch.shutdown()
		
		# Load results into the next state change msg
		msg = EvoROS2State()
		msg.result = []
		for x in range(len(self.collected_logs)):
			msg.result.append(Float64Array())
		
		for index, log_array in enumerate(self.collected_logs):
			msg.result[index].header = self.result_headers[index]
			msg.result[index].data = copy.deepcopy(log_array)
	
		return msg
    def set_evo_ros2_state(self, new_state_value):
        """
			Evo-ROS state change procedure
		"""
        rospy.set_param('evo_ros2_state', new_state_value)
        msg = EvoROS2State()
        msg.sender = self.node_name
        msg.state = new_state_value
        self.evo_ros2_comm_pub.publish(msg)
    def end_sim(self):
        self.mission_launch.shutdown()

        # Load results into the next state change msg
        msg = EvoROS2State()
        msg.result = []
        for x in range(len(self.log)):
            msg.result.append(Float64Array())

        #print(self.log)
        #print(self.result_headers)

        for index, log_array in enumerate(self.log):
            msg.result[index].header = self.result_headers[index]
            msg.result[index].data = copy.deepcopy(log_array)
        return msg
Esempio n. 4
0
 def set_evo_ros2_state(self, new_state_value):
     rospy.set_param('evo_ros2_state', new_state_value)
     msg = EvoROS2State()
     msg.sender = self.node_name
     msg.state = new_state_value
     self.evo_ros2_comm_pub.publish(msg)