Kinematics for Rovio
Define the geometry of the robot
In [15]:
w =
8.6603e-01 8.6603e-01 6.1232e-17
5.0000e-01 -5.0000e-01 1.0000e+00
warning: legend: ignoring extra labels
# wheel are at angles of 120deg
alpha(1)=pi/6;
alpha(2)=-pi/6;
alpha(3)=pi/2;
# “w” defines the rotation direction of the wheels
w=[];
for (i=1:3)
w(1,i)=cos(alpha(i));
w(2,i)=sin(alpha(i));
end;
w
# plot it nicely
cmap=colormap(eye(3));
hold on;
for (i=1:3)
plot([0 w(1,i)],[0 w(2,i)],’Color’,cmap(i,:),’LineWidth’,3);
end;
h=legend(‘$\vec{w_1}$’,’$\vec{w_2}$’,’$\vec{w_3}$’,’$\vec{d}$’);
set(h,’Interpreter’,’latex’);
set(gca,’DataAspectRatio’,[1 1 1]);
Inverse Kinematics for linear (omnidirectional) motion
of Rovio
Now let’s define the inverse kinematics.
v is the desired forward velocity
delta is the desired direction of travel
d is the resulting velocity vector (in the direction of travel)
omega is the resulting three-dimensional vector of angular velocities for the wheels
In [18]:
d =
0.70711
0.70711
omega =
0.96593 0.25882 0.70711
%desired velocity
v=1;
%desired direction
#delta=pi/3; % 60 degrees
delta=pi/4; % 45 degrees
#delta=0; % 0 degrees
%desired velocity vector
d=[cos(delta);sin(delta)] * v
for (i=1:3)
omega(i)=w(:,i)’*d;
end;
%obtained wheel speeds
omega
% below is all plotting
cmap=colormap(eye(3));
hold on;
cmap=colormap(eye(3));
hold on;
for (i=1:3)
plot([0 w(1,i)],[0 w(2,i)],’Color’,cmap(i,:), ‘LineWidth’,3)
end;
plot([0 d(1,1)],[0 d(2,1)],’c’,’LineWidth’,5)
h=legend(‘$\vec{w_1}$’,’$\vec{w_2}$’,’$\vec{w_3}$’,’$\vec{d}$’);
set(h,’Interpreter’,’latex’)
set(gca,’DataAspectRatio’,[1 1 1]);
figure
bar(1:3,omega’)
In [ ]: