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