Skip to content

Commit 6b83045

Browse files
committed
Add todo
1 parent fd9b954 commit 6b83045

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/modules/simulation/gz_bridge/GZMixingInterfaceServo.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
#include "GZMixingInterfaceServo.hpp"
3535

36+
#define SERVO_OUTPUT_SCALING (10.)
37+
#define SERVO_OUTPUT_OFFSET (180.)
3638

3739
bool GZMixingInterfaceServo::init(const std::string &model_name)
3840
{
@@ -66,8 +68,9 @@ bool GZMixingInterfaceServo::updateOutputs(bool stop_motors, uint16_t outputs[MA
6668
if (_mixing_output.isFunctionSet(i)) {
6769
gz::msgs::Double servo_output;
6870

69-
70-
double output = math::radians((double)outputs[i] / 10. - 180.);
71+
// TODO: update the SIM_GZ_ params to floats instead of uint to unlock
72+
// parameterizing of min/max angles and servo min/max outputs in ms.
73+
double output = math::radians((double)outputs[i] / SERVO_OUTPUT_SCALING - SERVO_OUTPUT_OFFSET);
7174

7275
// std::cout << "outputs[" << i << "]: " << outputs[i] << std::endl;
7376
// std::cout << " output: " << output << std::endl;

0 commit comments

Comments
 (0)