diff --git a/bindings/python/python.i b/bindings/python/python.i index 333c3f18d94..1e5033fec73 100644 --- a/bindings/python/python.i +++ b/bindings/python/python.i @@ -326,6 +326,13 @@ import_array(); return iDynTree::RotationRaw(in, static_cast(i), static_cast(j)); } + + Rotation(const double* in_data, const std::ptrdiff_t in_rows, const std::ptrdiff_t in_cols) { + iDynTree::Rotation* rot = new iDynTree::Rotation(iDynTree::RotationRaw(in_data, + static_cast(in_rows), + static_cast(in_cols))); + return rot; + } }; %extend iDynTree::Position { @@ -335,8 +342,29 @@ import_array(); return iDynTree::PositionRaw(in, static_cast(size)); } + + Position(const double* in_data, const unsigned in_size) { + iDynTree::Position* pos = new iDynTree::Position(iDynTree::PositionRaw(in_data, in_size)); + return pos; + } }; +%extend iDynTree::Transform { + + void setPosition(const double* in_data, const unsigned in_size) { + $self->setPosition(iDynTree::PositionRaw(in_data, static_cast(in_size))); + } + + void setRotation(const double* in_data, + const std::ptrdiff_t in_rows, + const std::ptrdiff_t in_cols) { + $self->setRotation(iDynTree::RotationRaw(in_data, + static_cast(in_rows), + static_cast(in_cols))); + } +}; + + %attributeref(iDynTree::FreeFloatingPos, iDynTree::Transform&, worldBasePos) %attributeref(iDynTree::FreeFloatingPos, iDynTree::JointPosDoubleArray&, jointPos) %attributeref(iDynTree::FreeFloatingVel, iDynTree::Twist&, baseVel)