Update the way to compute the Jacobian

This commit is contained in:
Thomas Dehaeze 2018-06-06 17:55:00 +02:00
parent b853bf4a95
commit dcae695e55
2 changed files with 31 additions and 16 deletions

28
.gitignore vendored
View File

@ -1,2 +1,28 @@
*.autosave
# Windows default autosave extension
*.asv
# OSX / *nix default autosave extension
*.m~
# Compiled MEX binaries (all platforms)
*.mex*
# Packaged app and toolbox files
*.mlappinstall
*.mltbx
# Generated helpsearch folders
helpsearch*/
# Simulink code generation folders
slprj/
sccprj/
# Simulink autosave extension
*.autosave
# Octave session info
octave-workspace
# Custom
stewart_displacement_grt_rtw/

View File

@ -1,18 +1,7 @@
function J = getJacobianMatrix(RM,M_pos_base)
% RM: [3x6] unit vector of each leg in the fixed frame
% M_pos_base: [3x6] vector of the leg connection at the top platform location in the fixed frame
J = zeros(6);
J(:, 1:3) = RM;
for i = 1:6
J(i, 4:6) = -RM(i, :)*getCrossProductMatrix(M_pos_base(i, :));
end
function M = getCrossProductMatrix(v)
M = zeros(3);
M(1, 2) = -v(3);
M(1, 3) = v(2);
M(2, 3) = -v(1);
M(2, 1) = -M(1, 2);
M(3, 1) = -M(1, 3);
M(3, 2) = -M(2, 3);
end
J(:, 1:3) = RM';
J(:, 4:6) = cross(M_pos_base, RM)';
end