Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This Python file uses the following encoding: utf-8
- """autogenerated by genpy from gazebo_msgs/SpawnModelRequest.msg. Do not edit."""
- import sys
- python3 = True if sys.hexversion > 0x03000000 else False
- import genpy
- import struct
- import geometry_msgs.msg
- class SpawnModelRequest(genpy.Message):
- _md5sum = "6d0eba5753761cd57e6263a056b79930"
- _type = "gazebo_msgs/SpawnModelRequest"
- _has_header = False #flag to mark the presence of a Header object
- _full_text = """string model_name
- string model_xml
- string robot_namespace
- geometry_msgs/Pose initial_pose
- string reference_frame
- ================================================================================
- MSG: geometry_msgs/Pose
- # A representation of pose in free space, composed of position and orientation.
- Point position
- Quaternion orientation
- ================================================================================
- MSG: geometry_msgs/Point
- # This contains the position of a point in free space
- float64 x
- float64 y
- float64 z
- ================================================================================
- MSG: geometry_msgs/Quaternion
- # This represents an orientation in free space in quaternion form.
- float64 x
- float64 y
- float64 z
- float64 w
- """
- __slots__ = ['model_name','model_xml','robot_namespace','initial_pose','reference_frame']
- _slot_types = ['string','string','string','geometry_msgs/Pose','string']
- def __init__(self, *args, **kwds):
- """
- Constructor. Any message fields that are implicitly/explicitly
- set to None will be assigned a default value. The recommend
- use is keyword arguments as this is more robust to future message
- changes. You cannot mix in-order arguments and keyword arguments.
- The available fields are:
- model_name,model_xml,robot_namespace,initial_pose,reference_frame
- :param args: complete set of field values, in .msg order
- :param kwds: use keyword arguments corresponding to message field names
- to set specific fields.
- """
- if args or kwds:
- super(SpawnModelRequest, self).__init__(*args, **kwds)
- #message fields cannot be None, assign default values for those that are
- if self.model_name is None:
- self.model_name = ''
- if self.model_xml is None:
- self.model_xml = ''
- if self.robot_namespace is None:
- self.robot_namespace = ''
- if self.initial_pose is None:
- self.initial_pose = geometry_msgs.msg.Pose()
- if self.reference_frame is None:
- self.reference_frame = ''
- else:
- self.model_name = ''
- self.model_xml = ''
- self.robot_namespace = ''
- self.initial_pose = geometry_msgs.msg.Pose()
- self.reference_frame = ''
- def _get_types(self):
- """
- internal API method
- """
- return self._slot_types
- def serialize(self, buff):
- """
- serialize message into buffer
- :param buff: buffer, ``StringIO``
- """
- try:
- _x = self.model_name
- length = len(_x)
- if python3 and type(_x) == str:
- _x = _x.encode('utf-8')
- length = len(_x)
- buff.write(struct.pack('<I%ss'%length, length, _x))
- _x = self.model_xml
- length = len(_x)
- if python3 and type(_x) == str:
- _x = _x.encode('utf-8')
- length = len(_x)
- buff.write(struct.pack('<I%ss'%length, length, _x))
- _x = self.robot_namespace
- length = len(_x)
- if python3 and type(_x) == str:
- _x = _x.encode('utf-8')
- length = len(_x)
- buff.write(struct.pack('<I%ss'%length, length, _x))
- _x = self
- buff.write(_get_struct_7d().pack(_x.initial_pose.position.x, _x.initial_pose.position.y, _x.initial_pose.position.z, _x.initial_pose.orientation.x, _x.initial_pose.orientation.y, _x.initial_pose.orientation.z, _x.initial_pose.orientation.w))
- _x = self.reference_frame
- length = len(_x)
- if python3 and type(_x) == str:
- _x = _x.encode('utf-8')
- length = len(_x)
- buff.write(struct.pack('<I%ss'%length, length, _x))
- except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
- except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
- def deserialize(self, str):
- """
- unpack serialized message in str into this message instance
- :param str: byte array of serialized message, ``str``
- """
- try:
- if self.initial_pose is None:
- self.initial_pose = geometry_msgs.msg.Pose()
- end = 0
- start = end
- end += 4
- (length,) = _struct_I.unpack(str[start:end])
- start = end
- end += length
- if python3:
- self.model_name = str[start:end].decode('utf-8')
- else:
- self.model_name = str[start:end]
- start = end
- end += 4
- (length,) = _struct_I.unpack(str[start:end])
- start = end
- end += length
- if python3:
- self.model_xml = str[start:end].decode('utf-8')
- else:
- self.model_xml = str[start:end]
- start = end
- end += 4
- (length,) = _struct_I.unpack(str[start:end])
- start = end
- end += length
- if python3:
- self.robot_namespace = str[start:end].decode('utf-8')
- else:
- self.robot_namespace = str[start:end]
- _x = self
- start = end
- end += 56
- (_x.initial_pose.position.x, _x.initial_pose.position.y, _x.initial_pose.position.z, _x.initial_pose.orientation.x, _x.initial_pose.orientation.y, _x.initial_pose.orientation.z, _x.initial_pose.orientation.w,) = _get_struct_7d().unpack(str[start:end])
- start = end
- end += 4
- (length,) = _struct_I.unpack(str[start:end])
- start = end
- end += length
- if python3:
- self.reference_frame = str[start:end].decode('utf-8')
- else:
- self.reference_frame = str[start:end]
- return self
- except struct.error as e:
- raise genpy.DeserializationError(e) #most likely buffer underfill
- def serialize_numpy(self, buff, numpy):
- """
- serialize message with numpy array types into buffer
- :param buff: buffer, ``StringIO``
- :param numpy: numpy python module
- """
- try:
- _x = self.model_name
- length = len(_x)
- if python3 or type(_x) == unicode:
- _x = _x.encode('utf-8')
- length = len(_x)
- buff.write(struct.pack('<I%ss'%length, length, _x))
- _x = self.model_xml
- length = len(_x)
- if python3 or type(_x) == unicode:
- _x = _x.encode('utf-8')
- length = len(_x)
- buff.write(struct.pack('<I%ss'%length, length, _x))
- _x = self.robot_namespace
- length = len(_x)
- if python3 or type(_x) == unicode:
- _x = _x.encode('utf-8')
- length = len(_x)
- buff.write(struct.pack('<I%ss'%length, length, _x))
- _x = self
- buff.write(_get_struct_7d().pack(_x.initial_pose.position.x, _x.initial_pose.position.y, _x.initial_pose.position.z, _x.initial_pose.orientation.x, _x.initial_pose.orientation.y, _x.initial_pose.orientation.z, _x.initial_pose.orientation.w))
- _x = self.reference_frame
- length = len(_x)
- if python3 or type(_x) == unicode:
- _x = _x.encode('utf-8')
- length = len(_x)
- buff.write(struct.pack('<I%ss'%length, length, _x))
- except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
- except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
- def deserialize_numpy(self, str, numpy):
- """
- unpack serialized message in str into this message instance using numpy for array types
- :param str: byte array of serialized message, ``str``
- :param numpy: numpy python module
- """
- try:
- if self.initial_pose is None:
- self.initial_pose = geometry_msgs.msg.Pose()
- end = 0
- start = end
- end += 4
- (length,) = _struct_I.unpack(str[start:end])
- start = end
- end += length
- if python3:
- self.model_name = str[start:end].decode('utf-8')
- else:
- self.model_name = str[start:end]
- start = end
- end += 4
- (length,) = _struct_I.unpack(str[start:end])
- start = end
- end += length
- if python3:
- self.model_xml = str[start:end].decode('utf-8')
- else:
- self.model_xml = str[start:end]
- start = end
- end += 4
- (length,) = _struct_I.unpack(str[start:end])
- start = end
- end += length
- if python3:
- self.robot_namespace = str[start:end].decode('utf-8')
- else:
- self.robot_namespace = str[start:end]
- _x = self
- start = end
- end += 56
- (_x.initial_pose.position.x, _x.initial_pose.position.y, _x.initial_pose.position.z, _x.initial_pose.orientation.x, _x.initial_pose.orientation.y, _x.initial_pose.orientation.z, _x.initial_pose.orientation.w,) = _get_struct_7d().unpack(str[start:end])
- start = end
- end += 4
- (length,) = _struct_I.unpack(str[start:end])
- start = end
- end += length
- if python3:
- self.reference_frame = str[start:end].decode('utf-8')
- else:
- self.reference_frame = str[start:end]
- return self
- except struct.error as e:
- raise genpy.DeserializationError(e) #most likely buffer underfill
- _struct_I = genpy.struct_I
- def _get_struct_I():
- global _struct_I
- return _struct_I
- _struct_7d = None
- def _get_struct_7d():
- global _struct_7d
- if _struct_7d is None:
- _struct_7d = struct.Struct("<7d")
- return _struct_7d
- # This Python file uses the following encoding: utf-8
- """autogenerated by genpy from gazebo_msgs/SpawnModelResponse.msg. Do not edit."""
- import sys
- python3 = True if sys.hexversion > 0x03000000 else False
- import genpy
- import struct
- class SpawnModelResponse(genpy.Message):
- _md5sum = "2ec6f3eff0161f4257b808b12bc830c2"
- _type = "gazebo_msgs/SpawnModelResponse"
- _has_header = False #flag to mark the presence of a Header object
- _full_text = """bool success
- string status_message
- """
- __slots__ = ['success','status_message']
- _slot_types = ['bool','string']
- def __init__(self, *args, **kwds):
- """
- Constructor. Any message fields that are implicitly/explicitly
- set to None will be assigned a default value. The recommend
- use is keyword arguments as this is more robust to future message
- changes. You cannot mix in-order arguments and keyword arguments.
- The available fields are:
- success,status_message
- :param args: complete set of field values, in .msg order
- :param kwds: use keyword arguments corresponding to message field names
- to set specific fields.
- """
- if args or kwds:
- super(SpawnModelResponse, self).__init__(*args, **kwds)
- #message fields cannot be None, assign default values for those that are
- if self.success is None:
- self.success = False
- if self.status_message is None:
- self.status_message = ''
- else:
- self.success = False
- self.status_message = ''
- def _get_types(self):
- """
- internal API method
- """
- return self._slot_types
- def serialize(self, buff):
- """
- serialize message into buffer
- :param buff: buffer, ``StringIO``
- """
- try:
- buff.write(_get_struct_B().pack(self.success))
- _x = self.status_message
- length = len(_x)
- if python3 or type(_x) == unicode:
- _x = _x.encode('utf-8')
- length = len(_x)
- buff.write(struct.pack('<I%ss'%length, length, _x))
- except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
- except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
- def deserialize(self, str):
- """
- unpack serialized message in str into this message instance
- :param str: byte array of serialized message, ``str``
- """
- try:
- end = 0
- start = end
- end += 1
- (self.success,) = _get_struct_B().unpack(str[start:end])
- self.success = bool(self.success)
- start = end
- end += 4
- (length,) = _struct_I.unpack(str[start:end])
- start = end
- end += length
- if python3:
- self.status_message = str[start:end].decode('utf-8')
- else:
- self.status_message = str[start:end]
- return self
- except struct.error as e:
- raise genpy.DeserializationError(e) #most likely buffer underfill
- def serialize_numpy(self, buff, numpy):
- """
- serialize message with numpy array types into buffer
- :param buff: buffer, ``StringIO``
- :param numpy: numpy python module
- """
- try:
- buff.write(_get_struct_B().pack(self.success))
- _x = self.status_message
- length = len(_x)
- if python3 or type(_x) == unicode:
- _x = _x.encode('utf-8')
- length = len(_x)
- buff.write(struct.pack('<I%ss'%length, length, _x))
- except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
- except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
- def deserialize_numpy(self, str, numpy):
- """
- unpack serialized message in str into this message instance using numpy for array types
- :param str: byte array of serialized message, ``str``
- :param numpy: numpy python module
- """
- try:
- end = 0
- start = end
- end += 1
- (self.success,) = _get_struct_B().unpack(str[start:end])
- self.success = bool(self.success)
- start = end
- end += 4
- (length,) = _struct_I.unpack(str[start:end])
- start = end
- end += length
- if python3:
- self.status_message = str[start:end].decode('utf-8')
- else:
- self.status_message = str[start:end]
- return self
- except struct.error as e:
- raise genpy.DeserializationError(e) #most likely buffer underfill
- _struct_I = genpy.struct_I
- def _get_struct_I():
- global _struct_I
- return _struct_I
- _struct_B = None
- def _get_struct_B():
- global _struct_B
- if _struct_B is None:
- _struct_B = struct.Struct("<B")
- return _struct_B
- class SpawnModel(object):
- _type = 'gazebo_msgs/SpawnModel'
- _md5sum = '9ed9c82c96abe1a00c3e8cdaeee24413'
- _request_class = SpawnModelRequest
- _response_class = SpawnModelResponse
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement