gtsam/matlab/+gtsam/plotCamera.m

21 lines
458 B
Matlab
Raw Normal View History

2012-06-05 13:15:26 +08:00
function plotCamera(pose, axisLength)
2015-01-23 00:24:43 +08:00
hold on
2020-08-18 02:37:12 +08:00
C = pose.translation();
2012-06-05 13:15:26 +08:00
R = pose.rotation().matrix();
xAxis = C+R(:,1)*axisLength;
L = [C xAxis]';
h_x = line(L(:,1),L(:,2),L(:,3),'Color','r');
2012-06-05 13:15:26 +08:00
yAxis = C+R(:,2)*axisLength;
L = [C yAxis]';
h_y = line(L(:,1),L(:,2),L(:,3),'Color','g');
2012-06-05 13:15:26 +08:00
zAxis = C+R(:,3)*axisLength;
L = [C zAxis]';
h_z = line(L(:,1),L(:,2),L(:,3),'Color','b');
2012-06-05 13:15:26 +08:00
axis equal
end