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