From ddb309500519f2813debfefefac87495c92f0174 Mon Sep 17 00:00:00 2001 From: Davide Date: Thu, 14 Dec 2023 14:46:36 +0100 Subject: [PATCH] added Logging in HumanIK --- .github/workflows/ci.yml | 2 +- src/IK/CMakeLists.txt | 1 + src/IK/src/InverseKinematics.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1c81e1..f76cbc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/src/IK/CMakeLists.txt b/src/IK/CMakeLists.txt index 956a323..edb3f9e 100644 --- a/src/IK/CMakeLists.txt +++ b/src/IK/CMakeLists.txt @@ -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) diff --git a/src/IK/src/InverseKinematics.cpp b/src/IK/src/InverseKinematics.cpp index 9e0e91d..e07d87a 100644 --- a/src/IK/src/InverseKinematics.cpp +++ b/src/IK/src/InverseKinematics.cpp @@ -1,4 +1,5 @@ #include +#include #include using namespace BiomechanicalAnalysis::IK; @@ -9,16 +10,15 @@ bool HumanIK::initialize(std::weak_ptrgetNrOfDegreesOfFreedom()); 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; } @@ -35,7 +35,7 @@ bool HumanIK::initialize(std::weak_ptr