|
4 | 4 | """
|
5 | 5 |
|
6 | 6 | from collections import namedtuple
|
| 7 | +from email import message |
7 | 8 | from roboticstoolbox.tools.data import rtb_path_to_datafile
|
8 | 9 | import warnings
|
9 | 10 | import copy
|
|
34 | 35 | from frne import init, frne, delete
|
35 | 36 | from numpy import any
|
36 | 37 | from typing import Union, Tuple
|
| 38 | +from roboticstoolbox.robot.IK import IKSolution |
37 | 39 |
|
38 | 40 | ArrayLike = Union[list, np.ndarray, tuple, set]
|
39 | 41 |
|
40 |
| -iksol = namedtuple("IKsolution", "q, success, reason") |
| 42 | +# iksol = namedtuple("IKsolution", "q, success, reason") |
41 | 43 |
|
42 | 44 |
|
43 | 45 | class DHRobot(Robot):
|
@@ -1835,21 +1837,22 @@ def ikine_6s(self, T, config, ikfunc):
|
1835 | 1837 | # Remove the link offset angles
|
1836 | 1838 | theta = theta - self.offset
|
1837 | 1839 |
|
1838 |
| - solution = iksol(theta, True, "") |
| 1840 | + # solution = iksol(theta, True, "") |
| 1841 | + solution = IKSolution(q=theta, success=True) |
1839 | 1842 |
|
1840 | 1843 | else:
|
1841 | 1844 | # ikfunc can return None or a str reason
|
1842 | 1845 | if theta is None:
|
1843 |
| - solution = iksol(None, False, "") |
| 1846 | + solution = IKSolution(q=None, success=False) |
1844 | 1847 | else:
|
1845 |
| - solution = iksol(None, False, theta) |
| 1848 | + solution = IKSolution(q=None, success=False, reason=theta) |
1846 | 1849 |
|
1847 | 1850 | solutions.append(solution)
|
1848 | 1851 |
|
1849 | 1852 | if len(T) == 1:
|
1850 | 1853 | return solutions[0]
|
1851 | 1854 | else:
|
1852 |
| - return iksol( |
| 1855 | + return IKSolution( |
1853 | 1856 | np.vstack([sol.q for sol in solutions]),
|
1854 | 1857 | np.array([sol.success for sol in solutions]),
|
1855 | 1858 | [sol.reason for sol in solutions],
|
|
0 commit comments