Skip to content

quaternion.toRotationMatrix() does not work #94

@gabrielebndn

Description

@gabrielebndn

These lines

import eigenpy
q = eigenpy.Quaternion(1.,0.,0.,0.)
q.toRotationMatrix()

result in the following error

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-676a92d9f600> in <module>()
----> 1 q.toRotationMatrix()

AttributeError: 'Quaternion' object has no attribute 'toRotationMatrix'

I do not understand this, as I can clearly see in https://github.com/gabrielebndn/eigenpy/blob/72f57d877e2b9fb7b0d2d216ce947ad62073286f/include/eigenpy/quaternion.hpp#L106 that toRotationMatrix is exposed, correctly, it seems.
What is weirder is that ipython actually suggests toRotationMatrix as an available method and auto-completes it, but then it gives an error as if it did not know it if you actually try to use it. What is going on?

This is not super-important as the same functionality is provided by the method matrix(). The duplication comes from Eigen itself. The methods are inherited from RotationBase, where the documentation seems to suggest that the preferred method should be toRotationMatrix, while matrix was only "added to be conform with the Transform class' naming scheme." Further, in QuaternionBase only toRotationMatrix is documented

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions