_PriorityArray.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nasa_r2_common_msgs/PriorityArray.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class PriorityArray(genpy.Message):
00009   _md5sum = "b680195622dc1787258149093c8d5b54"
00010   _type = "nasa_r2_common_msgs/PriorityArray"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# axis_priorities must be 0, 1, or 6 elements
00013 # empty defaults to high, 1 sets all axes equal priority, 6 sets each axis (x, y, z, r, p, y)
00014 uint8[]  axis_priorities
00015 
00016 uint8 IGNORE          = 0   # Exclude from trajectory
00017 uint8 CRITICAL        = 1   # Most important priority in trajectory
00018 uint8 HIGH            = 2   # Second most important priority in trajectory
00019 uint8 MEDIUM          = 3   # Medium prioirty in trajectory
00020 uint8 LOW             = 4   # Low priority in trajectory
00021 uint8 OPT             = 5   # Optimize trajectory (solve for, but do not iterate to achieve)
00022 
00023 #uint8 IGNORE = 0
00024 #uint8 LOW = 1
00025 #uint8 MEDIUM = 128
00026 #uint8 HIGH = 254
00027 #uint8 CRITICAL = 255
00028 
00029 """
00030   # Pseudo-constants
00031   IGNORE = 0
00032   CRITICAL = 1
00033   HIGH = 2
00034   MEDIUM = 3
00035   LOW = 4
00036   OPT = 5
00037 
00038   __slots__ = ['axis_priorities']
00039   _slot_types = ['uint8[]']
00040 
00041   def __init__(self, *args, **kwds):
00042     """
00043     Constructor. Any message fields that are implicitly/explicitly
00044     set to None will be assigned a default value. The recommend
00045     use is keyword arguments as this is more robust to future message
00046     changes.  You cannot mix in-order arguments and keyword arguments.
00047 
00048     The available fields are:
00049        axis_priorities
00050 
00051     :param args: complete set of field values, in .msg order
00052     :param kwds: use keyword arguments corresponding to message field names
00053     to set specific fields.
00054     """
00055     if args or kwds:
00056       super(PriorityArray, self).__init__(*args, **kwds)
00057       #message fields cannot be None, assign default values for those that are
00058       if self.axis_priorities is None:
00059         self.axis_priorities = ''
00060     else:
00061       self.axis_priorities = ''
00062 
00063   def _get_types(self):
00064     """
00065     internal API method
00066     """
00067     return self._slot_types
00068 
00069   def serialize(self, buff):
00070     """
00071     serialize message into buffer
00072     :param buff: buffer, ``StringIO``
00073     """
00074     try:
00075       _x = self.axis_priorities
00076       length = len(_x)
00077       # - if encoded as a list instead, serialize as bytes instead of string
00078       if type(_x) in [list, tuple]:
00079         buff.write(struct.pack('<I%sB'%length, length, *_x))
00080       else:
00081         buff.write(struct.pack('<I%ss'%length, length, _x))
00082     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00083     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00084 
00085   def deserialize(self, str):
00086     """
00087     unpack serialized message in str into this message instance
00088     :param str: byte array of serialized message, ``str``
00089     """
00090     try:
00091       end = 0
00092       start = end
00093       end += 4
00094       (length,) = _struct_I.unpack(str[start:end])
00095       start = end
00096       end += length
00097       self.axis_priorities = str[start:end]
00098       return self
00099     except struct.error as e:
00100       raise genpy.DeserializationError(e) #most likely buffer underfill
00101 
00102 
00103   def serialize_numpy(self, buff, numpy):
00104     """
00105     serialize message with numpy array types into buffer
00106     :param buff: buffer, ``StringIO``
00107     :param numpy: numpy python module
00108     """
00109     try:
00110       _x = self.axis_priorities
00111       length = len(_x)
00112       # - if encoded as a list instead, serialize as bytes instead of string
00113       if type(_x) in [list, tuple]:
00114         buff.write(struct.pack('<I%sB'%length, length, *_x))
00115       else:
00116         buff.write(struct.pack('<I%ss'%length, length, _x))
00117     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00118     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00119 
00120   def deserialize_numpy(self, str, numpy):
00121     """
00122     unpack serialized message in str into this message instance using numpy for array types
00123     :param str: byte array of serialized message, ``str``
00124     :param numpy: numpy python module
00125     """
00126     try:
00127       end = 0
00128       start = end
00129       end += 4
00130       (length,) = _struct_I.unpack(str[start:end])
00131       start = end
00132       end += length
00133       self.axis_priorities = str[start:end]
00134       return self
00135     except struct.error as e:
00136       raise genpy.DeserializationError(e) #most likely buffer underfill
00137 
00138 _struct_I = genpy.struct_I


nasa_r2_common_msgs
Author(s): Paul Dinh. Maintained by Jennifer Turner
autogenerated on Mon Oct 6 2014 02:42:34