From f684af15bef3bd583c12a9547f61aa83a1af0ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20=C5=81ukawski?= Date: Mon, 11 Mar 2019 13:13:46 +0100 Subject: [PATCH] Avoid calling IPositionDirect::getRefPositions https://github.com/roboticslab-uc3m/kinematics-dynamics/issues/173#issuecomment-471514383 --- .../BasicCartesianControl/ICartesianControlImpl.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libraries/YarpPlugins/BasicCartesianControl/ICartesianControlImpl.cpp b/libraries/YarpPlugins/BasicCartesianControl/ICartesianControlImpl.cpp index 15709bf00..4db721f52 100644 --- a/libraries/YarpPlugins/BasicCartesianControl/ICartesianControlImpl.cpp +++ b/libraries/YarpPlugins/BasicCartesianControl/ICartesianControlImpl.cpp @@ -588,19 +588,11 @@ void roboticslab::BasicCartesianControl::movi(const std::vector &x) return; } - std::vector qRef(numRobotJoints); - - if (!iPositionDirect->getRefPositions(qRef.data())) - { - CD_ERROR("getRefPositions failed.\n"); - return; - } - std::vector qd(numRobotJoints); for (int i = 0; i < numRobotJoints; i++) { - qd[i] = q[i] - qRef[i]; + qd[i] = q[i] - currentQ[i]; } if (!checkJointLimits(currentQ, qd))