10
10
import roboticstoolbox as rtb
11
11
from dataclasses import dataclass
12
12
from spatialmath import SE3
13
- from roboticstoolbox .tools .types import ArrayLike
13
+ from roboticstoolbox .tools .types import ArrayLike , NDArray
14
+
14
15
15
16
try :
16
17
import qpsolvers as qp
@@ -395,7 +396,7 @@ def error(self, Te: np.ndarray, Tep: np.ndarray) -> Tuple[np.ndarray, float]:
395
396
396
397
"""
397
398
e = rtb .angle_axis (Te , Tep )
398
- E = 0.5 * e @ self .We @ e
399
+ E = float ( 0.5 * e @ self .We @ e )
399
400
400
401
return e , E
401
402
@@ -503,7 +504,7 @@ def _check_jl(self, ets: "rtb.ETS", q: np.ndarray) -> bool:
503
504
return True
504
505
505
506
506
- def _null_Σ (ets : "rtb.ETS" , q : np . ndarray , ps : float , pi : Union [np . ndarray , float ]):
507
+ def _null_Σ (ets : "rtb.ETS" , q : NDArray , ps : float , pi : Union [NDArray , float ]):
507
508
"""
508
509
Formulates a relationship between joint limits and the joint velocity.
509
510
When this is projected into the null-space of the differential kinematics
@@ -518,7 +519,7 @@ def _null_Σ(ets: "rtb.ETS", q: np.ndarray, ps: float, pi: Union[np.ndarray, flo
518
519
:return: Σ
519
520
"""
520
521
521
- if isinstance (pi , float ):
522
+ if isinstance (pi , float ) or isinstance ( pi , int ) :
522
523
pi = pi * np .ones (ets .n )
523
524
524
525
# Add cost to going in the direction of joint limits, if they are within
@@ -1451,7 +1452,7 @@ def step(
1451
1452
e , E = self .error (Te , Tep )
1452
1453
J = ets .jacob0 (q )
1453
1454
1454
- if isinstance (self .pi , float ):
1455
+ if isinstance (self .pi , float ) or isinstance ( self . pi , int ) :
1455
1456
self .pi = self .pi * np .ones (ets .n )
1456
1457
1457
1458
# Quadratic component of objective function
0 commit comments