From 3bf3f0376756d751f48a664132feaa5a65f94271 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 31 Aug 2022 09:44:43 +0200 Subject: [PATCH] Fix for https://github.com/robotology/whole-body-estimators/issues/156 (#157) * Fix for https://github.com/robotology/whole-body-estimators/issues/156 * Update WholeBodyDynamicsDevice.cpp * Update CHANGELOG.md * Update CHANGELOG.md --- CHANGELOG.md | 1 + devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8baff85..faa7632 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed ### Fixed +- Fix a bug introduced in 0.8.0, due to which estimation of external forces and internal torques when FT sensors are read from sensors that expose an `IAnalogSensor` interface was not working (https://github.com/robotology/whole-body-estimators/pull/157, https://github.com/robotology/whole-body-estimators/pull/156). ## [0.8.0] - 2022-08-23 diff --git a/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp b/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp index 2460941..815bb6d 100644 --- a/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp +++ b/devices/wholeBodyDynamics/WholeBodyDynamicsDevice.cpp @@ -2051,7 +2051,7 @@ bool WholeBodyDynamicsDevice::readFTSensors(bool verbose) auto ftAnalogIter = (std::find(ftAnalogSensorNames.begin(), ftAnalogSensorNames.end(), sensorName)); if (ftAnalogIter != ftAnalogSensorNames.end()) { - auto ftID = std::distance(ftMultipleAnalogSensorNames.begin(), ftMasITer); + auto ftID = std::distance(ftAnalogSensorNames.begin(), ftAnalogIter); int ftRetVal = ftSensors[ftID]->read(ftMeasurement); ok = (ftRetVal == IAnalogSensor::AS_OK); }