Skip to content

Commit

Permalink
checking if tasks are initialized in update methods
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegorbani committed Oct 4, 2024
1 parent b518238 commit 6382103
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/IK/src/InverseKinematics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,24 @@ bool HumanIK::updateFloorContactTask(const int node, const double verticalForce)

bool HumanIK::updateJointRegularizationTask()
{
// check if the joint regularization task is initialized
if (m_jointRegularizationTask == nullptr)
{
BiomechanicalAnalysis::log()->error("[HumanIK::updateJointRegularizationTask] Joint regularization task not initialized.");
return false;
}
// Set the set point of the joint regularization task to a zero vector of size m_nrDoFs
return m_jointRegularizationTask->setSetPoint(Eigen::VectorXd::Zero(m_nrDoFs));
}

bool HumanIK::updateJointConstraintsTask()
{
// check if the joint constraints task is initialized
if (m_jointConstraintsTask == nullptr)
{
BiomechanicalAnalysis::log()->error("[HumanIK::updateJointConstraintsTask] Joint constraints task not initialized.");
return false;
}
// Update the joint constraints task
return m_jointConstraintsTask->update();
}
Expand Down

0 comments on commit 6382103

Please sign in to comment.