From 1e31620a9295efc7f4e1bbcba5c2458015b586d7 Mon Sep 17 00:00:00 2001 From: Abhinav Goyal Date: Sat, 9 Nov 2024 12:04:40 -0800 Subject: [PATCH] Change datatype of timeout from int to milliseconds --- src/TunePID.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/TunePID.cpp b/src/TunePID.cpp index 671bcbe7..d6651aef 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; @@ -138,10 +140,9 @@ int main(int argc, char** argv) { double period = 8.0; time_point start = steady_clock::now(); - constexpr int timeout = 300ms; + constexpr milliseconds timeout = 300ms; 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 < timeout) { starting_angle_data_point = can::motor::getMotorPosition(serial); }