Effacer les filtres
Effacer les filtres

Forward Kinematics and Reverse Kinematics

1 vue (au cours des 30 derniers jours)
Ken
Ken le 25 Sep 2016
Commenté : Walter Roberson le 25 Sep 2016
In Robotics F.K. we have A*Si = B*phi where A, B are known matrices, Si is a vector with x, y and z as its elements, phi is the vector containing the angular velocity of each of the 2 wheels of the robot. MATLAB says that an eqn of the form Ax=B can be solved by A\B. I am not sure if this applies in my case i.e. A*Si = B*phi. This I know has been solved and I was told that A\B is the way to do it but does not work for me. Similarly I am stuck on the R.K. case. Please help

Réponse acceptée

John D'Errico
John D'Errico le 25 Sep 2016
Modifié(e) : John D'Errico le 25 Sep 2016
So A & B are known matrices. Si is a known vector.
OF COURSE IT APPLIES!
What A*Si? A known vector. Call it b.
So then you have a problem of the form
B*phi = v
Can you solve that using backslash? Yes. B is known. v is known.
Look at the equation. How do you solve it? Substitute variables.
  3 commentaires
John D'Errico
John D'Errico le 25 Sep 2016
Modifié(e) : John D'Errico le 25 Sep 2016
It looks like you have an error in your equations. You give two different equations for R. I picked 0.5 for gamma. By the way, for your own good, please don't use gamma as the name of a variable. It will cause you a great deal of hell in the future, when you might need to use the function gamma. In general, don't use variable names that are the same as that of existing functions.
I picked a gamma of 0.5, then tried to test out your code.
J = @(gamma) [1,0,0; cos(gamma), sin(gamma), sin(gamma)];
C = @(gamma) [ 0, 1, 0; -sin(gamma), cos(gamma), cos(gamma)];
A = @(gamma) [J(gamma);C(gamma)];
A(.5)
ans =
1 0 0
0.87758 0.47943 0.47943
0 1 0
-0.47943 0.87758 0.87758
B = [0.3,0;0,0.3;0,0;0,0];
F = @(gamma) [.15, .15*cos(gamma) ; 0 , .15*cos(gamma);0 ,.3*sin(gamma)];
F(.5)
ans =
0.15 0.13164
0 0.13164
0 0.14383
R=B\A(.5)
R =
3.3333 0 0
2.9253 1.5981 1.5981
R = @(gamma) [10/3 ,0, 0; -(10/3)*cos(gamma), -(10/3)*sin(gamma) ,(5/3)*sin(gamma)];
R(.5)
ans =
3.3333 0 0
-2.9253 -1.5981 0.79904
So you see that the two formulas for R give different values for the second row of R. Check your equations carefully, as you have a mistake there.
Walter Roberson
Walter Roberson le 25 Sep 2016
In your code you have
F = @(gamma) [[.15, .15*cos(gamma) ;
0 , .15*cos(gamma);
0 ,.3*sin(gamma)];
That starts with two '[' but ends in only one, so MATLAB thinks the array is still being formed.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Robotics System Toolbox dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by