_env_getrobots.py
Go to the documentation of this file.
00001 """autogenerated by genpy from openraveros/env_getrobotsRequest.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 env_getrobotsRequest(genpy.Message):
00009   _md5sum = "9996321108452a956d6ad7dd8fe30cad"
00010   _type = "openraveros/env_getrobotsRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 
00015 int32 bodyid
00016 
00017 
00018 uint16 options
00019 
00020 
00021 """
00022   __slots__ = ['bodyid','options']
00023   _slot_types = ['int32','uint16']
00024 
00025   def __init__(self, *args, **kwds):
00026     """
00027     Constructor. Any message fields that are implicitly/explicitly
00028     set to None will be assigned a default value. The recommend
00029     use is keyword arguments as this is more robust to future message
00030     changes.  You cannot mix in-order arguments and keyword arguments.
00031 
00032     The available fields are:
00033        bodyid,options
00034 
00035     :param args: complete set of field values, in .msg order
00036     :param kwds: use keyword arguments corresponding to message field names
00037     to set specific fields.
00038     """
00039     if args or kwds:
00040       super(env_getrobotsRequest, self).__init__(*args, **kwds)
00041       #message fields cannot be None, assign default values for those that are
00042       if self.bodyid is None:
00043         self.bodyid = 0
00044       if self.options is None:
00045         self.options = 0
00046     else:
00047       self.bodyid = 0
00048       self.options = 0
00049 
00050   def _get_types(self):
00051     """
00052     internal API method
00053     """
00054     return self._slot_types
00055 
00056   def serialize(self, buff):
00057     """
00058     serialize message into buffer
00059     :param buff: buffer, ``StringIO``
00060     """
00061     try:
00062       _x = self
00063       buff.write(_struct_iH.pack(_x.bodyid, _x.options))
00064     except struct.error as se: self._check_types(se)
00065     except TypeError as te: self._check_types(te)
00066 
00067   def deserialize(self, str):
00068     """
00069     unpack serialized message in str into this message instance
00070     :param str: byte array of serialized message, ``str``
00071     """
00072     try:
00073       end = 0
00074       _x = self
00075       start = end
00076       end += 6
00077       (_x.bodyid, _x.options,) = _struct_iH.unpack(str[start:end])
00078       return self
00079     except struct.error as e:
00080       raise genpy.DeserializationError(e) #most likely buffer underfill
00081 
00082 
00083   def serialize_numpy(self, buff, numpy):
00084     """
00085     serialize message with numpy array types into buffer
00086     :param buff: buffer, ``StringIO``
00087     :param numpy: numpy python module
00088     """
00089     try:
00090       _x = self
00091       buff.write(_struct_iH.pack(_x.bodyid, _x.options))
00092     except struct.error as se: self._check_types(se)
00093     except TypeError as te: self._check_types(te)
00094 
00095   def deserialize_numpy(self, str, numpy):
00096     """
00097     unpack serialized message in str into this message instance using numpy for array types
00098     :param str: byte array of serialized message, ``str``
00099     :param numpy: numpy python module
00100     """
00101     try:
00102       end = 0
00103       _x = self
00104       start = end
00105       end += 6
00106       (_x.bodyid, _x.options,) = _struct_iH.unpack(str[start:end])
00107       return self
00108     except struct.error as e:
00109       raise genpy.DeserializationError(e) #most likely buffer underfill
00110 
00111 _struct_I = genpy.struct_I
00112 _struct_iH = struct.Struct("<iH")
00113 """autogenerated by genpy from openraveros/env_getrobotsResponse.msg. Do not edit."""
00114 import sys
00115 python3 = True if sys.hexversion > 0x03000000 else False
00116 import genpy
00117 import struct
00118 
00119 import openraveros.msg
00120 
00121 class env_getrobotsResponse(genpy.Message):
00122   _md5sum = "38c02fd855ba1814cb013d4ea1e800bf"
00123   _type = "openraveros/env_getrobotsResponse"
00124   _has_header = False #flag to mark the presence of a Header object
00125   _full_text = """RobotInfo[] robots
00126 
00127 
00128 ================================================================================
00129 MSG: openraveros/RobotInfo
00130 # robot information
00131 
00132 BodyInfo bodyinfo
00133 Manipulator[] manips
00134 AttachedSensor[] sensors
00135 
00136 # total active dof
00137 uint8 activedof
00138 
00139 # current active manipulator
00140 uint8 activemanip
00141 
00142 # information about the active dofs
00143 ActiveDOFs active
00144 
00145 # joint limits
00146 float32[] activelowerlimit
00147 float32[] activeupperlimit
00148 
00149 # upper 8 bits
00150 uint16 Req_Manipulators=256
00151 uint16 Req_Sensors=512
00152 uint16 Req_ActiveDOFs=1024
00153 uint16 Req_ActiveLimits=2048
00154 
00155 ================================================================================
00156 MSG: openraveros/BodyInfo
00157 # information about a body
00158 int32 bodyid
00159 
00160 # current transformation
00161 AffineTransformMatrix transform
00162 
00163 # degrees of freedom (number of joints)
00164 uint8 dof
00165 
00166 # enabled status
00167 uint8 enabled
00168 
00169 
00170 # filename used to create body geometry
00171 string filename
00172 
00173 # name of the body
00174 string name
00175 
00176 # type of body
00177 string type
00178 
00179 float32[] jointvalues
00180 AffineTransformMatrix[] links
00181 string[] linknames
00182 string[] jointnames
00183 
00184 # joint limits
00185 float32[] lowerlimit
00186 float32[] upperlimit
00187 
00188 # request information bitmasks, also holds robot specific request information (lower 8 bits)
00189 uint16 Req_JointValues=1
00190 uint16 Req_Links=2
00191 uint16 Req_LinkNames=4 # fills the linknames
00192 uint16 Req_JointLimits=8
00193 uint16 Req_Names=16 # if set, fills filename, name, and type
00194 uint16 Req_JointNames=32 # fills the jointnames
00195 ================================================================================
00196 MSG: openraveros/AffineTransformMatrix
00197 # column ordered 3x4 affine transformation, ie: the arrangement in memory is:
00198 # where the upper 3x3 matrix is orthonormal
00199 # [0] [3] [6] [9]
00200 # [1] [4] [7] [10]
00201 # [2] [5] [8] [11]
00202 float32[12] m
00203 
00204 ================================================================================
00205 MSG: openraveros/Manipulator
00206 # information specific to a manipulator for a robot
00207 
00208 # zero-based index of base link that manipulator is attached to
00209 int8 baselink
00210 
00211 # zero-based index of link defining the end-effector
00212 int8 eelink
00213 
00214 # 3x4 matrix of the grasp frame relative to the end-effector link
00215 AffineTransformMatrix tgrasp
00216 
00217 # zero-based hand joint indices
00218 uint8[] handjoints
00219 
00220 # zero-based arm joints indices (from base to end-effector)
00221 uint8[] armjoints
00222 
00223 # name of ik solver using
00224 string iksolvername
00225 
00226 # manipulator name
00227 string name
00228 
00229 ================================================================================
00230 MSG: openraveros/AttachedSensor
00231 # information specific to an attached sensor for a robot
00232 
00233 # name of sensor
00234 string name
00235 
00236 # zero-based index of link sensor is attached to
00237 int8 attachedlink
00238 
00239 # 3x4 matrix of the relative transform of the sensor frame with respect to the link frame
00240 AffineTransformMatrix trelative
00241 
00242 # 3x4 matrix of the global transform of the sensor (ie, with link transform applied)
00243 AffineTransformMatrix tglobal
00244 
00245 # type of sensor
00246 string type
00247 
00248 ================================================================================
00249 MSG: openraveros/ActiveDOFs
00250 # specifies the active degrees of freedom of the robot
00251 
00252 # mask of active base degrees of freedom
00253 uint32 affine
00254 
00255 # active joints
00256 int32[] indices
00257 
00258 float32[3] rotationaxis
00259 
00260 # mask for affine dofs
00261 uint8 DOF_X = 1
00262 uint8 DOF_Y = 2
00263 uint8 DOF_Z = 4
00264 uint8 DOF_RotationAxis = 8
00265 uint8 DOF_Rotation3D = 16
00266 uint8 DOF_RotationQuat = 32
00267 
00268 """
00269   __slots__ = ['robots']
00270   _slot_types = ['openraveros/RobotInfo[]']
00271 
00272   def __init__(self, *args, **kwds):
00273     """
00274     Constructor. Any message fields that are implicitly/explicitly
00275     set to None will be assigned a default value. The recommend
00276     use is keyword arguments as this is more robust to future message
00277     changes.  You cannot mix in-order arguments and keyword arguments.
00278 
00279     The available fields are:
00280        robots
00281 
00282     :param args: complete set of field values, in .msg order
00283     :param kwds: use keyword arguments corresponding to message field names
00284     to set specific fields.
00285     """
00286     if args or kwds:
00287       super(env_getrobotsResponse, self).__init__(*args, **kwds)
00288       #message fields cannot be None, assign default values for those that are
00289       if self.robots is None:
00290         self.robots = []
00291     else:
00292       self.robots = []
00293 
00294   def _get_types(self):
00295     """
00296     internal API method
00297     """
00298     return self._slot_types
00299 
00300   def serialize(self, buff):
00301     """
00302     serialize message into buffer
00303     :param buff: buffer, ``StringIO``
00304     """
00305     try:
00306       length = len(self.robots)
00307       buff.write(_struct_I.pack(length))
00308       for val1 in self.robots:
00309         _v1 = val1.bodyinfo
00310         buff.write(_struct_i.pack(_v1.bodyid))
00311         _v2 = _v1.transform
00312         buff.write(_struct_12f.pack(*_v2.m))
00313         _x = _v1
00314         buff.write(_struct_2B.pack(_x.dof, _x.enabled))
00315         _x = _v1.filename
00316         length = len(_x)
00317         if python3 or type(_x) == unicode:
00318           _x = _x.encode('utf-8')
00319           length = len(_x)
00320         buff.write(struct.pack('<I%ss'%length, length, _x))
00321         _x = _v1.name
00322         length = len(_x)
00323         if python3 or type(_x) == unicode:
00324           _x = _x.encode('utf-8')
00325           length = len(_x)
00326         buff.write(struct.pack('<I%ss'%length, length, _x))
00327         _x = _v1.type
00328         length = len(_x)
00329         if python3 or type(_x) == unicode:
00330           _x = _x.encode('utf-8')
00331           length = len(_x)
00332         buff.write(struct.pack('<I%ss'%length, length, _x))
00333         length = len(_v1.jointvalues)
00334         buff.write(_struct_I.pack(length))
00335         pattern = '<%sf'%length
00336         buff.write(struct.pack(pattern, *_v1.jointvalues))
00337         length = len(_v1.links)
00338         buff.write(_struct_I.pack(length))
00339         for val3 in _v1.links:
00340           buff.write(_struct_12f.pack(*val3.m))
00341         length = len(_v1.linknames)
00342         buff.write(_struct_I.pack(length))
00343         for val3 in _v1.linknames:
00344           length = len(val3)
00345           if python3 or type(val3) == unicode:
00346             val3 = val3.encode('utf-8')
00347             length = len(val3)
00348           buff.write(struct.pack('<I%ss'%length, length, val3))
00349         length = len(_v1.jointnames)
00350         buff.write(_struct_I.pack(length))
00351         for val3 in _v1.jointnames:
00352           length = len(val3)
00353           if python3 or type(val3) == unicode:
00354             val3 = val3.encode('utf-8')
00355             length = len(val3)
00356           buff.write(struct.pack('<I%ss'%length, length, val3))
00357         length = len(_v1.lowerlimit)
00358         buff.write(_struct_I.pack(length))
00359         pattern = '<%sf'%length
00360         buff.write(struct.pack(pattern, *_v1.lowerlimit))
00361         length = len(_v1.upperlimit)
00362         buff.write(_struct_I.pack(length))
00363         pattern = '<%sf'%length
00364         buff.write(struct.pack(pattern, *_v1.upperlimit))
00365         length = len(val1.manips)
00366         buff.write(_struct_I.pack(length))
00367         for val2 in val1.manips:
00368           _x = val2
00369           buff.write(_struct_2b.pack(_x.baselink, _x.eelink))
00370           _v3 = val2.tgrasp
00371           buff.write(_struct_12f.pack(*_v3.m))
00372           _x = val2.handjoints
00373           length = len(_x)
00374           # - if encoded as a list instead, serialize as bytes instead of string
00375           if type(_x) in [list, tuple]:
00376             buff.write(struct.pack('<I%sB'%length, length, *_x))
00377           else:
00378             buff.write(struct.pack('<I%ss'%length, length, _x))
00379           _x = val2.armjoints
00380           length = len(_x)
00381           # - if encoded as a list instead, serialize as bytes instead of string
00382           if type(_x) in [list, tuple]:
00383             buff.write(struct.pack('<I%sB'%length, length, *_x))
00384           else:
00385             buff.write(struct.pack('<I%ss'%length, length, _x))
00386           _x = val2.iksolvername
00387           length = len(_x)
00388           if python3 or type(_x) == unicode:
00389             _x = _x.encode('utf-8')
00390             length = len(_x)
00391           buff.write(struct.pack('<I%ss'%length, length, _x))
00392           _x = val2.name
00393           length = len(_x)
00394           if python3 or type(_x) == unicode:
00395             _x = _x.encode('utf-8')
00396             length = len(_x)
00397           buff.write(struct.pack('<I%ss'%length, length, _x))
00398         length = len(val1.sensors)
00399         buff.write(_struct_I.pack(length))
00400         for val2 in val1.sensors:
00401           _x = val2.name
00402           length = len(_x)
00403           if python3 or type(_x) == unicode:
00404             _x = _x.encode('utf-8')
00405             length = len(_x)
00406           buff.write(struct.pack('<I%ss'%length, length, _x))
00407           buff.write(_struct_b.pack(val2.attachedlink))
00408           _v4 = val2.trelative
00409           buff.write(_struct_12f.pack(*_v4.m))
00410           _v5 = val2.tglobal
00411           buff.write(_struct_12f.pack(*_v5.m))
00412           _x = val2.type
00413           length = len(_x)
00414           if python3 or type(_x) == unicode:
00415             _x = _x.encode('utf-8')
00416             length = len(_x)
00417           buff.write(struct.pack('<I%ss'%length, length, _x))
00418         _x = val1
00419         buff.write(_struct_2B.pack(_x.activedof, _x.activemanip))
00420         _v6 = val1.active
00421         buff.write(_struct_I.pack(_v6.affine))
00422         length = len(_v6.indices)
00423         buff.write(_struct_I.pack(length))
00424         pattern = '<%si'%length
00425         buff.write(struct.pack(pattern, *_v6.indices))
00426         buff.write(_struct_3f.pack(*_v6.rotationaxis))
00427         length = len(val1.activelowerlimit)
00428         buff.write(_struct_I.pack(length))
00429         pattern = '<%sf'%length
00430         buff.write(struct.pack(pattern, *val1.activelowerlimit))
00431         length = len(val1.activeupperlimit)
00432         buff.write(_struct_I.pack(length))
00433         pattern = '<%sf'%length
00434         buff.write(struct.pack(pattern, *val1.activeupperlimit))
00435     except struct.error as se: self._check_types(se)
00436     except TypeError as te: self._check_types(te)
00437 
00438   def deserialize(self, str):
00439     """
00440     unpack serialized message in str into this message instance
00441     :param str: byte array of serialized message, ``str``
00442     """
00443     try:
00444       if self.robots is None:
00445         self.robots = None
00446       end = 0
00447       start = end
00448       end += 4
00449       (length,) = _struct_I.unpack(str[start:end])
00450       self.robots = []
00451       for i in range(0, length):
00452         val1 = openraveros.msg.RobotInfo()
00453         _v7 = val1.bodyinfo
00454         start = end
00455         end += 4
00456         (_v7.bodyid,) = _struct_i.unpack(str[start:end])
00457         _v8 = _v7.transform
00458         start = end
00459         end += 48
00460         _v8.m = _struct_12f.unpack(str[start:end])
00461         _x = _v7
00462         start = end
00463         end += 2
00464         (_x.dof, _x.enabled,) = _struct_2B.unpack(str[start:end])
00465         start = end
00466         end += 4
00467         (length,) = _struct_I.unpack(str[start:end])
00468         start = end
00469         end += length
00470         if python3:
00471           _v7.filename = str[start:end].decode('utf-8')
00472         else:
00473           _v7.filename = str[start:end]
00474         start = end
00475         end += 4
00476         (length,) = _struct_I.unpack(str[start:end])
00477         start = end
00478         end += length
00479         if python3:
00480           _v7.name = str[start:end].decode('utf-8')
00481         else:
00482           _v7.name = str[start:end]
00483         start = end
00484         end += 4
00485         (length,) = _struct_I.unpack(str[start:end])
00486         start = end
00487         end += length
00488         if python3:
00489           _v7.type = str[start:end].decode('utf-8')
00490         else:
00491           _v7.type = str[start:end]
00492         start = end
00493         end += 4
00494         (length,) = _struct_I.unpack(str[start:end])
00495         pattern = '<%sf'%length
00496         start = end
00497         end += struct.calcsize(pattern)
00498         _v7.jointvalues = struct.unpack(pattern, str[start:end])
00499         start = end
00500         end += 4
00501         (length,) = _struct_I.unpack(str[start:end])
00502         _v7.links = []
00503         for i in range(0, length):
00504           val3 = openraveros.msg.AffineTransformMatrix()
00505           start = end
00506           end += 48
00507           val3.m = _struct_12f.unpack(str[start:end])
00508           _v7.links.append(val3)
00509         start = end
00510         end += 4
00511         (length,) = _struct_I.unpack(str[start:end])
00512         _v7.linknames = []
00513         for i in range(0, length):
00514           start = end
00515           end += 4
00516           (length,) = _struct_I.unpack(str[start:end])
00517           start = end
00518           end += length
00519           if python3:
00520             val3 = str[start:end].decode('utf-8')
00521           else:
00522             val3 = str[start:end]
00523           _v7.linknames.append(val3)
00524         start = end
00525         end += 4
00526         (length,) = _struct_I.unpack(str[start:end])
00527         _v7.jointnames = []
00528         for i in range(0, length):
00529           start = end
00530           end += 4
00531           (length,) = _struct_I.unpack(str[start:end])
00532           start = end
00533           end += length
00534           if python3:
00535             val3 = str[start:end].decode('utf-8')
00536           else:
00537             val3 = str[start:end]
00538           _v7.jointnames.append(val3)
00539         start = end
00540         end += 4
00541         (length,) = _struct_I.unpack(str[start:end])
00542         pattern = '<%sf'%length
00543         start = end
00544         end += struct.calcsize(pattern)
00545         _v7.lowerlimit = struct.unpack(pattern, str[start:end])
00546         start = end
00547         end += 4
00548         (length,) = _struct_I.unpack(str[start:end])
00549         pattern = '<%sf'%length
00550         start = end
00551         end += struct.calcsize(pattern)
00552         _v7.upperlimit = struct.unpack(pattern, str[start:end])
00553         start = end
00554         end += 4
00555         (length,) = _struct_I.unpack(str[start:end])
00556         val1.manips = []
00557         for i in range(0, length):
00558           val2 = openraveros.msg.Manipulator()
00559           _x = val2
00560           start = end
00561           end += 2
00562           (_x.baselink, _x.eelink,) = _struct_2b.unpack(str[start:end])
00563           _v9 = val2.tgrasp
00564           start = end
00565           end += 48
00566           _v9.m = _struct_12f.unpack(str[start:end])
00567           start = end
00568           end += 4
00569           (length,) = _struct_I.unpack(str[start:end])
00570           start = end
00571           end += length
00572           if python3:
00573             val2.handjoints = str[start:end].decode('utf-8')
00574           else:
00575             val2.handjoints = str[start:end]
00576           start = end
00577           end += 4
00578           (length,) = _struct_I.unpack(str[start:end])
00579           start = end
00580           end += length
00581           if python3:
00582             val2.armjoints = str[start:end].decode('utf-8')
00583           else:
00584             val2.armjoints = str[start:end]
00585           start = end
00586           end += 4
00587           (length,) = _struct_I.unpack(str[start:end])
00588           start = end
00589           end += length
00590           if python3:
00591             val2.iksolvername = str[start:end].decode('utf-8')
00592           else:
00593             val2.iksolvername = str[start:end]
00594           start = end
00595           end += 4
00596           (length,) = _struct_I.unpack(str[start:end])
00597           start = end
00598           end += length
00599           if python3:
00600             val2.name = str[start:end].decode('utf-8')
00601           else:
00602             val2.name = str[start:end]
00603           val1.manips.append(val2)
00604         start = end
00605         end += 4
00606         (length,) = _struct_I.unpack(str[start:end])
00607         val1.sensors = []
00608         for i in range(0, length):
00609           val2 = openraveros.msg.AttachedSensor()
00610           start = end
00611           end += 4
00612           (length,) = _struct_I.unpack(str[start:end])
00613           start = end
00614           end += length
00615           if python3:
00616             val2.name = str[start:end].decode('utf-8')
00617           else:
00618             val2.name = str[start:end]
00619           start = end
00620           end += 1
00621           (val2.attachedlink,) = _struct_b.unpack(str[start:end])
00622           _v10 = val2.trelative
00623           start = end
00624           end += 48
00625           _v10.m = _struct_12f.unpack(str[start:end])
00626           _v11 = val2.tglobal
00627           start = end
00628           end += 48
00629           _v11.m = _struct_12f.unpack(str[start:end])
00630           start = end
00631           end += 4
00632           (length,) = _struct_I.unpack(str[start:end])
00633           start = end
00634           end += length
00635           if python3:
00636             val2.type = str[start:end].decode('utf-8')
00637           else:
00638             val2.type = str[start:end]
00639           val1.sensors.append(val2)
00640         _x = val1
00641         start = end
00642         end += 2
00643         (_x.activedof, _x.activemanip,) = _struct_2B.unpack(str[start:end])
00644         _v12 = val1.active
00645         start = end
00646         end += 4
00647         (_v12.affine,) = _struct_I.unpack(str[start:end])
00648         start = end
00649         end += 4
00650         (length,) = _struct_I.unpack(str[start:end])
00651         pattern = '<%si'%length
00652         start = end
00653         end += struct.calcsize(pattern)
00654         _v12.indices = struct.unpack(pattern, str[start:end])
00655         start = end
00656         end += 12
00657         _v12.rotationaxis = _struct_3f.unpack(str[start:end])
00658         start = end
00659         end += 4
00660         (length,) = _struct_I.unpack(str[start:end])
00661         pattern = '<%sf'%length
00662         start = end
00663         end += struct.calcsize(pattern)
00664         val1.activelowerlimit = struct.unpack(pattern, str[start:end])
00665         start = end
00666         end += 4
00667         (length,) = _struct_I.unpack(str[start:end])
00668         pattern = '<%sf'%length
00669         start = end
00670         end += struct.calcsize(pattern)
00671         val1.activeupperlimit = struct.unpack(pattern, str[start:end])
00672         self.robots.append(val1)
00673       return self
00674     except struct.error as e:
00675       raise genpy.DeserializationError(e) #most likely buffer underfill
00676 
00677 
00678   def serialize_numpy(self, buff, numpy):
00679     """
00680     serialize message with numpy array types into buffer
00681     :param buff: buffer, ``StringIO``
00682     :param numpy: numpy python module
00683     """
00684     try:
00685       length = len(self.robots)
00686       buff.write(_struct_I.pack(length))
00687       for val1 in self.robots:
00688         _v13 = val1.bodyinfo
00689         buff.write(_struct_i.pack(_v13.bodyid))
00690         _v14 = _v13.transform
00691         buff.write(_v14.m.tostring())
00692         _x = _v13
00693         buff.write(_struct_2B.pack(_x.dof, _x.enabled))
00694         _x = _v13.filename
00695         length = len(_x)
00696         if python3 or type(_x) == unicode:
00697           _x = _x.encode('utf-8')
00698           length = len(_x)
00699         buff.write(struct.pack('<I%ss'%length, length, _x))
00700         _x = _v13.name
00701         length = len(_x)
00702         if python3 or type(_x) == unicode:
00703           _x = _x.encode('utf-8')
00704           length = len(_x)
00705         buff.write(struct.pack('<I%ss'%length, length, _x))
00706         _x = _v13.type
00707         length = len(_x)
00708         if python3 or type(_x) == unicode:
00709           _x = _x.encode('utf-8')
00710           length = len(_x)
00711         buff.write(struct.pack('<I%ss'%length, length, _x))
00712         length = len(_v13.jointvalues)
00713         buff.write(_struct_I.pack(length))
00714         pattern = '<%sf'%length
00715         buff.write(_v13.jointvalues.tostring())
00716         length = len(_v13.links)
00717         buff.write(_struct_I.pack(length))
00718         for val3 in _v13.links:
00719           buff.write(val3.m.tostring())
00720         length = len(_v13.linknames)
00721         buff.write(_struct_I.pack(length))
00722         for val3 in _v13.linknames:
00723           length = len(val3)
00724           if python3 or type(val3) == unicode:
00725             val3 = val3.encode('utf-8')
00726             length = len(val3)
00727           buff.write(struct.pack('<I%ss'%length, length, val3))
00728         length = len(_v13.jointnames)
00729         buff.write(_struct_I.pack(length))
00730         for val3 in _v13.jointnames:
00731           length = len(val3)
00732           if python3 or type(val3) == unicode:
00733             val3 = val3.encode('utf-8')
00734             length = len(val3)
00735           buff.write(struct.pack('<I%ss'%length, length, val3))
00736         length = len(_v13.lowerlimit)
00737         buff.write(_struct_I.pack(length))
00738         pattern = '<%sf'%length
00739         buff.write(_v13.lowerlimit.tostring())
00740         length = len(_v13.upperlimit)
00741         buff.write(_struct_I.pack(length))
00742         pattern = '<%sf'%length
00743         buff.write(_v13.upperlimit.tostring())
00744         length = len(val1.manips)
00745         buff.write(_struct_I.pack(length))
00746         for val2 in val1.manips:
00747           _x = val2
00748           buff.write(_struct_2b.pack(_x.baselink, _x.eelink))
00749           _v15 = val2.tgrasp
00750           buff.write(_v15.m.tostring())
00751           _x = val2.handjoints
00752           length = len(_x)
00753           # - if encoded as a list instead, serialize as bytes instead of string
00754           if type(_x) in [list, tuple]:
00755             buff.write(struct.pack('<I%sB'%length, length, *_x))
00756           else:
00757             buff.write(struct.pack('<I%ss'%length, length, _x))
00758           _x = val2.armjoints
00759           length = len(_x)
00760           # - if encoded as a list instead, serialize as bytes instead of string
00761           if type(_x) in [list, tuple]:
00762             buff.write(struct.pack('<I%sB'%length, length, *_x))
00763           else:
00764             buff.write(struct.pack('<I%ss'%length, length, _x))
00765           _x = val2.iksolvername
00766           length = len(_x)
00767           if python3 or type(_x) == unicode:
00768             _x = _x.encode('utf-8')
00769             length = len(_x)
00770           buff.write(struct.pack('<I%ss'%length, length, _x))
00771           _x = val2.name
00772           length = len(_x)
00773           if python3 or type(_x) == unicode:
00774             _x = _x.encode('utf-8')
00775             length = len(_x)
00776           buff.write(struct.pack('<I%ss'%length, length, _x))
00777         length = len(val1.sensors)
00778         buff.write(_struct_I.pack(length))
00779         for val2 in val1.sensors:
00780           _x = val2.name
00781           length = len(_x)
00782           if python3 or type(_x) == unicode:
00783             _x = _x.encode('utf-8')
00784             length = len(_x)
00785           buff.write(struct.pack('<I%ss'%length, length, _x))
00786           buff.write(_struct_b.pack(val2.attachedlink))
00787           _v16 = val2.trelative
00788           buff.write(_v16.m.tostring())
00789           _v17 = val2.tglobal
00790           buff.write(_v17.m.tostring())
00791           _x = val2.type
00792           length = len(_x)
00793           if python3 or type(_x) == unicode:
00794             _x = _x.encode('utf-8')
00795             length = len(_x)
00796           buff.write(struct.pack('<I%ss'%length, length, _x))
00797         _x = val1
00798         buff.write(_struct_2B.pack(_x.activedof, _x.activemanip))
00799         _v18 = val1.active
00800         buff.write(_struct_I.pack(_v18.affine))
00801         length = len(_v18.indices)
00802         buff.write(_struct_I.pack(length))
00803         pattern = '<%si'%length
00804         buff.write(_v18.indices.tostring())
00805         buff.write(_v18.rotationaxis.tostring())
00806         length = len(val1.activelowerlimit)
00807         buff.write(_struct_I.pack(length))
00808         pattern = '<%sf'%length
00809         buff.write(val1.activelowerlimit.tostring())
00810         length = len(val1.activeupperlimit)
00811         buff.write(_struct_I.pack(length))
00812         pattern = '<%sf'%length
00813         buff.write(val1.activeupperlimit.tostring())
00814     except struct.error as se: self._check_types(se)
00815     except TypeError as te: self._check_types(te)
00816 
00817   def deserialize_numpy(self, str, numpy):
00818     """
00819     unpack serialized message in str into this message instance using numpy for array types
00820     :param str: byte array of serialized message, ``str``
00821     :param numpy: numpy python module
00822     """
00823     try:
00824       if self.robots is None:
00825         self.robots = None
00826       end = 0
00827       start = end
00828       end += 4
00829       (length,) = _struct_I.unpack(str[start:end])
00830       self.robots = []
00831       for i in range(0, length):
00832         val1 = openraveros.msg.RobotInfo()
00833         _v19 = val1.bodyinfo
00834         start = end
00835         end += 4
00836         (_v19.bodyid,) = _struct_i.unpack(str[start:end])
00837         _v20 = _v19.transform
00838         start = end
00839         end += 48
00840         _v20.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
00841         _x = _v19
00842         start = end
00843         end += 2
00844         (_x.dof, _x.enabled,) = _struct_2B.unpack(str[start:end])
00845         start = end
00846         end += 4
00847         (length,) = _struct_I.unpack(str[start:end])
00848         start = end
00849         end += length
00850         if python3:
00851           _v19.filename = str[start:end].decode('utf-8')
00852         else:
00853           _v19.filename = str[start:end]
00854         start = end
00855         end += 4
00856         (length,) = _struct_I.unpack(str[start:end])
00857         start = end
00858         end += length
00859         if python3:
00860           _v19.name = str[start:end].decode('utf-8')
00861         else:
00862           _v19.name = str[start:end]
00863         start = end
00864         end += 4
00865         (length,) = _struct_I.unpack(str[start:end])
00866         start = end
00867         end += length
00868         if python3:
00869           _v19.type = str[start:end].decode('utf-8')
00870         else:
00871           _v19.type = str[start:end]
00872         start = end
00873         end += 4
00874         (length,) = _struct_I.unpack(str[start:end])
00875         pattern = '<%sf'%length
00876         start = end
00877         end += struct.calcsize(pattern)
00878         _v19.jointvalues = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00879         start = end
00880         end += 4
00881         (length,) = _struct_I.unpack(str[start:end])
00882         _v19.links = []
00883         for i in range(0, length):
00884           val3 = openraveros.msg.AffineTransformMatrix()
00885           start = end
00886           end += 48
00887           val3.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
00888           _v19.links.append(val3)
00889         start = end
00890         end += 4
00891         (length,) = _struct_I.unpack(str[start:end])
00892         _v19.linknames = []
00893         for i in range(0, length):
00894           start = end
00895           end += 4
00896           (length,) = _struct_I.unpack(str[start:end])
00897           start = end
00898           end += length
00899           if python3:
00900             val3 = str[start:end].decode('utf-8')
00901           else:
00902             val3 = str[start:end]
00903           _v19.linknames.append(val3)
00904         start = end
00905         end += 4
00906         (length,) = _struct_I.unpack(str[start:end])
00907         _v19.jointnames = []
00908         for i in range(0, length):
00909           start = end
00910           end += 4
00911           (length,) = _struct_I.unpack(str[start:end])
00912           start = end
00913           end += length
00914           if python3:
00915             val3 = str[start:end].decode('utf-8')
00916           else:
00917             val3 = str[start:end]
00918           _v19.jointnames.append(val3)
00919         start = end
00920         end += 4
00921         (length,) = _struct_I.unpack(str[start:end])
00922         pattern = '<%sf'%length
00923         start = end
00924         end += struct.calcsize(pattern)
00925         _v19.lowerlimit = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00926         start = end
00927         end += 4
00928         (length,) = _struct_I.unpack(str[start:end])
00929         pattern = '<%sf'%length
00930         start = end
00931         end += struct.calcsize(pattern)
00932         _v19.upperlimit = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00933         start = end
00934         end += 4
00935         (length,) = _struct_I.unpack(str[start:end])
00936         val1.manips = []
00937         for i in range(0, length):
00938           val2 = openraveros.msg.Manipulator()
00939           _x = val2
00940           start = end
00941           end += 2
00942           (_x.baselink, _x.eelink,) = _struct_2b.unpack(str[start:end])
00943           _v21 = val2.tgrasp
00944           start = end
00945           end += 48
00946           _v21.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
00947           start = end
00948           end += 4
00949           (length,) = _struct_I.unpack(str[start:end])
00950           start = end
00951           end += length
00952           if python3:
00953             val2.handjoints = str[start:end].decode('utf-8')
00954           else:
00955             val2.handjoints = str[start:end]
00956           start = end
00957           end += 4
00958           (length,) = _struct_I.unpack(str[start:end])
00959           start = end
00960           end += length
00961           if python3:
00962             val2.armjoints = str[start:end].decode('utf-8')
00963           else:
00964             val2.armjoints = str[start:end]
00965           start = end
00966           end += 4
00967           (length,) = _struct_I.unpack(str[start:end])
00968           start = end
00969           end += length
00970           if python3:
00971             val2.iksolvername = str[start:end].decode('utf-8')
00972           else:
00973             val2.iksolvername = str[start:end]
00974           start = end
00975           end += 4
00976           (length,) = _struct_I.unpack(str[start:end])
00977           start = end
00978           end += length
00979           if python3:
00980             val2.name = str[start:end].decode('utf-8')
00981           else:
00982             val2.name = str[start:end]
00983           val1.manips.append(val2)
00984         start = end
00985         end += 4
00986         (length,) = _struct_I.unpack(str[start:end])
00987         val1.sensors = []
00988         for i in range(0, length):
00989           val2 = openraveros.msg.AttachedSensor()
00990           start = end
00991           end += 4
00992           (length,) = _struct_I.unpack(str[start:end])
00993           start = end
00994           end += length
00995           if python3:
00996             val2.name = str[start:end].decode('utf-8')
00997           else:
00998             val2.name = str[start:end]
00999           start = end
01000           end += 1
01001           (val2.attachedlink,) = _struct_b.unpack(str[start:end])
01002           _v22 = val2.trelative
01003           start = end
01004           end += 48
01005           _v22.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
01006           _v23 = val2.tglobal
01007           start = end
01008           end += 48
01009           _v23.m = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=12)
01010           start = end
01011           end += 4
01012           (length,) = _struct_I.unpack(str[start:end])
01013           start = end
01014           end += length
01015           if python3:
01016             val2.type = str[start:end].decode('utf-8')
01017           else:
01018             val2.type = str[start:end]
01019           val1.sensors.append(val2)
01020         _x = val1
01021         start = end
01022         end += 2
01023         (_x.activedof, _x.activemanip,) = _struct_2B.unpack(str[start:end])
01024         _v24 = val1.active
01025         start = end
01026         end += 4
01027         (_v24.affine,) = _struct_I.unpack(str[start:end])
01028         start = end
01029         end += 4
01030         (length,) = _struct_I.unpack(str[start:end])
01031         pattern = '<%si'%length
01032         start = end
01033         end += struct.calcsize(pattern)
01034         _v24.indices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
01035         start = end
01036         end += 12
01037         _v24.rotationaxis = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=3)
01038         start = end
01039         end += 4
01040         (length,) = _struct_I.unpack(str[start:end])
01041         pattern = '<%sf'%length
01042         start = end
01043         end += struct.calcsize(pattern)
01044         val1.activelowerlimit = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
01045         start = end
01046         end += 4
01047         (length,) = _struct_I.unpack(str[start:end])
01048         pattern = '<%sf'%length
01049         start = end
01050         end += struct.calcsize(pattern)
01051         val1.activeupperlimit = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
01052         self.robots.append(val1)
01053       return self
01054     except struct.error as e:
01055       raise genpy.DeserializationError(e) #most likely buffer underfill
01056 
01057 _struct_I = genpy.struct_I
01058 _struct_b = struct.Struct("<b")
01059 _struct_2B = struct.Struct("<2B")
01060 _struct_12f = struct.Struct("<12f")
01061 _struct_i = struct.Struct("<i")
01062 _struct_2b = struct.Struct("<2b")
01063 _struct_3f = struct.Struct("<3f")
01064 class env_getrobots(object):
01065   _type          = 'openraveros/env_getrobots'
01066   _md5sum = '67744c39b9378c6b7bc344ff1029d5bc'
01067   _request_class  = env_getrobotsRequest
01068   _response_class = env_getrobotsResponse
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


openraveros
Author(s): Rosen Diankov (rosen.diankov@gmail.com)
autogenerated on Sat Mar 23 2013 22:15:38