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