-
Notifications
You must be signed in to change notification settings - Fork 542
Description
Check here first
Common issues
No related issue was found here.
Describe the bug
Forward kinematics in custom ERobot in version > 1.0.0 now is forced (with try / except) to pass through the Cpp function ETS_fkine
But ETS_fkine does not handle the q parameter as its pythonic fkine does in versions < 1.0 and outputs wrong results when sequence of q is passed.
For example, creating this simple robot in v1.0.2:
import roboticstoolbox as rtb
import numpy as np
robot = rtb.ERobot(
[
rtb.Link(rtb.ET.tz()),
rtb.Link(rtb.ET.tx())
]
)
traj = np.array([[0,0],[0,1]])
print(robot.fkine(q=traj))
Gives us the wrong fkine:
0:
1 0 1 0
0 1 0 1
0 0 0 1
0 0 0 0
1:
0 0 0 0
0 0 0 0
1 0 1 0
0 1 0 1
Following the fkine docstring, that states "Trajectory operation: If q has multiple rows (mxn), it is considered a trajectory and the result is an SE3 instance with m values.", we would expect two SE(3) as a response for the two translations in traj, the first with z=0, x=0 and the second with z=0, x=1, or:
0:
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
1:
1 0 0 1
0 1 0 0
0 0 1 0
0 0 0 1
The above result is indeed what we get in v0.11.0 with fkine argument fast=False as well as by cloning the bleeding-edge version from commit 07ad125 and putting back on the fast argument so it can skip the ETS_fkine function (which I guess is the fastest workaround for now)
Version information
v1.0.2 and v0.11.0 installed from PyPI
commit 07ad125 from GitHub
Environment (please complete the following information):
- Windows 11 10.0.22621 Build 22621
- Conda version 22.9.0
- Python 3.10.8
Env created with
conda create -n rtb python=3.10.8
pip install roboticstoolbox-python