Skip to content

Commit

Permalink
fix quaterion bindings for change_fixed_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
evelyd committed Jun 23, 2024
1 parent 0a36ffb commit cedbfe8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void CreateLeggedOdometry(pybind11::module& module)
py::arg("frame_index"))
.def("change_fixed_frame",
py::overload_cast<const std::ptrdiff_t&,
const Eigen::Quaterniond&,
const Eigen::Vector4d&,
const Eigen::Vector3d&>(&LeggedOdometry::changeFixedFrame),
py::arg("frame_index"),
py::arg("frame_orientation_in_world"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class LeggedOdometry : public FloatingBaseEstimator
* @note ensure to pass unit quaternion
*/
bool changeFixedFrame(const std::ptrdiff_t& frameIndex,
const Eigen::Quaterniond& frameOrientationInWorld,
const Eigen::Vector4d& frameOrientationInWorld,
const Eigen::Vector3d& framePositionInWorld);

/**
Expand Down
7 changes: 5 additions & 2 deletions src/Estimators/src/LeggedOdometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ bool LeggedOdometry::Impl::changeFixedFrame(const iDynTree::FrameIndex& newIdx,


bool LeggedOdometry::changeFixedFrame(const std::ptrdiff_t& newIdx,
const Eigen::Quaterniond& frameOrientationInWorld,
const Eigen::Vector4d& frameOrientationInWorld,
const Eigen::Vector3d& framePositionInWorld)
{
const std::string_view printPrefix = "[LeggedOdometry::changeFixedFrame] ";
Expand All @@ -929,7 +929,10 @@ bool LeggedOdometry::changeFixedFrame(const std::ptrdiff_t& newIdx,
return false;
}

m_pimpl->m_world_H_fixedFrame.quat(frameOrientationInWorld);
Eigen::Quaterniond frameOrientationInWorldQ(frameOrientationInWorld);

m_pimpl->m_world_H_fixedFrame.quat(frameOrientationInWorldQ);

m_pimpl->m_world_H_fixedFrame.translation(framePositionInWorld);
m_pimpl->m_currentFixedFrameIdx = newIdx;

Expand Down

0 comments on commit cedbfe8

Please sign in to comment.