diff --git a/app/raspberry_pi/src/car/system/movement/MovementSystem.hpp b/app/raspberry_pi/src/car/system/movement/MovementSystem.hpp index 4bc0cb59..ca0ef206 100644 --- a/app/raspberry_pi/src/car/system/movement/MovementSystem.hpp +++ b/app/raspberry_pi/src/car/system/movement/MovementSystem.hpp @@ -38,11 +38,12 @@ namespace car::system::movement { void terminate() { } - // https://www.arduino.cc/en/Reference/Map + // From: https://github.com/chaoticmachinery/pca9685 int map(int x, int in_min, int in_max, int out_min, int out_max) { return ((x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min); } + // From: https://github.com/chaoticmachinery/pca9685 int setAngleToAnalog(int angle) { float pulse_wide; int analog_value; @@ -52,6 +53,7 @@ namespace car::system::movement { return (analog_value); } + // From: https://github.com/chaoticmachinery/pca9685 void turn(const TurnCommand& command) { const float angle = std::clamp(command.angle, 1.0f, 179.0f); for (int channel = 0; channel < 2; channel++) {