def to_yaml_file(self, file_name):
     """
     Write the contents of the interaction control options to a yaml file
     """
     file_name = ensure_path_to_file_exists(file_name)
     with open(file_name, "w") as outfile:
         yaml.dump(self.to_dict(), outfile, default_flow_style=False)
 def to_yaml_file(self, file_name):
     """
     Write the contents of the trajectory message to a yaml file
     @param file_name: location to write file. Will create directory if needed.
     """
     file_name = ensure_path_to_file_exists(file_name)
     with open(file_name, "w") as outfile:
         yaml.dump(self.to_dict(), outfile, default_flow_style=False)
 def to_csv_file(self, file_name):
     """
     Write the joint angles of the waypoints to a csv file. The first row
     contains the joint names and subsequent rows contain joint angles.
     @param file_name: location to write file. Will create directory if needed.
     """
     file_name = ensure_path_to_file_exists(file_name)
     waypoint_data = self.get_waypoint_joint_angles_as_list()
     with open(file_name, "wb") as f:
         writer = csv.writer(f)
         writer.writerows(waypoint_data)
 def load_yaml_file(self, file_name):
     """
     loads the traj from a yaml file. This will overwrite all the
     data currently in this trajectory.  Returns true if the reading works,
     false otherwise.
     @param file_name: location to read file.
     """
     file_name = ensure_path_to_file_exists(file_name)
     try:
         with open(file_name, "r") as outfile:
             return self.from_dict(yaml.load(outfile))
     except:
         rospy.logerr('Could not open file traj yaml file')
         return False