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


openrave_msgs
Author(s): Rosen Diankov (rosen.diankov@gmail.com)
autogenerated on Sat Mar 23 2013 14:07:55