@@ -119,38 +119,64 @@ def qs(j, link):
119
119
120
120
def angle (theta ):
121
121
if sym .issymbol (theta ):
122
- return "<<red>>" + str (L . alpha )
122
+ return "<<red>>" + str (theta )
123
123
else :
124
- str (L . alpha * deg ) + "\u00b0 "
124
+ return str (theta * deg ) + "\u00b0 "
125
125
126
+ has_qlim = any ([link ._qlim is not None for link in self ])
127
+ if has_qlim :
128
+ qlim_columns = [
129
+ Column ("q⁻" , headalign = "^" ), Column ("q⁺" , headalign = "^" ),
130
+ ]
131
+ qlim = self .qlim
132
+
133
+ else :
134
+ qlim_columns = []
126
135
if self .mdh :
136
+ # MDH format
127
137
table = ANSITable (
128
138
Column ("aⱼ₋₁" , headalign = "^" ),
129
139
Column ("⍺ⱼ₋₁" , headalign = "^" ),
130
140
Column ("θⱼ" , headalign = "^" ),
131
141
Column ("dⱼ" , headalign = "^" ),
142
+ * qlim_columns ,
132
143
border = "thick"
133
144
)
134
145
for j , L in enumerate (self ):
146
+ if has_qlim :
147
+ if L .isprismatic ():
148
+ ql = [qlim [0 , j ], qlim [1 , j ]]
149
+ else :
150
+ ql = [angle (qlim [k , j ]) for k in [0 , 1 ]]
151
+ else :
152
+ ql = []
135
153
if L .isprismatic ():
136
- table .row (L .a , angle (L .alpha ), angle (L .theta ), qs (j , L ))
154
+ table .row (L .a , angle (L .alpha ), angle (L .theta ), qs (j , L ), * ql )
137
155
else :
138
- table .row (L .a , angle (L .alpha ), qs (j , L ), L .d )
156
+ table .row (L .a , angle (L .alpha ), qs (j , L ), L .d , * ql )
139
157
else :
140
158
# DH format
141
159
table = ANSITable (
142
160
Column ("θⱼ" , headalign = "^" , colalign = "<" ),
143
161
Column ("dⱼ" , headalign = "^" ),
144
162
Column ("aⱼ" , headalign = "^" ),
145
163
Column ("⍺ⱼ" , headalign = "^" ),
164
+ * qlim_columns ,
146
165
border = "thick"
147
166
)
148
167
for j , L in enumerate (self ):
168
+ if has_qlim :
169
+ if L .isprismatic ():
170
+ ql = [qlim [0 , j ], qlim [1 , j ]]
171
+ else :
172
+ ql = [angle (qlim [k , j ]) for k in [0 , 1 ]]
173
+ else :
174
+ ql = []
149
175
if L .isprismatic ():
150
176
table .row (
151
- angle (L .theta ), qs (j , L ), L .a , angle (L .alpha * deg ) )
177
+ angle (L .theta ), qs (j , L ), L .a , angle (L .alpha ), * ql )
152
178
else :
153
- table .row (qs (j , L ), L .d , L .a , angle (L .alpha ))
179
+ table .row (qs (j , L ), L .d , L .a , angle (L .alpha ), * ql )
154
180
155
181
s = str (table )
156
182
@@ -2515,12 +2541,13 @@ def __init__(self, *args, **kwargs):
2515
2541
import roboticstoolbox as rtb
2516
2542
# import spatialmath.base.symbolic as sym
2517
2543
2518
- puma = rtb .models .DH .Planar2 ()
2544
+ planar = rtb .models .DH .Planar2 ()
2519
2545
# J = puma.jacob0(puma.qn)
2520
2546
# print(J)
2521
2547
# print(puma.manipulability(puma.qn))
2522
2548
# print(puma.manipulability(puma.qn, 'asada'))
2523
2549
#tw, T0 = puma.twists(puma.qz)
2524
- print (puma .qlim )
2525
- print (puma [0 ].qlim )
2526
- print (puma .islimit ([0 , - 5 ]))
2550
+ print (planar )
2551
+
2552
+ puma = rtb .models .DH .Puma560 ()
2553
+ print (puma )
0 commit comments