Question 4:
>> R = [0.1729 -0.1468 0.9739 ; 0.9739 0.1729 -0.1468 ; -0.1468 0.9739 0.1729]
R =
0.1729 -0.1468 0.9739
0.9739 0.1729 -0.1468
-0.1468 0.9739 0.1729
>> eig(R)
ans =
-0.2406 + 0.9706i
-0.2406 - 0.9706i
1.0000
>>
>> [V, D] = eig(R)
V =
-0.2887 + 0.5000i -0.2887 - 0.5000i 0.5774
0.5774 0.5774 0.5774
-0.2887 - 0.5000i -0.2887 + 0.5000i 0.5774
D =
-0.2406 + 0.9706i 0 0
0 -0.2406 - 0.9706i 0
0 0 1.0000
The Eigenvector is a unit vector, around which the rotation happens.
Question 5:
Here is the matlab code to simulate:
function [ x, y, theta ] = diffDrive(x0, y0, theta0, v, omega, t, delta)
%diffDrive simulates the movement of a differential driving robot
x = zeros([1, t])
y = zeros([1, t])
theta = zeros([1, t])
for i = 1 : t
if i==1
x(1) = x0 + (v * cos(theta0) * delta)
y(1) = y0 + (v * sin(theta0) * delta)
theta(1) = theta0 + omega * delta
else
x(i) = x(i-1) + (v * cos(theta(i-1)) * delta)
y(i) = y(i-1) + (v * sin(theta(i-1)) * delta)
theta(i) = theta(i-1) + omega*delta
end
end
plot(x , y)
end
How is the path affected by the choice of δt?
As you can see , increasing the delta, reduces the detail of the plotted image:
To make this image I used: diffDrive(100, 50, 45, 1, 2, 10, 0.5)
To make this image I used: diffDrive(100, 50, 45, 1, 2, 100, 0.25)
To make this image I used: diffDrive(100, 50, 45, 1, 2, 100, 0.5)