23
23
T = SE3 (0.7 , 0.2 , 0.1 ) * SE3 .OA ([0 , 1 , 0 ], [0 , 0 , - 1 ])
24
24
q0 = robot .qz
25
25
26
+
26
27
# build the list of IK methods to test
27
28
# it's a tuple:
28
29
# - the method to execute
44
45
(lambda T , q0 : robot .ikine_min (T , q0 , qlim = True ), #numerical solution with constraints
45
46
"ikine_min(qlim=True)" ,
46
47
"sol = robot.ikine_min(T, q0, qlim=True)"
47
- )
48
+ ),
49
+ # (robot.ikine_mmc, #numerical solution with no constraints
50
+ # "ikine_min(qlim=False)",
51
+ # "sol = robot.ikine_min(T, q0)"
52
+ # ),
48
53
]
49
54
if hasattr (robot , "ikine_a" ):
50
55
a = (robot .ikine_a , # analytic solution
61
66
62
67
# setup results table
63
68
table = ANSITable (
64
- Column ("Operation" , headalign = "^" ),
65
- Column ("Time (μs )" , headalign = "^" , fmt = "{:.2f }" ),
69
+ Column ("Operation" , headalign = "^" , colalign = '<' ),
70
+ Column ("Time (ms )" , headalign = "^" , fmt = "{:.2g }" ),
66
71
Column ("Error" , headalign = "^" , fmt = "{:.3g}" ),
67
72
border = "thick" )
68
73
91
96
t = 0
92
97
93
98
# add it to the output table
94
- table .row (ik [1 ], t / N * 1e6 , err )
99
+ table .row (f"` { ik [1 ]} `" , t / N * 1e3 , err )
95
100
96
101
# pretty print the results
97
102
table .print ()
103
+ print (table .markdown ())
0 commit comments