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