Skip to content

Commit

Permalink
added interface to get base position and orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegorbani committed Dec 6, 2023
1 parent c34dc3c commit 50d62e2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/IK/include/BiomechanicalAnalysis/IK/InverseKinematics.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class HumanIK
// Joint positions and velocities
Eigen::VectorXd m_jointPositions;
Eigen::VectorXd m_jointVelocities;
Eigen::Vector3d m_basePosition;
Eigen::Vector3d m_baseVelocity;
manif::SO3d m_baseOrientation;
Eigen::Vector3d m_baseAngularVelocity;

// Number of Joint Degrees of Freedom
int m_nrDoFs;
Expand Down Expand Up @@ -70,6 +74,18 @@ class HumanIK

// get the joint velocities
bool getJointVelocities(Eigen::Ref<Eigen::VectorXd> jointVelocities) const;

// get the base position
bool getBasePosition(Eigen::Ref<Eigen::Vector3d> basePosition) const;

// get the base velocity
bool getBaseVelocity(Eigen::Ref<Eigen::Vector3d> baseVelocity) const;

// get the base orientation
bool getBaseOrientation(manif::SO3d& baseOrientation) const;

// get the base angular velocity
bool getBaseAngularVelocity(Eigen::Ref<Eigen::Vector3d> baseAngularVelocity) const;
};

} // namespace IK
Expand Down
28 changes: 28 additions & 0 deletions src/IK/src/InverseKinematics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,31 @@ bool HumanIK::getJointVelocities(Eigen::Ref<Eigen::VectorXd> jointVelocities) co

return true;
}

bool HumanIK::getBasePosition(Eigen::Ref<Eigen::Vector3d> basePosition) const
{
basePosition = m_basePosition;

return true;
}

bool HumanIK::getBaseVelocity(Eigen::Ref<Eigen::Vector3d> baseVelocity) const
{
baseVelocity = m_baseVelocity;

return true;
}

bool HumanIK::getBaseOrientation(manif::SO3d& baseOrientation) const
{
baseOrientation = m_baseOrientation;

return true;
}

bool HumanIK::getBaseAngularVelocity(Eigen::Ref<Eigen::Vector3d> baseAngularVelocity) const
{
baseAngularVelocity = m_baseAngularVelocity;

return true;
}

0 comments on commit 50d62e2

Please sign in to comment.