Closed Nickick-ICRS closed 1 year ago
fyi @Giulero
Hi @Nickick-ICRS! Thanks for opening the issue :)
Yeah you're right. The problem is the wrong initialization of the quaternion in the transform_point
method:
The quaternion is initialized with a list. This is clearly wrong:
p.Qd = Quaternion([xyz[0], xyz[1], xyz[2], 0])
I will open a PR to fix this changing it to:
xyzw = cs.np.array([xyz[0], xyz[1], xyz[2], 0])
# xyzw = cs.vertcat(xyz[0], xyz[1], xyz[2], 0)
p.Qd = Quaternion(xyzw)
Thanks again for opening the issue!
Open PR #9.
PR merged. @Nickick-ICRS could you please test if the fix does the job? Thanks!
Works for me!
Hi,
In general, the DualQuaternion class is quite awkward to use (e.g. it would be clean to have a
from_SE3()
etc. constructor), however when working with casadi arrays, the identity and transform_point functions appear not to work?Example:
The error I get is:
NotImplementedError: Wrong number or type of arguments for overloaded function 'dot'. Possible prototypes are: dot(DM,DM) dot(SX,SX) dot(MX,MX) You have: '(SX,[SX])'
I've identified the problem is at line 200 in DualQuaternion.py (by extension also in line 188):
p.Qd.xyzw = [xyz[0], xyz[1], xyz[2], 0]
Changing this to
p.Qd.xyzw = cs.np.array([xyz[0], xyz[1], xyz[2], 0])
appears to solve the problem. I expect there are several other locations which may contain the same problem?If you can confirm that I'm using the library as expected then this is a bug, with a pretty trivial solution, no? Then I don't mind opening a PR with a bug fix.