Skip to content

Commit

Permalink
added Logging in HumanIK
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegorbani committed Dec 14, 2023
1 parent 29498db commit ddb3095
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: |
echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
# Use mamba for Windows dependencies
# Use mamba for dependencies
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci_env.yml
Expand Down
1 change: 1 addition & 0 deletions src/IK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ add_biomechanical_analysis_library(
PUBLIC_HEADERS include/BiomechanicalAnalysis/IK/InverseKinematics.h
SOURCES src/InverseKinematics.cpp
PUBLIC_LINK_LIBRARIES BipedalLocomotion::IK BipedalLocomotion::ParametersHandler
PRIVATE_LINK_LIBRARIES BiomechanicalAnalysis::Logging
SUBDIRECTORIES tests)
8 changes: 4 additions & 4 deletions src/IK/src/InverseKinematics.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <BiomechanicalAnalysis/IK/InverseKinematics.h>
#include <BiomechanicalAnalysis/Logging/Logger.h>
#include <iostream>

using namespace BiomechanicalAnalysis::IK;
Expand All @@ -9,16 +10,15 @@ bool HumanIK::initialize(std::weak_ptr<const BipedalLocomotion::ParametersHandle
{
constexpr std::size_t highPriority = 0;
constexpr std::size_t lowPriority = 1;
constexpr auto logPrefix = "[HumanIK::initialize]";

m_jointPositions.resize(kinDyn->getNrOfDegreesOfFreedom());
m_jointVelocities.resize(kinDyn->getNrOfDegreesOfFreedom());

std::cout << "nr of dofs = " << kinDyn->getNrOfDegreesOfFreedom() << std::endl;

auto ptr = handler.lock();
if (ptr == nullptr)
{
std::cerr << "[HumanIK::initialize] Invalid parameter handler." << std::endl;
BiomechanicalAnalysis::log()->error("{} parameters handler is a null pointer.", logPrefix);
return false;
}

Expand All @@ -35,7 +35,7 @@ bool HumanIK::initialize(std::weak_ptr<const BipedalLocomotion::ParametersHandle

m_qpIK.finalize(m_variableHandler);

return true;
return ok;
}

bool HumanIK::setDt(const double dt)
Expand Down

0 comments on commit ddb3095

Please sign in to comment.