Verified Commit 46756995 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

geometry: make object implicitly_convertible

parent c96b9fb7
......@@ -22,6 +22,7 @@ namespace eigenpy
struct call< Eigen::AngleAxis<Scalar> >
{
typedef Eigen::AngleAxis<Scalar> AngleAxis;
static inline void expose()
{
AngleAxisVisitor<AngleAxis>::expose();
......@@ -46,6 +47,7 @@ namespace eigenpy
typedef typename AngleAxis::Matrix3 Matrix3;
typedef typename Eigen::Quaternion<Scalar,0> Quaternion;
typedef Eigen::RotationBase<AngleAxis,3> RotationBase;
public:
......@@ -136,6 +138,9 @@ namespace eigenpy
"AngleAxis representation of a rotation.\n\n",
bp::no_init)
.def(AngleAxisVisitor<AngleAxis>());
// Cast to Eigen::RotationBase and vice-versa
bp::implicitly_convertible<AngleAxis,RotationBase>();
}
};
......
......@@ -263,9 +263,11 @@ namespace eigenpy
"'q*v' (rotating 'v' by 'q'), "
"'q==q', 'q!=q', 'q[0..3]'.",
bp::no_init)
.def(QuaternionVisitor<Quaternion>())
;
.def(QuaternionVisitor<Quaternion>());
// Cast to Eigen::QuaternionBase and vice-versa
bp::implicitly_convertible<Quaternion,QuaternionBase >();
bp::implicitly_convertible<QuaternionBase,Quaternion >();
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment