From 6b83045c370658f2339e109f8acea618c6e71736 Mon Sep 17 00:00:00 2001 From: Pernilla Date: Mon, 16 Dec 2024 11:54:15 +0100 Subject: [PATCH] Add todo --- .../simulation/gz_bridge/GZMixingInterfaceServo.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/simulation/gz_bridge/GZMixingInterfaceServo.cpp b/src/modules/simulation/gz_bridge/GZMixingInterfaceServo.cpp index d98345ffa36a..2eb474669027 100644 --- a/src/modules/simulation/gz_bridge/GZMixingInterfaceServo.cpp +++ b/src/modules/simulation/gz_bridge/GZMixingInterfaceServo.cpp @@ -33,6 +33,8 @@ #include "GZMixingInterfaceServo.hpp" +#define SERVO_OUTPUT_SCALING (10.) +#define SERVO_OUTPUT_OFFSET (180.) bool GZMixingInterfaceServo::init(const std::string &model_name) { @@ -66,8 +68,9 @@ bool GZMixingInterfaceServo::updateOutputs(bool stop_motors, uint16_t outputs[MA if (_mixing_output.isFunctionSet(i)) { gz::msgs::Double servo_output; - - double output = math::radians((double)outputs[i] / 10. - 180.); + // TODO: update the SIM_GZ_ params to floats instead of uint to unlock + // parameterizing of min/max angles and servo min/max outputs in ms. + double output = math::radians((double)outputs[i] / SERVO_OUTPUT_SCALING - SERVO_OUTPUT_OFFSET); // std::cout << "outputs[" << i << "]: " << outputs[i] << std::endl; // std::cout << " output: " << output << std::endl;