$search
00001 """autogenerated by genmsg_py from SetModelStateRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import gazebo.msg 00007 00008 class SetModelStateRequest(roslib.message.Message): 00009 _md5sum = "cb042b0e91880f4661b29ea5b6234350" 00010 _type = "gazebo/SetModelStateRequest" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """ 00013 00014 gazebo/ModelState model_state 00015 00016 ================================================================================ 00017 MSG: gazebo/ModelState 00018 #This message is deprecated. Please use the version in gazebo_msgs instead. 00019 00020 # Set Gazebo Model pose and twist 00021 string model_name # model to set state (pose and twist) 00022 geometry_msgs/Pose pose # desired pose in reference frame 00023 geometry_msgs/Twist twist # desired twist in reference frame 00024 string reference_frame # set pose/twist relative to the frame of this entity (Body/Model) 00025 # leave empty or "world" or "map" defaults to world-frame 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 MSG: geometry_msgs/Twist 00052 # This expresses velocity in free space broken into it's linear and angular parts. 00053 Vector3 linear 00054 Vector3 angular 00055 00056 ================================================================================ 00057 MSG: geometry_msgs/Vector3 00058 # This represents a vector in free space. 00059 00060 float64 x 00061 float64 y 00062 float64 z 00063 """ 00064 __slots__ = ['model_state'] 00065 _slot_types = ['gazebo/ModelState'] 00066 00067 def __init__(self, *args, **kwds): 00068 """ 00069 Constructor. Any message fields that are implicitly/explicitly 00070 set to None will be assigned a default value. The recommend 00071 use is keyword arguments as this is more robust to future message 00072 changes. You cannot mix in-order arguments and keyword arguments. 00073 00074 The available fields are: 00075 model_state 00076 00077 @param args: complete set of field values, in .msg order 00078 @param kwds: use keyword arguments corresponding to message field names 00079 to set specific fields. 00080 """ 00081 if args or kwds: 00082 super(SetModelStateRequest, self).__init__(*args, **kwds) 00083 #message fields cannot be None, assign default values for those that are 00084 if self.model_state is None: 00085 self.model_state = gazebo.msg.ModelState() 00086 else: 00087 self.model_state = gazebo.msg.ModelState() 00088 00089 def _get_types(self): 00090 """ 00091 internal API method 00092 """ 00093 return self._slot_types 00094 00095 def serialize(self, buff): 00096 """ 00097 serialize message into buffer 00098 @param buff: buffer 00099 @type buff: StringIO 00100 """ 00101 try: 00102 _x = self.model_state.model_name 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 buff.write(struct.pack('<I%ss'%length, length, _x)) 00110 except struct.error as se: self._check_types(se) 00111 except TypeError as te: self._check_types(te) 00112 00113 def deserialize(self, str): 00114 """ 00115 unpack serialized message in str into this message instance 00116 @param str: byte array of serialized message 00117 @type str: str 00118 """ 00119 try: 00120 if self.model_state is None: 00121 self.model_state = gazebo.msg.ModelState() 00122 end = 0 00123 start = end 00124 end += 4 00125 (length,) = _struct_I.unpack(str[start:end]) 00126 start = end 00127 end += length 00128 self.model_state.model_name = str[start:end] 00129 _x = self 00130 start = end 00131 end += 104 00132 (_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]) 00133 start = end 00134 end += 4 00135 (length,) = _struct_I.unpack(str[start:end]) 00136 start = end 00137 end += length 00138 self.model_state.reference_frame = str[start:end] 00139 return self 00140 except struct.error as e: 00141 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00142 00143 00144 def serialize_numpy(self, buff, numpy): 00145 """ 00146 serialize message with numpy array types into buffer 00147 @param buff: buffer 00148 @type buff: StringIO 00149 @param numpy: numpy python module 00150 @type numpy module 00151 """ 00152 try: 00153 _x = self.model_state.model_name 00154 length = len(_x) 00155 buff.write(struct.pack('<I%ss'%length, length, _x)) 00156 _x = self 00157 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)) 00158 _x = self.model_state.reference_frame 00159 length = len(_x) 00160 buff.write(struct.pack('<I%ss'%length, length, _x)) 00161 except struct.error as se: self._check_types(se) 00162 except TypeError as te: self._check_types(te) 00163 00164 def deserialize_numpy(self, str, numpy): 00165 """ 00166 unpack serialized message in str into this message instance using numpy for array types 00167 @param str: byte array of serialized message 00168 @type str: str 00169 @param numpy: numpy python module 00170 @type numpy: module 00171 """ 00172 try: 00173 if self.model_state is None: 00174 self.model_state = gazebo.msg.ModelState() 00175 end = 0 00176 start = end 00177 end += 4 00178 (length,) = _struct_I.unpack(str[start:end]) 00179 start = end 00180 end += length 00181 self.model_state.model_name = str[start:end] 00182 _x = self 00183 start = end 00184 end += 104 00185 (_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]) 00186 start = end 00187 end += 4 00188 (length,) = _struct_I.unpack(str[start:end]) 00189 start = end 00190 end += length 00191 self.model_state.reference_frame = str[start:end] 00192 return self 00193 except struct.error as e: 00194 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00195 00196 _struct_I = roslib.message.struct_I 00197 _struct_13d = struct.Struct("<13d") 00198 """autogenerated by genmsg_py from SetModelStateResponse.msg. Do not edit.""" 00199 import roslib.message 00200 import struct 00201 00202 00203 class SetModelStateResponse(roslib.message.Message): 00204 _md5sum = "2ec6f3eff0161f4257b808b12bc830c2" 00205 _type = "gazebo/SetModelStateResponse" 00206 _has_header = False #flag to mark the presence of a Header object 00207 _full_text = """bool success 00208 string status_message 00209 00210 00211 """ 00212 __slots__ = ['success','status_message'] 00213 _slot_types = ['bool','string'] 00214 00215 def __init__(self, *args, **kwds): 00216 """ 00217 Constructor. Any message fields that are implicitly/explicitly 00218 set to None will be assigned a default value. The recommend 00219 use is keyword arguments as this is more robust to future message 00220 changes. You cannot mix in-order arguments and keyword arguments. 00221 00222 The available fields are: 00223 success,status_message 00224 00225 @param args: complete set of field values, in .msg order 00226 @param kwds: use keyword arguments corresponding to message field names 00227 to set specific fields. 00228 """ 00229 if args or kwds: 00230 super(SetModelStateResponse, self).__init__(*args, **kwds) 00231 #message fields cannot be None, assign default values for those that are 00232 if self.success is None: 00233 self.success = False 00234 if self.status_message is None: 00235 self.status_message = '' 00236 else: 00237 self.success = False 00238 self.status_message = '' 00239 00240 def _get_types(self): 00241 """ 00242 internal API method 00243 """ 00244 return self._slot_types 00245 00246 def serialize(self, buff): 00247 """ 00248 serialize message into buffer 00249 @param buff: buffer 00250 @type buff: StringIO 00251 """ 00252 try: 00253 buff.write(_struct_B.pack(self.success)) 00254 _x = self.status_message 00255 length = len(_x) 00256 buff.write(struct.pack('<I%ss'%length, length, _x)) 00257 except struct.error as se: self._check_types(se) 00258 except TypeError as te: self._check_types(te) 00259 00260 def deserialize(self, str): 00261 """ 00262 unpack serialized message in str into this message instance 00263 @param str: byte array of serialized message 00264 @type str: str 00265 """ 00266 try: 00267 end = 0 00268 start = end 00269 end += 1 00270 (self.success,) = _struct_B.unpack(str[start:end]) 00271 self.success = bool(self.success) 00272 start = end 00273 end += 4 00274 (length,) = _struct_I.unpack(str[start:end]) 00275 start = end 00276 end += length 00277 self.status_message = str[start:end] 00278 return self 00279 except struct.error as e: 00280 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00281 00282 00283 def serialize_numpy(self, buff, numpy): 00284 """ 00285 serialize message with numpy array types into buffer 00286 @param buff: buffer 00287 @type buff: StringIO 00288 @param numpy: numpy python module 00289 @type numpy module 00290 """ 00291 try: 00292 buff.write(_struct_B.pack(self.success)) 00293 _x = self.status_message 00294 length = len(_x) 00295 buff.write(struct.pack('<I%ss'%length, length, _x)) 00296 except struct.error as se: self._check_types(se) 00297 except TypeError as te: self._check_types(te) 00298 00299 def deserialize_numpy(self, str, numpy): 00300 """ 00301 unpack serialized message in str into this message instance using numpy for array types 00302 @param str: byte array of serialized message 00303 @type str: str 00304 @param numpy: numpy python module 00305 @type numpy: module 00306 """ 00307 try: 00308 end = 0 00309 start = end 00310 end += 1 00311 (self.success,) = _struct_B.unpack(str[start:end]) 00312 self.success = bool(self.success) 00313 start = end 00314 end += 4 00315 (length,) = _struct_I.unpack(str[start:end]) 00316 start = end 00317 end += length 00318 self.status_message = str[start:end] 00319 return self 00320 except struct.error as e: 00321 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00322 00323 _struct_I = roslib.message.struct_I 00324 _struct_B = struct.Struct("<B") 00325 class SetModelState(roslib.message.ServiceDefinition): 00326 _type = 'gazebo/SetModelState' 00327 _md5sum = '5b3ab0281d4f5445def017e3a2e4a07b' 00328 _request_class = SetModelStateRequest 00329 _response_class = SetModelStateResponse