forked from Sarrasor/RoboticManipulators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjacobian_calculation.py
38 lines (30 loc) · 888 Bytes
/
jacobian_calculation.py
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
import sympy as sp
from utils.jacobians import JacobianCalculator
def main():
T_base = sp.eye(4)
T_tool = sp.eye(4)
variables = ['q_1', 'L_1', 'q_2', 'L_2']
indices = [1, 0, 1, 0]
sequence = "RzTxRzTx"
jc = JacobianCalculator(sequence,
indices,
variables=variables,
T_base=T_base,
T_tool=T_tool,
f_of_t=False,
simplify=True)
J_num = jc.calculate_numeric()
J_skew = jc.calculate_scew()
print("Numeric Jacobian calculation:")
print()
sp.pprint(J_num)
print()
print("Scew Jacobian calculation:")
print()
sp.pprint(J_skew)
print()
print("Difference between methods:")
print()
sp.pprint(J_skew - J_num)
if __name__ == '__main__':
main()