_SetLinkState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from gazebo_msgs/SetLinkStateRequest.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 geometry_msgs.msg
00008 import gazebo_msgs.msg
00009 
00010 class SetLinkStateRequest(genpy.Message):
00011   _md5sum = "22a2c757d56911b6f27868159e9a872d"
00012   _type = "gazebo_msgs/SetLinkStateRequest"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """gazebo_msgs/LinkState link_state
00015 
00016 ================================================================================
00017 MSG: gazebo_msgs/LinkState
00018 # @todo: FIXME: sets pose and twist of a link.  All children link poses/twists of the URDF tree are not updated accordingly, but should be.
00019 string link_name            # link name, link_names are in gazebo scoped name notation, [model_name::body_name]
00020 geometry_msgs/Pose pose     # desired pose in reference frame
00021 geometry_msgs/Twist twist   # desired twist in reference frame
00022 string reference_frame      # set pose/twist relative to the frame of this link/body
00023                             # leave empty or "world" or "map" defaults to world-frame
00024 
00025 ================================================================================
00026 MSG: geometry_msgs/Pose
00027 # A representation of pose in free space, composed of postion and orientation. 
00028 Point position
00029 Quaternion orientation
00030 
00031 ================================================================================
00032 MSG: geometry_msgs/Point
00033 # This contains the position of a point in free space
00034 float64 x
00035 float64 y
00036 float64 z
00037 
00038 ================================================================================
00039 MSG: geometry_msgs/Quaternion
00040 # This represents an orientation in free space in quaternion form.
00041 
00042 float64 x
00043 float64 y
00044 float64 z
00045 float64 w
00046 
00047 ================================================================================
00048 MSG: geometry_msgs/Twist
00049 # This expresses velocity in free space broken into its linear and angular parts.
00050 Vector3  linear
00051 Vector3  angular
00052 
00053 ================================================================================
00054 MSG: geometry_msgs/Vector3
00055 # This represents a vector in free space. 
00056 
00057 float64 x
00058 float64 y
00059 float64 z
00060 """
00061   __slots__ = ['link_state']
00062   _slot_types = ['gazebo_msgs/LinkState']
00063 
00064   def __init__(self, *args, **kwds):
00065     """
00066     Constructor. Any message fields that are implicitly/explicitly
00067     set to None will be assigned a default value. The recommend
00068     use is keyword arguments as this is more robust to future message
00069     changes.  You cannot mix in-order arguments and keyword arguments.
00070 
00071     The available fields are:
00072        link_state
00073 
00074     :param args: complete set of field values, in .msg order
00075     :param kwds: use keyword arguments corresponding to message field names
00076     to set specific fields.
00077     """
00078     if args or kwds:
00079       super(SetLinkStateRequest, self).__init__(*args, **kwds)
00080       #message fields cannot be None, assign default values for those that are
00081       if self.link_state is None:
00082         self.link_state = gazebo_msgs.msg.LinkState()
00083     else:
00084       self.link_state = gazebo_msgs.msg.LinkState()
00085 
00086   def _get_types(self):
00087     """
00088     internal API method
00089     """
00090     return self._slot_types
00091 
00092   def serialize(self, buff):
00093     """
00094     serialize message into buffer
00095     :param buff: buffer, ``StringIO``
00096     """
00097     try:
00098       _x = self.link_state.link_name
00099       length = len(_x)
00100       if python3 or type(_x) == unicode:
00101         _x = _x.encode('utf-8')
00102         length = len(_x)
00103       buff.write(struct.pack('<I%ss'%length, length, _x))
00104       _x = self
00105       buff.write(_struct_13d.pack(_x.link_state.pose.position.x, _x.link_state.pose.position.y, _x.link_state.pose.position.z, _x.link_state.pose.orientation.x, _x.link_state.pose.orientation.y, _x.link_state.pose.orientation.z, _x.link_state.pose.orientation.w, _x.link_state.twist.linear.x, _x.link_state.twist.linear.y, _x.link_state.twist.linear.z, _x.link_state.twist.angular.x, _x.link_state.twist.angular.y, _x.link_state.twist.angular.z))
00106       _x = self.link_state.reference_frame
00107       length = len(_x)
00108       if python3 or type(_x) == unicode:
00109         _x = _x.encode('utf-8')
00110         length = len(_x)
00111       buff.write(struct.pack('<I%ss'%length, length, _x))
00112     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00113     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00114 
00115   def deserialize(self, str):
00116     """
00117     unpack serialized message in str into this message instance
00118     :param str: byte array of serialized message, ``str``
00119     """
00120     try:
00121       if self.link_state is None:
00122         self.link_state = gazebo_msgs.msg.LinkState()
00123       end = 0
00124       start = end
00125       end += 4
00126       (length,) = _struct_I.unpack(str[start:end])
00127       start = end
00128       end += length
00129       if python3:
00130         self.link_state.link_name = str[start:end].decode('utf-8')
00131       else:
00132         self.link_state.link_name = str[start:end]
00133       _x = self
00134       start = end
00135       end += 104
00136       (_x.link_state.pose.position.x, _x.link_state.pose.position.y, _x.link_state.pose.position.z, _x.link_state.pose.orientation.x, _x.link_state.pose.orientation.y, _x.link_state.pose.orientation.z, _x.link_state.pose.orientation.w, _x.link_state.twist.linear.x, _x.link_state.twist.linear.y, _x.link_state.twist.linear.z, _x.link_state.twist.angular.x, _x.link_state.twist.angular.y, _x.link_state.twist.angular.z,) = _struct_13d.unpack(str[start:end])
00137       start = end
00138       end += 4
00139       (length,) = _struct_I.unpack(str[start:end])
00140       start = end
00141       end += length
00142       if python3:
00143         self.link_state.reference_frame = str[start:end].decode('utf-8')
00144       else:
00145         self.link_state.reference_frame = str[start:end]
00146       return self
00147     except struct.error as e:
00148       raise genpy.DeserializationError(e) #most likely buffer underfill
00149 
00150 
00151   def serialize_numpy(self, buff, numpy):
00152     """
00153     serialize message with numpy array types into buffer
00154     :param buff: buffer, ``StringIO``
00155     :param numpy: numpy python module
00156     """
00157     try:
00158       _x = self.link_state.link_name
00159       length = len(_x)
00160       if python3 or type(_x) == unicode:
00161         _x = _x.encode('utf-8')
00162         length = len(_x)
00163       buff.write(struct.pack('<I%ss'%length, length, _x))
00164       _x = self
00165       buff.write(_struct_13d.pack(_x.link_state.pose.position.x, _x.link_state.pose.position.y, _x.link_state.pose.position.z, _x.link_state.pose.orientation.x, _x.link_state.pose.orientation.y, _x.link_state.pose.orientation.z, _x.link_state.pose.orientation.w, _x.link_state.twist.linear.x, _x.link_state.twist.linear.y, _x.link_state.twist.linear.z, _x.link_state.twist.angular.x, _x.link_state.twist.angular.y, _x.link_state.twist.angular.z))
00166       _x = self.link_state.reference_frame
00167       length = len(_x)
00168       if python3 or type(_x) == unicode:
00169         _x = _x.encode('utf-8')
00170         length = len(_x)
00171       buff.write(struct.pack('<I%ss'%length, length, _x))
00172     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00173     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00174 
00175   def deserialize_numpy(self, str, numpy):
00176     """
00177     unpack serialized message in str into this message instance using numpy for array types
00178     :param str: byte array of serialized message, ``str``
00179     :param numpy: numpy python module
00180     """
00181     try:
00182       if self.link_state is None:
00183         self.link_state = gazebo_msgs.msg.LinkState()
00184       end = 0
00185       start = end
00186       end += 4
00187       (length,) = _struct_I.unpack(str[start:end])
00188       start = end
00189       end += length
00190       if python3:
00191         self.link_state.link_name = str[start:end].decode('utf-8')
00192       else:
00193         self.link_state.link_name = str[start:end]
00194       _x = self
00195       start = end
00196       end += 104
00197       (_x.link_state.pose.position.x, _x.link_state.pose.position.y, _x.link_state.pose.position.z, _x.link_state.pose.orientation.x, _x.link_state.pose.orientation.y, _x.link_state.pose.orientation.z, _x.link_state.pose.orientation.w, _x.link_state.twist.linear.x, _x.link_state.twist.linear.y, _x.link_state.twist.linear.z, _x.link_state.twist.angular.x, _x.link_state.twist.angular.y, _x.link_state.twist.angular.z,) = _struct_13d.unpack(str[start:end])
00198       start = end
00199       end += 4
00200       (length,) = _struct_I.unpack(str[start:end])
00201       start = end
00202       end += length
00203       if python3:
00204         self.link_state.reference_frame = str[start:end].decode('utf-8')
00205       else:
00206         self.link_state.reference_frame = str[start:end]
00207       return self
00208     except struct.error as e:
00209       raise genpy.DeserializationError(e) #most likely buffer underfill
00210 
00211 _struct_I = genpy.struct_I
00212 _struct_13d = struct.Struct("<13d")
00213 """autogenerated by genpy from gazebo_msgs/SetLinkStateResponse.msg. Do not edit."""
00214 import sys
00215 python3 = True if sys.hexversion > 0x03000000 else False
00216 import genpy
00217 import struct
00218 
00219 
00220 class SetLinkStateResponse(genpy.Message):
00221   _md5sum = "2ec6f3eff0161f4257b808b12bc830c2"
00222   _type = "gazebo_msgs/SetLinkStateResponse"
00223   _has_header = False #flag to mark the presence of a Header object
00224   _full_text = """bool success
00225 string status_message
00226 
00227 
00228 """
00229   __slots__ = ['success','status_message']
00230   _slot_types = ['bool','string']
00231 
00232   def __init__(self, *args, **kwds):
00233     """
00234     Constructor. Any message fields that are implicitly/explicitly
00235     set to None will be assigned a default value. The recommend
00236     use is keyword arguments as this is more robust to future message
00237     changes.  You cannot mix in-order arguments and keyword arguments.
00238 
00239     The available fields are:
00240        success,status_message
00241 
00242     :param args: complete set of field values, in .msg order
00243     :param kwds: use keyword arguments corresponding to message field names
00244     to set specific fields.
00245     """
00246     if args or kwds:
00247       super(SetLinkStateResponse, self).__init__(*args, **kwds)
00248       #message fields cannot be None, assign default values for those that are
00249       if self.success is None:
00250         self.success = False
00251       if self.status_message is None:
00252         self.status_message = ''
00253     else:
00254       self.success = False
00255       self.status_message = ''
00256 
00257   def _get_types(self):
00258     """
00259     internal API method
00260     """
00261     return self._slot_types
00262 
00263   def serialize(self, buff):
00264     """
00265     serialize message into buffer
00266     :param buff: buffer, ``StringIO``
00267     """
00268     try:
00269       buff.write(_struct_B.pack(self.success))
00270       _x = self.status_message
00271       length = len(_x)
00272       if python3 or type(_x) == unicode:
00273         _x = _x.encode('utf-8')
00274         length = len(_x)
00275       buff.write(struct.pack('<I%ss'%length, length, _x))
00276     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00277     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00278 
00279   def deserialize(self, str):
00280     """
00281     unpack serialized message in str into this message instance
00282     :param str: byte array of serialized message, ``str``
00283     """
00284     try:
00285       end = 0
00286       start = end
00287       end += 1
00288       (self.success,) = _struct_B.unpack(str[start:end])
00289       self.success = bool(self.success)
00290       start = end
00291       end += 4
00292       (length,) = _struct_I.unpack(str[start:end])
00293       start = end
00294       end += length
00295       if python3:
00296         self.status_message = str[start:end].decode('utf-8')
00297       else:
00298         self.status_message = str[start:end]
00299       return self
00300     except struct.error as e:
00301       raise genpy.DeserializationError(e) #most likely buffer underfill
00302 
00303 
00304   def serialize_numpy(self, buff, numpy):
00305     """
00306     serialize message with numpy array types into buffer
00307     :param buff: buffer, ``StringIO``
00308     :param numpy: numpy python module
00309     """
00310     try:
00311       buff.write(_struct_B.pack(self.success))
00312       _x = self.status_message
00313       length = len(_x)
00314       if python3 or type(_x) == unicode:
00315         _x = _x.encode('utf-8')
00316         length = len(_x)
00317       buff.write(struct.pack('<I%ss'%length, length, _x))
00318     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00319     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00320 
00321   def deserialize_numpy(self, str, numpy):
00322     """
00323     unpack serialized message in str into this message instance using numpy for array types
00324     :param str: byte array of serialized message, ``str``
00325     :param numpy: numpy python module
00326     """
00327     try:
00328       end = 0
00329       start = end
00330       end += 1
00331       (self.success,) = _struct_B.unpack(str[start:end])
00332       self.success = bool(self.success)
00333       start = end
00334       end += 4
00335       (length,) = _struct_I.unpack(str[start:end])
00336       start = end
00337       end += length
00338       if python3:
00339         self.status_message = str[start:end].decode('utf-8')
00340       else:
00341         self.status_message = str[start:end]
00342       return self
00343     except struct.error as e:
00344       raise genpy.DeserializationError(e) #most likely buffer underfill
00345 
00346 _struct_I = genpy.struct_I
00347 _struct_B = struct.Struct("<B")
00348 class SetLinkState(object):
00349   _type          = 'gazebo_msgs/SetLinkState'
00350   _md5sum = '8a5146eb66ae4d26b0860b08f3f271be'
00351   _request_class  = SetLinkStateRequest
00352   _response_class = SetLinkStateResponse


gazebo_msgs
Author(s): John Hsu
autogenerated on Mon Oct 6 2014 12:14:33