Skip to content

Commit

Permalink
Add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
Perrrewi committed Dec 16, 2024
1 parent edc8a13 commit 639b005
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/simulation/gz_bridge/GZMixingInterfaceServo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 639b005

Please sign in to comment.