diff --git a/src/TunePID.cpp b/src/TunePID.cpp index acc716d7..d0f4c46b 100644 --- a/src/TunePID.cpp +++ b/src/TunePID.cpp @@ -18,7 +18,8 @@ extern "C" { } enum class targetmode_t { - step, sinusoidal + step, + sinusoidal }; using namespace robot::types; @@ -145,7 +146,8 @@ int main(int argc, char** argv) { time_point tp = steady_clock::now(); time_point startTime = tp; - while (steady_clock::now() - startTime < 3 * milliseconds(static_cast(period * 1000))) { + while (steady_clock::now() - startTime < + 3 * milliseconds(static_cast(period * 1000))) { int32_t current_angle = can::motor::getMotorPosition(serial).getData(); double difference = (current_angle - angle_target) / 1000.0; acc_error += difference * difference; @@ -159,7 +161,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); diff --git a/src/ar/ARTester.cpp b/src/ar/ARTester.cpp index 3bb5958c..0f52006a 100644 --- a/src/ar/ARTester.cpp +++ b/src/ar/ARTester.cpp @@ -252,7 +252,8 @@ std::vector projectCube(float len, cv::Vec3d rvec, cv::Vec3d tvec) } std::vector projectGrid(cv::Size imageSize, int spacing) { - cv::Point2f center(static_cast(imageSize.width) / 2.0f, static_cast(imageSize.height) / 2.0f); + cv::Point2f center(static_cast(imageSize.width) / 2.0f, + static_cast(imageSize.height) / 2.0f); std::vector grid_points; std::vector projected_points; float xf, yf; diff --git a/src/camera/calibration.cpp b/src/camera/calibration.cpp index 3ae29c6f..c36f3a37 100644 --- a/src/camera/calibration.cpp +++ b/src/camera/calibration.cpp @@ -121,8 +121,16 @@ static void help(char** argv) { printf("\n%s", liveCaptureHelp); } -enum { DETECTION = 0, CAPTURING = 1, CALIBRATED = 2 }; -enum Pattern { CHESSBOARD, CIRCLES_GRID, ASYMMETRIC_CIRCLES_GRID }; +enum { + DETECTION = 0, + CAPTURING = 1, + CALIBRATED = 2 +}; +enum Pattern { + CHESSBOARD, + CIRCLES_GRID, + ASYMMETRIC_CIRCLES_GRID +}; static double computeReprojectionErrors(const std::vector>& objectPoints, @@ -310,7 +318,8 @@ saveCameraParams(const std::string& filename, cv::Size imageSize, cv::Size board } if (!imagePoints.empty()) { - cv::Mat imagePtMat(static_cast(imagePoints.size()), static_cast(imagePoints[0].size()), CV_32FC2); + cv::Mat imagePtMat(static_cast(imagePoints.size()), + static_cast(imagePoints[0].size()), CV_32FC2); for (int i = 0; i < static_cast(imagePoints.size()); i++) { cv::Mat r = imagePtMat.row(i).reshape(2, imagePtMat.cols); cv::Mat imgpti(imagePoints[i]); @@ -563,9 +572,9 @@ int main(int argc, char** argv) { if (found) drawChessboardCorners(view, boardSize, cv::Mat(pointbuf), found); - std::string msg = mode == CAPTURING - ? "100/100" - : mode == CALIBRATED ? "Calibrated" : "Press 'g' to start"; + std::string msg = mode == CAPTURING ? "100/100" + : mode == CALIBRATED ? "Calibrated" + : "Press 'g' to start"; int baseLine = 0; cv::Size textSize = cv::getTextSize(msg, 1, 1, 1, &baseLine); cv::Point textOrigin(view.cols - 2 * textSize.width - 10, @@ -573,7 +582,8 @@ int main(int argc, char** argv) { if (mode == CAPTURING) { if (undistortImage) - msg = cv::format("%d/%d Undist", static_cast(imagePoints.size()), nframes); + msg = + cv::format("%d/%d Undist", static_cast(imagePoints.size()), nframes); else msg = cv::format("%d/%d", static_cast(imagePoints.size()), nframes); }