_QueryTrajectoryState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_controllers_msgs/QueryTrajectoryStateRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import genpy
00008 
00009 class QueryTrajectoryStateRequest(genpy.Message):
00010   _md5sum = "556a4fb76023a469987922359d08a844"
00011   _type = "pr2_controllers_msgs/QueryTrajectoryStateRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """time time
00014 
00015 """
00016   __slots__ = ['time']
00017   _slot_types = ['time']
00018 
00019   def __init__(self, *args, **kwds):
00020     """
00021     Constructor. Any message fields that are implicitly/explicitly
00022     set to None will be assigned a default value. The recommend
00023     use is keyword arguments as this is more robust to future message
00024     changes.  You cannot mix in-order arguments and keyword arguments.
00025 
00026     The available fields are:
00027        time
00028 
00029     :param args: complete set of field values, in .msg order
00030     :param kwds: use keyword arguments corresponding to message field names
00031     to set specific fields.
00032     """
00033     if args or kwds:
00034       super(QueryTrajectoryStateRequest, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.time is None:
00037         self.time = genpy.Time()
00038     else:
00039       self.time = genpy.Time()
00040 
00041   def _get_types(self):
00042     """
00043     internal API method
00044     """
00045     return self._slot_types
00046 
00047   def serialize(self, buff):
00048     """
00049     serialize message into buffer
00050     :param buff: buffer, ``StringIO``
00051     """
00052     try:
00053       _x = self
00054       buff.write(_struct_2I.pack(_x.time.secs, _x.time.nsecs))
00055     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00056     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00057 
00058   def deserialize(self, str):
00059     """
00060     unpack serialized message in str into this message instance
00061     :param str: byte array of serialized message, ``str``
00062     """
00063     try:
00064       if self.time is None:
00065         self.time = genpy.Time()
00066       end = 0
00067       _x = self
00068       start = end
00069       end += 8
00070       (_x.time.secs, _x.time.nsecs,) = _struct_2I.unpack(str[start:end])
00071       self.time.canon()
00072       return self
00073     except struct.error as e:
00074       raise genpy.DeserializationError(e) #most likely buffer underfill
00075 
00076 
00077   def serialize_numpy(self, buff, numpy):
00078     """
00079     serialize message with numpy array types into buffer
00080     :param buff: buffer, ``StringIO``
00081     :param numpy: numpy python module
00082     """
00083     try:
00084       _x = self
00085       buff.write(_struct_2I.pack(_x.time.secs, _x.time.nsecs))
00086     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00087     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00088 
00089   def deserialize_numpy(self, str, numpy):
00090     """
00091     unpack serialized message in str into this message instance using numpy for array types
00092     :param str: byte array of serialized message, ``str``
00093     :param numpy: numpy python module
00094     """
00095     try:
00096       if self.time is None:
00097         self.time = genpy.Time()
00098       end = 0
00099       _x = self
00100       start = end
00101       end += 8
00102       (_x.time.secs, _x.time.nsecs,) = _struct_2I.unpack(str[start:end])
00103       self.time.canon()
00104       return self
00105     except struct.error as e:
00106       raise genpy.DeserializationError(e) #most likely buffer underfill
00107 
00108 _struct_I = genpy.struct_I
00109 _struct_2I = struct.Struct("<2I")
00110 """autogenerated by genpy from pr2_controllers_msgs/QueryTrajectoryStateResponse.msg. Do not edit."""
00111 import sys
00112 python3 = True if sys.hexversion > 0x03000000 else False
00113 import genpy
00114 import struct
00115 
00116 
00117 class QueryTrajectoryStateResponse(genpy.Message):
00118   _md5sum = "1f1a6554ad060f44d013e71868403c1a"
00119   _type = "pr2_controllers_msgs/QueryTrajectoryStateResponse"
00120   _has_header = False #flag to mark the presence of a Header object
00121   _full_text = """string[] name
00122 float64[] position
00123 float64[] velocity
00124 float64[] acceleration
00125 
00126 
00127 """
00128   __slots__ = ['name','position','velocity','acceleration']
00129   _slot_types = ['string[]','float64[]','float64[]','float64[]']
00130 
00131   def __init__(self, *args, **kwds):
00132     """
00133     Constructor. Any message fields that are implicitly/explicitly
00134     set to None will be assigned a default value. The recommend
00135     use is keyword arguments as this is more robust to future message
00136     changes.  You cannot mix in-order arguments and keyword arguments.
00137 
00138     The available fields are:
00139        name,position,velocity,acceleration
00140 
00141     :param args: complete set of field values, in .msg order
00142     :param kwds: use keyword arguments corresponding to message field names
00143     to set specific fields.
00144     """
00145     if args or kwds:
00146       super(QueryTrajectoryStateResponse, self).__init__(*args, **kwds)
00147       #message fields cannot be None, assign default values for those that are
00148       if self.name is None:
00149         self.name = []
00150       if self.position is None:
00151         self.position = []
00152       if self.velocity is None:
00153         self.velocity = []
00154       if self.acceleration is None:
00155         self.acceleration = []
00156     else:
00157       self.name = []
00158       self.position = []
00159       self.velocity = []
00160       self.acceleration = []
00161 
00162   def _get_types(self):
00163     """
00164     internal API method
00165     """
00166     return self._slot_types
00167 
00168   def serialize(self, buff):
00169     """
00170     serialize message into buffer
00171     :param buff: buffer, ``StringIO``
00172     """
00173     try:
00174       length = len(self.name)
00175       buff.write(_struct_I.pack(length))
00176       for val1 in self.name:
00177         length = len(val1)
00178         if python3 or type(val1) == unicode:
00179           val1 = val1.encode('utf-8')
00180           length = len(val1)
00181         buff.write(struct.pack('<I%ss'%length, length, val1))
00182       length = len(self.position)
00183       buff.write(_struct_I.pack(length))
00184       pattern = '<%sd'%length
00185       buff.write(struct.pack(pattern, *self.position))
00186       length = len(self.velocity)
00187       buff.write(_struct_I.pack(length))
00188       pattern = '<%sd'%length
00189       buff.write(struct.pack(pattern, *self.velocity))
00190       length = len(self.acceleration)
00191       buff.write(_struct_I.pack(length))
00192       pattern = '<%sd'%length
00193       buff.write(struct.pack(pattern, *self.acceleration))
00194     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00195     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00196 
00197   def deserialize(self, str):
00198     """
00199     unpack serialized message in str into this message instance
00200     :param str: byte array of serialized message, ``str``
00201     """
00202     try:
00203       end = 0
00204       start = end
00205       end += 4
00206       (length,) = _struct_I.unpack(str[start:end])
00207       self.name = []
00208       for i in range(0, length):
00209         start = end
00210         end += 4
00211         (length,) = _struct_I.unpack(str[start:end])
00212         start = end
00213         end += length
00214         if python3:
00215           val1 = str[start:end].decode('utf-8')
00216         else:
00217           val1 = str[start:end]
00218         self.name.append(val1)
00219       start = end
00220       end += 4
00221       (length,) = _struct_I.unpack(str[start:end])
00222       pattern = '<%sd'%length
00223       start = end
00224       end += struct.calcsize(pattern)
00225       self.position = struct.unpack(pattern, str[start:end])
00226       start = end
00227       end += 4
00228       (length,) = _struct_I.unpack(str[start:end])
00229       pattern = '<%sd'%length
00230       start = end
00231       end += struct.calcsize(pattern)
00232       self.velocity = struct.unpack(pattern, str[start:end])
00233       start = end
00234       end += 4
00235       (length,) = _struct_I.unpack(str[start:end])
00236       pattern = '<%sd'%length
00237       start = end
00238       end += struct.calcsize(pattern)
00239       self.acceleration = struct.unpack(pattern, str[start:end])
00240       return self
00241     except struct.error as e:
00242       raise genpy.DeserializationError(e) #most likely buffer underfill
00243 
00244 
00245   def serialize_numpy(self, buff, numpy):
00246     """
00247     serialize message with numpy array types into buffer
00248     :param buff: buffer, ``StringIO``
00249     :param numpy: numpy python module
00250     """
00251     try:
00252       length = len(self.name)
00253       buff.write(_struct_I.pack(length))
00254       for val1 in self.name:
00255         length = len(val1)
00256         if python3 or type(val1) == unicode:
00257           val1 = val1.encode('utf-8')
00258           length = len(val1)
00259         buff.write(struct.pack('<I%ss'%length, length, val1))
00260       length = len(self.position)
00261       buff.write(_struct_I.pack(length))
00262       pattern = '<%sd'%length
00263       buff.write(self.position.tostring())
00264       length = len(self.velocity)
00265       buff.write(_struct_I.pack(length))
00266       pattern = '<%sd'%length
00267       buff.write(self.velocity.tostring())
00268       length = len(self.acceleration)
00269       buff.write(_struct_I.pack(length))
00270       pattern = '<%sd'%length
00271       buff.write(self.acceleration.tostring())
00272     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00273     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00274 
00275   def deserialize_numpy(self, str, numpy):
00276     """
00277     unpack serialized message in str into this message instance using numpy for array types
00278     :param str: byte array of serialized message, ``str``
00279     :param numpy: numpy python module
00280     """
00281     try:
00282       end = 0
00283       start = end
00284       end += 4
00285       (length,) = _struct_I.unpack(str[start:end])
00286       self.name = []
00287       for i in range(0, length):
00288         start = end
00289         end += 4
00290         (length,) = _struct_I.unpack(str[start:end])
00291         start = end
00292         end += length
00293         if python3:
00294           val1 = str[start:end].decode('utf-8')
00295         else:
00296           val1 = str[start:end]
00297         self.name.append(val1)
00298       start = end
00299       end += 4
00300       (length,) = _struct_I.unpack(str[start:end])
00301       pattern = '<%sd'%length
00302       start = end
00303       end += struct.calcsize(pattern)
00304       self.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00305       start = end
00306       end += 4
00307       (length,) = _struct_I.unpack(str[start:end])
00308       pattern = '<%sd'%length
00309       start = end
00310       end += struct.calcsize(pattern)
00311       self.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00312       start = end
00313       end += 4
00314       (length,) = _struct_I.unpack(str[start:end])
00315       pattern = '<%sd'%length
00316       start = end
00317       end += struct.calcsize(pattern)
00318       self.acceleration = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00319       return self
00320     except struct.error as e:
00321       raise genpy.DeserializationError(e) #most likely buffer underfill
00322 
00323 _struct_I = genpy.struct_I
00324 class QueryTrajectoryState(object):
00325   _type          = 'pr2_controllers_msgs/QueryTrajectoryState'
00326   _md5sum = 'ec93cdecbd8062d761aa52b7c90cd44b'
00327   _request_class  = QueryTrajectoryStateRequest
00328   _response_class = QueryTrajectoryStateResponse


pr2_controllers_msgs
Author(s): Stuart Glaser
autogenerated on Thu Apr 24 2014 15:44:12