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