From 123380540722c6bcc007a43a8052fecbca619748 Mon Sep 17 00:00:00 2001 From: Abhinav Goyal Date: Mon, 4 Nov 2024 18:04:14 -0800 Subject: [PATCH] Fix formatting issue --- src/TunePID.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/TunePID.cpp b/src/TunePID.cpp index 204996e0..96b0fbde 100644 --- a/src/TunePID.cpp +++ b/src/TunePID.cpp @@ -17,8 +17,10 @@ extern "C" { #include "HindsightCAN/CANCommon.h" } -enum class targetmode_t { - step, sinusoidal +enum class targetmode_t +{ + step, + sinusoidal }; using namespace robot::types; @@ -140,12 +142,13 @@ int main(int argc, char** argv) { time_point start = steady_clock::now(); int timeout = 300; // in milliseconds DataPoint starting_angle_data_point = can::motor::getMotorPosition(serial); - while(!starting_angle_data_point.isValid() && steady_clock::now() - start < milliseconds(timeout)) { + while (!starting_angle_data_point.isValid() && + steady_clock::now() - start < milliseconds(timeout)) { starting_angle_data_point = can::motor::getMotorPosition(serial); } int32_t starting_angle; - if(starting_angle_data_point.isValid()) { + if (starting_angle_data_point.isValid()) { starting_angle = starting_angle_data_point.getData(); } else { LOG_F(WARNING, "STARTING ANGLE DATA NOT FOUND"); @@ -171,7 +174,7 @@ int main(int argc, char** argv) { if (mode == targetmode_t::step) { prescaled_target = round(prescaled_target); } - angle_target = (int32_t) round(amplitude * prescaled_target) + starting_angle; + angle_target = (int32_t)round(amplitude * prescaled_target) + starting_angle; can::motor::setMotorPIDTarget(serial, angle_target);