From f8f46ba903fd819793fd5db0f8f46b9f4bc2ae16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20=C5=81ukawski?= Date: Thu, 16 May 2019 21:03:35 +0200 Subject: [PATCH] Remove velocity check on MOVI (p. reverts 99ab1aa) https://github.com/roboticslab-uc3m/kinematics-dynamics/issues/173#issuecomment-493191279 --- .../BasicCartesianControl/ICartesianControlImpl.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libraries/YarpPlugins/BasicCartesianControl/ICartesianControlImpl.cpp b/libraries/YarpPlugins/BasicCartesianControl/ICartesianControlImpl.cpp index 6a65bbd2c..c52471d78 100644 --- a/libraries/YarpPlugins/BasicCartesianControl/ICartesianControlImpl.cpp +++ b/libraries/YarpPlugins/BasicCartesianControl/ICartesianControlImpl.cpp @@ -576,18 +576,16 @@ void roboticslab::BasicCartesianControl::movi(const std::vector &x) return; } - std::vector qdot(numRobotJoints); - - double interval = yarp::os::Time::now() - movementStartTime; + std::vector qdiff(numRobotJoints); for (int i = 0; i < numRobotJoints; i++) { - qdot[i] = (q[i] - currentQ[i]) / interval; + qdiff[i] = q[i] - currentQ[i]; } - if (!checkJointLimits(currentQ, qdot) || !checkJointVelocities(qdot)) + if (!checkJointLimits(currentQ, qdiff)) { - CD_ERROR("Joint position or velocity limits exceeded, not moving.\n"); + CD_ERROR("Joint position exceeded, not moving.\n"); return; } @@ -595,8 +593,6 @@ void roboticslab::BasicCartesianControl::movi(const std::vector &x) { CD_ERROR("setPositions failed.\n"); } - - movementStartTime = yarp::os::Time::now(); } // -----------------------------------------------------------------------------