diff --git a/source/RobotAPI/components/KITProstheticHandUnit/KITProstheticHandUnit.cpp b/source/RobotAPI/components/KITProstheticHandUnit/KITProstheticHandUnit.cpp index 549629821483ac7a3060f9312c28e1d7180e6c3b..1f9d710a5ac1fa801bc4b28f9f24b2eb609cd5f0 100644 --- a/source/RobotAPI/components/KITProstheticHandUnit/KITProstheticHandUnit.cpp +++ b/source/RobotAPI/components/KITProstheticHandUnit/KITProstheticHandUnit.cpp @@ -65,7 +65,7 @@ void KITProstheticHandUnit::setJointAngles(const NameValueMap& targetJointAngles { if (pair.first == "Fingers") { - _driver->sendFingerPWM(200, 2999, static_cast<std::uint64_t>(pair.second * _driver->maxPosF())); + _driver->sendFingerPWM(200, 2999, static_cast<std::uint64_t>(pair.second * _driver->getMaxPosFingers())); // fix until hw driver is fixed to handle multiple commands at the same time std::this_thread::sleep_for(std::chrono::milliseconds(100)); } @@ -85,7 +85,7 @@ void KITProstheticHandUnit::setJointAngles(const NameValueMap& targetJointAngles NameValueMap KITProstheticHandUnit::getCurrentJointValues(const Ice::Current&) { NameValueMap jointValues; - jointValues["Fingers"] = _driver->getFingerPos() * 1.f / _driver->maxPosF(); + jointValues["Fingers"] = _driver->getFingerPos() * 1.f / _driver->getMaxPosFingers(); jointValues["Thumb"] = _driver->getThumbPos() * 1.f / _driver->getMaxPosThumb(); return jointValues; } diff --git a/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterface.cpp b/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterface.cpp index e8c024398fb5aa539b09cfa043fd28dea1e14cc3..fab724f4b1cc29732eed10bfa1c291237284c8ec 100644 --- a/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterface.cpp +++ b/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterface.cpp @@ -135,7 +135,7 @@ void BLEProthesisInterface::sendFingerPWM(uint64_t v, uint64_t mxPWM, uint64_t p std::to_string(getMaxPWM()) + "]" }; } - if (pos > maxPosF()) + if (pos > getMaxPosFingers()) { throw std::invalid_argument { @@ -143,7 +143,7 @@ void BLEProthesisInterface::sendFingerPWM(uint64_t v, uint64_t mxPWM, uint64_t p " , mxPWM = " + std::to_string(mxPWM) + " , pos = " + std::to_string(pos) + " ): The interval for pos is [0, " + - std::to_string(maxPosF()) + "]" + std::to_string(getMaxPosFingers()) + "]" }; } std::stringstream str; diff --git a/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterface.h b/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterface.h index cf96515661f2e6497c1de67386010d0563fb83ac..51797fe9b5b1e2ee3300b53221ab43a8c9675052 100644 --- a/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterface.h +++ b/source/RobotAPI/drivers/KITProstheticHandDriver/BLEProthesisInterface.h @@ -83,7 +83,7 @@ public: { return 100'000; } - static constexpr std::uint64_t maxPosF() + static constexpr std::uint64_t getMaxPosFingers() { return 200'000; }