此题为判断题(对,错)。
第7题
B.擦拭
C.润滑
D.目测
E.面对
第10题
本作业要求实现移动机器人的EKF 定位算法。请阅读附件作业说明,将下述代码保存为ekf_localization.m 文件,并填写?部分(填写后将?所在行前面的%去除),在Matlab中运行测试,上交填写?后的完整代码以及运行结果图。 ekf_localization.m 代码 function [] = ekf_localization() % Homework for ekf localization % Modified by YH on 09/09/2019, thanks to the original open source % Any questions please contact: zjuyinhuan@gmail.com close all; clear all; disp('EKF Start!') time = 0; global endTime; % [sec] endTime = 60; global dt; dt = 0.1; % [sec] removeStep = 5; nSteps = ceil((endTime - time)/dt); estimation.time=[]; estimation.u=[]; estimation.GPS=[]; estimation.xOdom=[]; estimation.xEkf=[]; estimation.xTruth=[]; % State Vector [x y yaw]' xEkf=[0 0 0]'; PxEkf = eye(3); % Ground True State xTruth=xEkf; % Odometry Only xOdom=xTruth; % Observation vector [x y yaw]' z=[0 0 0]'; % Simulation parameter global noiseQ noiseQ = diag([0.1 0 degreeToRadian(10)]).^2; %[Vx Vy yawrate] global noiseR noiseR = diag([0.5 0.5 degreeToRadian(5)]).^2;%[x y yaw] % Covariance Matrix for motion % convQ=? % Covariance Matrix for observation % convR=? % Other Intial % ? % Main loop for i=1 : nSteps time = time + dt; % Input u=robotControl(time); % Observation [z,xTruth,xOdom,u]=prepare(xTruth, xOdom, u); % ------ Kalman Filter -------- % Predict % ? % Update % xEkf=? % ----------------------------- % Simulation estimation estimation.time=[estimation.time; time]; estimation.xTruth=[estimation.xTruth; xTruth']; estimation.xOdom=[estimation.xOdom; xOdom']; estimation.xEkf=[estimation.xEkf;xEkf']; estimation.GPS=[estimation.GPS; z']; estimation.u=[estimation.u; u']; % Plot in real time % Animation (remove some flames) if rem(i,removeStep)==0 %hold off; plot(estimation.GPS(:,1),estimation.GPS(:,2),'*m', 'MarkerSize', 5);hold on; plot(estimation.xOdom(:,1),estimation.xOdom(:,2),'.k', 'MarkerSize', 10);hold on; plot(estimation.xEkf(:,1),estimation.xEkf(:,2),'.r','MarkerSize', 10);hold on; plot(estimation.xTruth(:,1),estimation.xTruth(:,2),'.b', 'MarkerSize', 10);hold on; axis equal; grid on; drawnow; %movcount=movcount+1; %mov(movcount) = getframe(gcf);% アニメ┼ションのフレ┼ムをゲットする end end close finalPlot(estimation); end % control function u = robotControl(time) global endTime; T = 10; % sec Vx = 1.0; % m/s Vy = 0.2; % m/s yawrate = 5; % deg/s % half if time > (endTime/2) yawrate = -5; end u =[ Vx*(1-exp(-time/T)) Vy*(1-exp(-time/T)) degreeToRadian(yawrate)*(1-exp(-time/T))]'; end % all observations for function [z, xTruth, xOdom, u] = prepare(xTruth, xOdom, u) global noiseQ; global noiseR; % Ground Truth xTruth=doMotion(xTruth, u); % add Motion Noises u=u+noiseQ*randn(3,1); % Odometry Only xOdom=doMotion(xOdom, u); % add Observation Noises z=x+noiseR*randn(3,1); end % Motion Model function x = doMotion(x, u) global dt; %? end % Jacobian of Motion Model function jF = jacobF(x, u) global dt; %? end %Observation Model function x = doObservation(z, xPred) %? end %Jacobian of Observation Model function jH = jacobH(x) %? end % finally plot the results function []=finalPlot(estimation) figure; plot(estimation.GPS(:,1),estimation.GPS(:,2),'*m', 'MarkerSize', 5);hold on; plot(estimation.xEkf(:,1), estimation.xEkf(:,2),'.r','MarkerSize', 10); hold on; plot(estimation.xOdom(:,1), estimation.xOdom(:,2),'.k','MarkerSize', 10); hold on; plot(estimation.xTruth(:,1), estimation.xTruth(:,2),'.b','MarkerSize', 10); hold on; legend('GPS Observations','Odometry Only','EKF Localization', 'Ground Truth'); xlabel('X (meter)', 'fontsize', 12); ylabel('Y (meter)', 'fontsize', 12); grid on; axis equal; % calculate error % ? end function radian = degreeToRadian(degree) radian = degree/180*pi; end
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!