00001 """autogenerated by genmsg_py from GazeboModel.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006
00007 class GazeboModel(roslib.message.Message):
00008 _md5sum = "d714ee18a610705f8552f4aa20321c29"
00009 _type = "gazebo_plugins/GazeboModel"
00010 _has_header = False
00011 _full_text = """# This is a message that hold the data necessary to spawn a model in Gazebo
00012 # this message is used by SpawnModel service calls to RosFactory plugin.
00013
00014 string model_name # name of the model to be spawned in Gazebo
00015 string robot_model # contains either URDF or Gazebo XML robot model
00016 uint32 xml_type # specifies what the content of robot_model is
00017 string robot_namespace # ros namespace for all the ros interface of the model
00018 geometry_msgs/Pose initial_pose # initial pose in the gazebo world frame
00019 uint32 disable_urdf_joint_limits = 0 # special flag to disable URDF joint limits
00020 uint32 URDF = 0 # enum: robot_model contains XML string for an URDF model
00021 uint32 GAZEBO_XML = 1 # enum: robot_model contains XML string for an URDF model
00022 uint32 URDF_PARAM_NAME = 2 # enum: robot_model contains parameter name containing URDF XML
00023 uint32 GAZEBO_XML_PARAM_NAME = 3 # enum: robot_model contains parameter name containing Gazebo Model XML
00024 uint32 URDF_FILE_NAME = 4 # enum: robot_model contains file name containing URDF XML
00025 uint32 GAZEBO_XML_FILE_NAME = 5 # enum: robot_model contains file name containing Gazebo Model XML
00026
00027
00028 ================================================================================
00029 MSG: geometry_msgs/Pose
00030 # A representation of pose in free space, composed of postion and orientation.
00031 Point position
00032 Quaternion orientation
00033
00034 ================================================================================
00035 MSG: geometry_msgs/Point
00036 # This contains the position of a point in free space
00037 float64 x
00038 float64 y
00039 float64 z
00040
00041 ================================================================================
00042 MSG: geometry_msgs/Quaternion
00043 # This represents an orientation in free space in quaternion form.
00044
00045 float64 x
00046 float64 y
00047 float64 z
00048 float64 w
00049
00050 """
00051
00052 disable_urdf_joint_limits = 0
00053 URDF = 0
00054 GAZEBO_XML = 1
00055 URDF_PARAM_NAME = 2
00056 GAZEBO_XML_PARAM_NAME = 3
00057 URDF_FILE_NAME = 4
00058 GAZEBO_XML_FILE_NAME = 5
00059
00060 __slots__ = ['model_name','robot_model','xml_type','robot_namespace','initial_pose']
00061 _slot_types = ['string','string','uint32','string','geometry_msgs/Pose']
00062
00063 def __init__(self, *args, **kwds):
00064 """
00065 Constructor. Any message fields that are implicitly/explicitly
00066 set to None will be assigned a default value. The recommend
00067 use is keyword arguments as this is more robust to future message
00068 changes. You cannot mix in-order arguments and keyword arguments.
00069
00070 The available fields are:
00071 model_name,robot_model,xml_type,robot_namespace,initial_pose
00072
00073 @param args: complete set of field values, in .msg order
00074 @param kwds: use keyword arguments corresponding to message field names
00075 to set specific fields.
00076 """
00077 if args or kwds:
00078 super(GazeboModel, self).__init__(*args, **kwds)
00079
00080 if self.model_name is None:
00081 self.model_name = ''
00082 if self.robot_model is None:
00083 self.robot_model = ''
00084 if self.xml_type is None:
00085 self.xml_type = 0
00086 if self.robot_namespace is None:
00087 self.robot_namespace = ''
00088 if self.initial_pose is None:
00089 self.initial_pose = geometry_msgs.msg.Pose()
00090 else:
00091 self.model_name = ''
00092 self.robot_model = ''
00093 self.xml_type = 0
00094 self.robot_namespace = ''
00095 self.initial_pose = geometry_msgs.msg.Pose()
00096
00097 def _get_types(self):
00098 """
00099 internal API method
00100 """
00101 return self._slot_types
00102
00103 def serialize(self, buff):
00104 """
00105 serialize message into buffer
00106 @param buff: buffer
00107 @type buff: StringIO
00108 """
00109 try:
00110 _x = self.model_name
00111 length = len(_x)
00112 buff.write(struct.pack('<I%ss'%length, length, _x))
00113 _x = self.robot_model
00114 length = len(_x)
00115 buff.write(struct.pack('<I%ss'%length, length, _x))
00116 buff.write(_struct_I.pack(self.xml_type))
00117 _x = self.robot_namespace
00118 length = len(_x)
00119 buff.write(struct.pack('<I%ss'%length, length, _x))
00120 _x = self
00121 buff.write(_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))
00122 except struct.error, se: self._check_types(se)
00123 except TypeError, te: self._check_types(te)
00124
00125 def deserialize(self, str):
00126 """
00127 unpack serialized message in str into this message instance
00128 @param str: byte array of serialized message
00129 @type str: str
00130 """
00131 try:
00132 if self.initial_pose is None:
00133 self.initial_pose = geometry_msgs.msg.Pose()
00134 end = 0
00135 start = end
00136 end += 4
00137 (length,) = _struct_I.unpack(str[start:end])
00138 start = end
00139 end += length
00140 self.model_name = str[start:end]
00141 start = end
00142 end += 4
00143 (length,) = _struct_I.unpack(str[start:end])
00144 start = end
00145 end += length
00146 self.robot_model = str[start:end]
00147 start = end
00148 end += 4
00149 (self.xml_type,) = _struct_I.unpack(str[start:end])
00150 start = end
00151 end += 4
00152 (length,) = _struct_I.unpack(str[start:end])
00153 start = end
00154 end += length
00155 self.robot_namespace = str[start:end]
00156 _x = self
00157 start = end
00158 end += 56
00159 (_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,) = _struct_7d.unpack(str[start:end])
00160 return self
00161 except struct.error, e:
00162 raise roslib.message.DeserializationError(e)
00163
00164
00165 def serialize_numpy(self, buff, numpy):
00166 """
00167 serialize message with numpy array types into buffer
00168 @param buff: buffer
00169 @type buff: StringIO
00170 @param numpy: numpy python module
00171 @type numpy module
00172 """
00173 try:
00174 _x = self.model_name
00175 length = len(_x)
00176 buff.write(struct.pack('<I%ss'%length, length, _x))
00177 _x = self.robot_model
00178 length = len(_x)
00179 buff.write(struct.pack('<I%ss'%length, length, _x))
00180 buff.write(_struct_I.pack(self.xml_type))
00181 _x = self.robot_namespace
00182 length = len(_x)
00183 buff.write(struct.pack('<I%ss'%length, length, _x))
00184 _x = self
00185 buff.write(_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))
00186 except struct.error, se: self._check_types(se)
00187 except TypeError, te: self._check_types(te)
00188
00189 def deserialize_numpy(self, str, numpy):
00190 """
00191 unpack serialized message in str into this message instance using numpy for array types
00192 @param str: byte array of serialized message
00193 @type str: str
00194 @param numpy: numpy python module
00195 @type numpy: module
00196 """
00197 try:
00198 if self.initial_pose is None:
00199 self.initial_pose = geometry_msgs.msg.Pose()
00200 end = 0
00201 start = end
00202 end += 4
00203 (length,) = _struct_I.unpack(str[start:end])
00204 start = end
00205 end += length
00206 self.model_name = str[start:end]
00207 start = end
00208 end += 4
00209 (length,) = _struct_I.unpack(str[start:end])
00210 start = end
00211 end += length
00212 self.robot_model = str[start:end]
00213 start = end
00214 end += 4
00215 (self.xml_type,) = _struct_I.unpack(str[start:end])
00216 start = end
00217 end += 4
00218 (length,) = _struct_I.unpack(str[start:end])
00219 start = end
00220 end += length
00221 self.robot_namespace = str[start:end]
00222 _x = self
00223 start = end
00224 end += 56
00225 (_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,) = _struct_7d.unpack(str[start:end])
00226 return self
00227 except struct.error, e:
00228 raise roslib.message.DeserializationError(e)
00229
00230 _struct_I = roslib.message.struct_I
00231 _struct_7d = struct.Struct("<7d")