def handle_qlearn_policy_data(self, policy_list): self.qlearn_policy_list.append(policy_list.data) if self.generate_video: data_to_publish = self.convert_list_to_2d_array(policy_list.data) image_util.save_image_for_iteration(data_to_publish, self.iteration_number) self.iteration_number += 1
def handle_ql_policy_data(self, policy_list): #print "testing data ", list(policy_list.data) if self.generate_video: #data_to_publish = self.convert_list_to_2d_array(policy_list.data) #image_util.save_image_for_iteration(data_to_publish, self.iteration_number) image_util.save_image_for_iteration(list(policy_list.data), self.iteration_number) self.iteration_number += 1
def handle_robot_location(self,message): self.robot_location = list(message.data) #print "ROBOT LOCATION: ",self.robot_location if self.generate_video: data_to_publish = self.convert_list_to_2d_array(self.policy_list[-1]) image_util.save_image_for_iteration(data_to_publish, self.iteration_number,self.robot_location) self.iteration_number += 1
def handle_robot_location(self, message): self.robot_location = list(message.data) #print "ROBOT LOCATION: ",self.robot_location if self.generate_video: data_to_publish = self.convert_list_to_2d_array( self.policy_list[-1]) image_util.save_image_for_iteration(data_to_publish, self.iteration_number, self.robot_location) self.iteration_number += 1
def do_bellman(self): bellman = Bellman() rospy.sleep(2) if bellman.find_path(): print "values: \n", bellman.v_map print "policies: \n", bellman.p_map print "path: ", bellman.path print "policy path: \n", bellman.policies image_util.save_image_for_iteration(bellman.policies) else: print "charging path: ", bellman.cs_path print "policy path: \n", bellman.policies image_util.save_image_for_iteration(bellman.policies)
def do_bellman(self): bellman = Bellman() rospy.sleep(2) if bellman.find_path(): print "values: \n", bellman.v_map print "policies: \n", bellman.p_map print "path: ", bellman.path print "policy path: \n", bellman.policies image_util.save_image_for_iteration(bellman.policies) else: print "charging path: ", bellman.cs_path print "policy path: \n", bellman.policies image_util.save_image_for_iteration(bellman.policies)
def handle_qlearn_policy_data(self, policy_list): self.qlearn_policy_list.append(policy_list.data) if self.generate_video: data_to_publish = self.convert_list_to_2d_array(policy_list.data) image_util.save_image_for_iteration(data_to_publish, self.iteration_number) self.iteration_number += 1