From 5a17b162ccc37687b1f7843c1e42896c9e0c6b42 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 4 Mar 2020 16:51:31 +0100 Subject: [PATCH] Fix relativeMove implementation relativeMove was not correctly implemented until now Fix https://github.com/robotology/gazebo-yarp-plugins/issues/465 --- CHANGELOG.md | 3 ++- .../controlboard/src/ControlBoardDriverPositionControl.cpp | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee1463eed..50a3acf88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ The format of this document is based on [Keep a Changelog](https://keepachangelo ## [Unreleased] ### Fixed -- Solve the problem of setting the intraction mode when the mode of actuator has been already set on the same requested interaction mode. (https://github.com/robotology/gazebo-yarp-plugins/pull/464). +- Solve the problem of setting the interaction mode when the mode of actuator has been already set on the same requested interaction mode (https://github.com/robotology/gazebo-yarp-plugins/pull/464). +- Fix implementation of `yarp::dev::IPositionControl::relativeMove` in `gazebo_yarp_controlboard` (https://github.com/robotology/gazebo-yarp-plugins/pull/466). ## [3.3.0] - 2019-12-13 diff --git a/plugins/controlboard/src/ControlBoardDriverPositionControl.cpp b/plugins/controlboard/src/ControlBoardDriverPositionControl.cpp index df340425e..facd9e362 100644 --- a/plugins/controlboard/src/ControlBoardDriverPositionControl.cpp +++ b/plugins/controlboard/src/ControlBoardDriverPositionControl.cpp @@ -113,11 +113,7 @@ bool GazeboYarpControlBoardDriver::getRefSpeeds(double *spds) //WORKS bool GazeboYarpControlBoardDriver::relativeMove(int j, double delta) //NOT TESTED { - if (j >= 0 && static_cast(j) < m_numberOfJoints) { - m_trajectoryGenerationReferencePosition[j] = m_positions[j] + delta; //TODO check if this is ok or m_trajectoryGenerationReferencePosition=m_trajectoryGenerationReferencePosition+delta!!! - return true; - } - return false; + return positionMove(j, m_positions[j] + delta); } bool GazeboYarpControlBoardDriver::relativeMove(const double *deltas) //NOT TESTED