实现转换传感器数据、将传感器数据从小车坐标系转换到世界坐标系
%% START CODE BLOCK %%
% Apply the transformation to robot frame.
ir_distances_rf = zeros(3,n_sensors);
for i=1:n_sensors
x_s = obj.sensor_placement(1,i);
y_s = obj.sensor_placement(2,i);
theta_s = obj.sensor_placement(3,i);
R = obj.get_transformation_matrix(x_s,y_s,theta_s);
ir_distances_rf(:,i) = R*[ir_distances(i); 0; 1];
end
% Apply the transformation to world frame.
[x,y,theta] = state_estimate.unpack();
R = obj.get_transformation_matrix(x,y,theta);
ir_distances_wf = R*ir_distances_rf;
ir_distances_wf = ir_distances_wf(1:2,:);
%% END CODE BLOCK %%
然后在