_robot_setactivedofs.py
Go to the documentation of this file.
00001 """autogenerated by genpy from openraveros/robot_setactivedofsRequest.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 openraveros.msg
00008 
00009 class robot_setactivedofsRequest(genpy.Message):
00010   _md5sum = "afc87996c12a6a996d7490aec3964c8d"
00011   _type = "openraveros/robot_setactivedofsRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """
00014 
00015 int32 robotid
00016 ActiveDOFs active
00017 
00018 ================================================================================
00019 MSG: openraveros/ActiveDOFs
00020 # specifies the active degrees of freedom of the robot
00021 
00022 # mask of active base degrees of freedom
00023 uint32 affine
00024 
00025 # active joints
00026 int32[] indices
00027 
00028 float32[3] rotationaxis
00029 
00030 # mask for affine dofs
00031 uint8 DOF_X = 1
00032 uint8 DOF_Y = 2
00033 uint8 DOF_Z = 4
00034 uint8 DOF_RotationAxis = 8
00035 uint8 DOF_Rotation3D = 16
00036 uint8 DOF_RotationQuat = 32
00037 
00038 """
00039   __slots__ = ['robotid','active']
00040   _slot_types = ['int32','openraveros/ActiveDOFs']
00041 
00042   def __init__(self, *args, **kwds):
00043     """
00044     Constructor. Any message fields that are implicitly/explicitly
00045     set to None will be assigned a default value. The recommend
00046     use is keyword arguments as this is more robust to future message
00047     changes.  You cannot mix in-order arguments and keyword arguments.
00048 
00049     The available fields are:
00050        robotid,active
00051 
00052     :param args: complete set of field values, in .msg order
00053     :param kwds: use keyword arguments corresponding to message field names
00054     to set specific fields.
00055     """
00056     if args or kwds:
00057       super(robot_setactivedofsRequest, self).__init__(*args, **kwds)
00058       #message fields cannot be None, assign default values for those that are
00059       if self.robotid is None:
00060         self.robotid = 0
00061       if self.active is None:
00062         self.active = openraveros.msg.ActiveDOFs()
00063     else:
00064       self.robotid = 0
00065       self.active = openraveros.msg.ActiveDOFs()
00066 
00067   def _get_types(self):
00068     """
00069     internal API method
00070     """
00071     return self._slot_types
00072 
00073   def serialize(self, buff):
00074     """
00075     serialize message into buffer
00076     :param buff: buffer, ``StringIO``
00077     """
00078     try:
00079       _x = self
00080       buff.write(_struct_iI.pack(_x.robotid, _x.active.affine))
00081       length = len(self.active.indices)
00082       buff.write(_struct_I.pack(length))
00083       pattern = '<%si'%length
00084       buff.write(struct.pack(pattern, *self.active.indices))
00085       buff.write(_struct_3f.pack(*self.active.rotationaxis))
00086     except struct.error as se: self._check_types(se)
00087     except TypeError as te: self._check_types(te)
00088 
00089   def deserialize(self, str):
00090     """
00091     unpack serialized message in str into this message instance
00092     :param str: byte array of serialized message, ``str``
00093     """
00094     try:
00095       if self.active is None:
00096         self.active = openraveros.msg.ActiveDOFs()
00097       end = 0
00098       _x = self
00099       start = end
00100       end += 8
00101       (_x.robotid, _x.active.affine,) = _struct_iI.unpack(str[start:end])
00102       start = end
00103       end += 4
00104       (length,) = _struct_I.unpack(str[start:end])
00105       pattern = '<%si'%length
00106       start = end
00107       end += struct.calcsize(pattern)
00108       self.active.indices = struct.unpack(pattern, str[start:end])
00109       start = end
00110       end += 12
00111       self.active.rotationaxis = _struct_3f.unpack(str[start:end])
00112       return self
00113     except struct.error as e:
00114       raise genpy.DeserializationError(e) #most likely buffer underfill
00115 
00116 
00117   def serialize_numpy(self, buff, numpy):
00118     """
00119     serialize message with numpy array types into buffer
00120     :param buff: buffer, ``StringIO``
00121     :param numpy: numpy python module
00122     """
00123     try:
00124       _x = self
00125       buff.write(_struct_iI.pack(_x.robotid, _x.active.affine))
00126       length = len(self.active.indices)
00127       buff.write(_struct_I.pack(length))
00128       pattern = '<%si'%length
00129       buff.write(self.active.indices.tostring())
00130       buff.write(self.active.rotationaxis.tostring())
00131     except struct.error as se: self._check_types(se)
00132     except TypeError as te: self._check_types(te)
00133 
00134   def deserialize_numpy(self, str, numpy):
00135     """
00136     unpack serialized message in str into this message instance using numpy for array types
00137     :param str: byte array of serialized message, ``str``
00138     :param numpy: numpy python module
00139     """
00140     try:
00141       if self.active is None:
00142         self.active = openraveros.msg.ActiveDOFs()
00143       end = 0
00144       _x = self
00145       start = end
00146       end += 8
00147       (_x.robotid, _x.active.affine,) = _struct_iI.unpack(str[start:end])
00148       start = end
00149       end += 4
00150       (length,) = _struct_I.unpack(str[start:end])
00151       pattern = '<%si'%length
00152       start = end
00153       end += struct.calcsize(pattern)
00154       self.active.indices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00155       start = end
00156       end += 12
00157       self.active.rotationaxis = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=3)
00158       return self
00159     except struct.error as e:
00160       raise genpy.DeserializationError(e) #most likely buffer underfill
00161 
00162 _struct_I = genpy.struct_I
00163 _struct_iI = struct.Struct("<iI")
00164 _struct_3f = struct.Struct("<3f")
00165 """autogenerated by genpy from openraveros/robot_setactivedofsResponse.msg. Do not edit."""
00166 import sys
00167 python3 = True if sys.hexversion > 0x03000000 else False
00168 import genpy
00169 import struct
00170 
00171 
00172 class robot_setactivedofsResponse(genpy.Message):
00173   _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00174   _type = "openraveros/robot_setactivedofsResponse"
00175   _has_header = False #flag to mark the presence of a Header object
00176   _full_text = """
00177 
00178 """
00179   __slots__ = []
00180   _slot_types = []
00181 
00182   def __init__(self, *args, **kwds):
00183     """
00184     Constructor. Any message fields that are implicitly/explicitly
00185     set to None will be assigned a default value. The recommend
00186     use is keyword arguments as this is more robust to future message
00187     changes.  You cannot mix in-order arguments and keyword arguments.
00188 
00189     The available fields are:
00190        
00191 
00192     :param args: complete set of field values, in .msg order
00193     :param kwds: use keyword arguments corresponding to message field names
00194     to set specific fields.
00195     """
00196     if args or kwds:
00197       super(robot_setactivedofsResponse, self).__init__(*args, **kwds)
00198 
00199   def _get_types(self):
00200     """
00201     internal API method
00202     """
00203     return self._slot_types
00204 
00205   def serialize(self, buff):
00206     """
00207     serialize message into buffer
00208     :param buff: buffer, ``StringIO``
00209     """
00210     try:
00211       pass
00212     except struct.error as se: self._check_types(se)
00213     except TypeError as te: self._check_types(te)
00214 
00215   def deserialize(self, str):
00216     """
00217     unpack serialized message in str into this message instance
00218     :param str: byte array of serialized message, ``str``
00219     """
00220     try:
00221       end = 0
00222       return self
00223     except struct.error as e:
00224       raise genpy.DeserializationError(e) #most likely buffer underfill
00225 
00226 
00227   def serialize_numpy(self, buff, numpy):
00228     """
00229     serialize message with numpy array types into buffer
00230     :param buff: buffer, ``StringIO``
00231     :param numpy: numpy python module
00232     """
00233     try:
00234       pass
00235     except struct.error as se: self._check_types(se)
00236     except TypeError as te: self._check_types(te)
00237 
00238   def deserialize_numpy(self, str, numpy):
00239     """
00240     unpack serialized message in str into this message instance using numpy for array types
00241     :param str: byte array of serialized message, ``str``
00242     :param numpy: numpy python module
00243     """
00244     try:
00245       end = 0
00246       return self
00247     except struct.error as e:
00248       raise genpy.DeserializationError(e) #most likely buffer underfill
00249 
00250 _struct_I = genpy.struct_I
00251 class robot_setactivedofs(object):
00252   _type          = 'openraveros/robot_setactivedofs'
00253   _md5sum = 'afc87996c12a6a996d7490aec3964c8d'
00254   _request_class  = robot_setactivedofsRequest
00255   _response_class = robot_setactivedofsResponse
 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:39