From 7cc9b4a5365e6cf329709f1e5b8b5030f4e6f5aa Mon Sep 17 00:00:00 2001 From: Patrick Dormanns <patrick.dormanns@student.kit.edu> Date: Mon, 26 Feb 2024 00:09:26 +0100 Subject: [PATCH] set logging tag --- .../armarx/control/pointing/core/Pointing.cpp | 37 ++++++++++--------- .../armarx/control/pointing/core/Pointing.h | 8 ++-- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/source/armarx/control/pointing/core/Pointing.cpp b/source/armarx/control/pointing/core/Pointing.cpp index 2cf69328..f59d0aaa 100644 --- a/source/armarx/control/pointing/core/Pointing.cpp +++ b/source/armarx/control/pointing/core/Pointing.cpp @@ -14,6 +14,7 @@ namespace armarx::control::pointing::core { Pointing::Pointing(const Remote& remote) : remote_(remote) { + setTag("Pointing"); } void @@ -38,7 +39,7 @@ namespace armarx::control::pointing::core if (params.handShape) { - auto shapeJointValues = GetShapeJointValues(robot, params.side, *params.handShape); + auto shapeJointValues = getShapeJointValues(robot, params.side, *params.handShape); addHandTrajectory(robot, traj, shapeJointValues); } @@ -129,6 +130,23 @@ namespace armarx::control::pointing::core }); } + std::map<std::string, float> + Pointing::getShapeJointValues(VirtualRobot::RobotPtr robot, + Side side, + const std::string& shapeName) + { + auto eefName = std::string("Hand_") + (side == Side::LEFT ? "L" : "R") + "_EEF"; // TODO + auto eef = robot->getEndEffector(eefName); + + auto shape = eef->getPreshape(shapeName); + if (not shape) + { + ARMARX_ERROR << "Hand '" << eefName << "' has no shape '" << shape << "'"; + throw armarx::exceptions::local::PointingFailedException(); + } + return shape->getRobotNodeJointValueMap(); + } + void Pointing::addHandTrajectory(VirtualRobot::RobotPtr robot, armarx::TrajectoryPtr traj, @@ -167,21 +185,4 @@ namespace armarx::control::pointing::core ARMARX_INFO << "Pointing target reached"; } - std::map<std::string, float> - Pointing::GetShapeJointValues(VirtualRobot::RobotPtr robot, - Side side, - const std::string& shapeName) - { - auto eefName = std::string("Hand_") + (side == Side::LEFT ? "L" : "R") + "_EEF"; // TODO - auto eef = robot->getEndEffector(eefName); - - auto shape = eef->getPreshape(shapeName); - if (not shape) - { - ARMARX_ERROR << "Hand '" << eefName << "' has no shape '" << shape << "'"; - throw armarx::exceptions::local::PointingFailedException(); - } - return shape->getRobotNodeJointValueMap(); - } - } // namespace armarx::control::pointing::core diff --git a/source/armarx/control/pointing/core/Pointing.h b/source/armarx/control/pointing/core/Pointing.h index 0de3de67..8c50238e 100644 --- a/source/armarx/control/pointing/core/Pointing.h +++ b/source/armarx/control/pointing/core/Pointing.h @@ -36,7 +36,7 @@ namespace armarx::control::pointing::core * * @ingroup Library-pointing */ - class Pointing + class Pointing : virtual public armarx::Logging { public: struct Remote @@ -100,15 +100,15 @@ namespace armarx::control::pointing::core void addWristTrajectory(VirtualRobot::RobotPtr robot, Side side, armarx::TrajectoryPtr traj); + std::map<std::string, float> + getShapeJointValues(VirtualRobot::RobotPtr robot, Side side, const std::string& shapeName); + void addHandTrajectory(VirtualRobot::RobotPtr robot, armarx::TrajectoryPtr traj, const std::map<std::string, float>& shapeJointValues); void playTrajectory(armarx::TrajectoryPtr traj); - static std::map<std::string, float> - GetShapeJointValues(VirtualRobot::RobotPtr robot, Side side, const std::string& shapeName); - private: Remote remote_; std::atomic_bool aborted; -- GitLab