-
Notifications
You must be signed in to change notification settings - Fork 7
/
rec_solver_6_DOF.m
64 lines (48 loc) · 1.81 KB
/
rec_solver_6_DOF.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
function rec_solver_6_DOF(is_intersecting, is_intersecting_nonconsecutive, is_parallel, is_spherical)
% Recommend 6-DOF solvers given detected intersecting / parallel axes
if any(is_spherical)
fprintf("Spherical joint: Closed-form solutions exist\n")
end
if any([is_parallel 0 ] + [0 is_parallel] > 1)
fprintf("Three parallel axes: Closed-form solutions exist\n")
end
if any(is_intersecting)
fprintf("Intersecting axes: 1D search solutions exist\n")
end
if any(is_intersecting_nonconsecutive)
fprintf("Nonconsecutive intersecting axes: 1D search solutions exist\n")
end
if any(is_parallel)
fprintf("Parallel axes: 1D search solutions exist\n")
end
fprintf("\nCompatible solvers:\n")
if is_spherical(4) && is_intersecting(1)
fprintf("IK_spherical_2_intersecting (Closed-Form Quadratic)\n")
end
if is_spherical(4) && is_parallel(2)
fprintf("IK_spherical_2_parallel (Closed-Form Quadratic)\n")
end
if is_parallel(2) && is_parallel(3) && is_intersecting(5)
fprintf("IK_3_parallel_2_intersecting (Closed Form Quadratic)\n")
end
if is_spherical(4)
fprintf("IK_spherical (Closed-Form Quartic)\n")
end
if is_parallel(2) && is_parallel(3)
fprintf("IK_3_parallel (Closed-Form Quartic)\n")
end
if is_intersecting(5)
fprintf("IK_2_intersecting (1D Search)\n")
end
if is_parallel(2)
fprintf("IK_2_parallel (1D Search)\n")
end
if is_intersecting_nonconsecutive(4)
fprintf("IK_4_6_intersecting (1D Search)\n")
end
if is_intersecting(1) && is_intersecting(3) && is_intersecting(5)
fprintf("IK_3_pairs_intersecting (1D Search)\n")
end
% Always possible
fprintf("IK_gen_6_dof (2D Search)\n")
end