add python ikine_LM
@@ -35,6 +35,8 @@ from frne import init, frne, delete
from numpy import any
from typing import Union, Tuple
+ArrayLike = Union[list, np.ndarray, tuple, set]
+
iksol = namedtuple("IKsolution", "q, success, reason")
@@ -855,7 +857,7 @@ class DHRobot(Robot):
return tw, T[-1]
- def ets(self, *args, **kwargs):
+ def ets(self, *args, **kwargs) -> ETS:
"""
Robot kinematics as an elemenary transform sequence
@@ -2318,7 +2320,9 @@ class DHRobot(Robot):
TODO
"""
- return self.ets().ik_nr(Tep, q0, ilimit, slimit, tol, reject_jl, we, use_pinv, pinv_damping)
+ return self.ets().ik_nr(
+ Tep, q0, ilimit, slimit, tol, reject_jl, we, use_pinv, pinv_damping
+ )
def ik_gn(
self,
@@ -2424,11 +2428,29 @@ class DHRobot(Robot):
TODO
"""
- return self.ets().ik_gn(Tep, q0, ilimit, slimit, tol, reject_jl, we, use_pinv, pinv_damping)
-
-
-
+ return self.ets().ik_gn(
+ Tep, q0, ilimit, slimit, tol, reject_jl, we, use_pinv, pinv_damping
+ )
+ def ikine_LM(
+ self,
+ Tep: Union[np.ndarray, SE3],
+ q0: Union[ArrayLike, None] = None,
+ ilimit: int = 30,
+ slimit: int = 100,
+ tol: float = 1e-6,
+ joint_limits: bool = True,
+ mask: Union[ArrayLike, None] = None,
+ ):
+ return self.ets().ikine_LM(
+ Tep=Tep,
+ q0=q0,
+ ilimit=ilimit,
+ slimit=slimit,
+ tol=tol,
+ joint_limits=joint_limits,
+ mask=mask,
+ )
class SerialLink(DHRobot):
