Go to the documentation of this file.00001 """autogenerated by genpy from openraveros/PlannerParameters.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 PlannerParameters(genpy.Message):
00009 _md5sum = "77d44db6ff5af8cb9ffc6fa82e4ce8da"
00010 _type = "openraveros/PlannerParameters"
00011 _has_header = False
00012 _full_text = """# planner parameters
00013 float32[] initialconfig
00014 float32[] finalconfig
00015
00016 """
00017 __slots__ = ['initialconfig','finalconfig']
00018 _slot_types = ['float32[]','float32[]']
00019
00020 def __init__(self, *args, **kwds):
00021 """
00022 Constructor. Any message fields that are implicitly/explicitly
00023 set to None will be assigned a default value. The recommend
00024 use is keyword arguments as this is more robust to future message
00025 changes. You cannot mix in-order arguments and keyword arguments.
00026
00027 The available fields are:
00028 initialconfig,finalconfig
00029
00030 :param args: complete set of field values, in .msg order
00031 :param kwds: use keyword arguments corresponding to message field names
00032 to set specific fields.
00033 """
00034 if args or kwds:
00035 super(PlannerParameters, self).__init__(*args, **kwds)
00036
00037 if self.initialconfig is None:
00038 self.initialconfig = []
00039 if self.finalconfig is None:
00040 self.finalconfig = []
00041 else:
00042 self.initialconfig = []
00043 self.finalconfig = []
00044
00045 def _get_types(self):
00046 """
00047 internal API method
00048 """
00049 return self._slot_types
00050
00051 def serialize(self, buff):
00052 """
00053 serialize message into buffer
00054 :param buff: buffer, ``StringIO``
00055 """
00056 try:
00057 length = len(self.initialconfig)
00058 buff.write(_struct_I.pack(length))
00059 pattern = '<%sf'%length
00060 buff.write(struct.pack(pattern, *self.initialconfig))
00061 length = len(self.finalconfig)
00062 buff.write(_struct_I.pack(length))
00063 pattern = '<%sf'%length
00064 buff.write(struct.pack(pattern, *self.finalconfig))
00065 except struct.error as se: self._check_types(se)
00066 except TypeError as te: self._check_types(te)
00067
00068 def deserialize(self, str):
00069 """
00070 unpack serialized message in str into this message instance
00071 :param str: byte array of serialized message, ``str``
00072 """
00073 try:
00074 end = 0
00075 start = end
00076 end += 4
00077 (length,) = _struct_I.unpack(str[start:end])
00078 pattern = '<%sf'%length
00079 start = end
00080 end += struct.calcsize(pattern)
00081 self.initialconfig = struct.unpack(pattern, str[start:end])
00082 start = end
00083 end += 4
00084 (length,) = _struct_I.unpack(str[start:end])
00085 pattern = '<%sf'%length
00086 start = end
00087 end += struct.calcsize(pattern)
00088 self.finalconfig = struct.unpack(pattern, str[start:end])
00089 return self
00090 except struct.error as e:
00091 raise genpy.DeserializationError(e)
00092
00093
00094 def serialize_numpy(self, buff, numpy):
00095 """
00096 serialize message with numpy array types into buffer
00097 :param buff: buffer, ``StringIO``
00098 :param numpy: numpy python module
00099 """
00100 try:
00101 length = len(self.initialconfig)
00102 buff.write(_struct_I.pack(length))
00103 pattern = '<%sf'%length
00104 buff.write(self.initialconfig.tostring())
00105 length = len(self.finalconfig)
00106 buff.write(_struct_I.pack(length))
00107 pattern = '<%sf'%length
00108 buff.write(self.finalconfig.tostring())
00109 except struct.error as se: self._check_types(se)
00110 except TypeError as te: self._check_types(te)
00111
00112 def deserialize_numpy(self, str, numpy):
00113 """
00114 unpack serialized message in str into this message instance using numpy for array types
00115 :param str: byte array of serialized message, ``str``
00116 :param numpy: numpy python module
00117 """
00118 try:
00119 end = 0
00120 start = end
00121 end += 4
00122 (length,) = _struct_I.unpack(str[start:end])
00123 pattern = '<%sf'%length
00124 start = end
00125 end += struct.calcsize(pattern)
00126 self.initialconfig = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00127 start = end
00128 end += 4
00129 (length,) = _struct_I.unpack(str[start:end])
00130 pattern = '<%sf'%length
00131 start = end
00132 end += struct.calcsize(pattern)
00133 self.finalconfig = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00134 return self
00135 except struct.error as e:
00136 raise genpy.DeserializationError(e)
00137
00138 _struct_I = genpy.struct_I