From a22b83160bfdcdab1c442930534865e10b2b9319 Mon Sep 17 00:00:00 2001 From: Jess Zarchi Date: Sat, 7 Sep 2024 23:43:35 -0700 Subject: [PATCH] Rotation sensors now reverse as trackers #175 #176 --- EZ-Template-Example-Project/src/main.cpp | 2 +- src/EZ-Template/tracking_wheel.cpp | 1 + src/autons.cpp | 2 +- src/main.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/EZ-Template-Example-Project/src/main.cpp b/EZ-Template-Example-Project/src/main.cpp index b093f327..66e45958 100644 --- a/EZ-Template-Example-Project/src/main.cpp +++ b/EZ-Template-Example-Project/src/main.cpp @@ -157,7 +157,7 @@ void ez_template_etxras() { 1); // Don't override the top Page line } // This is Blank Page 2, it will display every tracking wheel. - // Make sure the tracking wheels read POSITIVE going forwards or left. + // Make sure the tracking wheels read POSITIVE going forwards or right. else if (ez::as::page_blank_is_on(1)) { if (chassis.odom_left_tracker != nullptr) screen_print("left tracker: " + std::to_string(chassis.odom_left_tracker->get()), 1); diff --git a/src/EZ-Template/tracking_wheel.cpp b/src/EZ-Template/tracking_wheel.cpp index 1b0ca935..8ec56fad 100644 --- a/src/EZ-Template/tracking_wheel.cpp +++ b/src/EZ-Template/tracking_wheel.cpp @@ -39,6 +39,7 @@ tracking_wheel::tracking_wheel(int port, double wheel_diameter, double distance_ : adi_encoder(-1, -1, false), smart_encoder(abs(port)) { IS_TRACKER = DRIVE_ROTATION; + smart_encoder.set_reversed(util::reversed_active(port)); distance_to_center_set(distance_to_center); wheel_diameter_set(wheel_diameter); diff --git a/src/autons.cpp b/src/autons.cpp index ceaf7bdf..f1b8eb5f 100644 --- a/src/autons.cpp +++ b/src/autons.cpp @@ -43,7 +43,7 @@ void default_constants() { // - if you have tracking wheels, you can run this lower chassis.odom_turn_bias_set(1.375); -// This sets the maximum distance away from target that the carrot point can be + // This sets the maximum distance away from target that the carrot point can be chassis.odom_boomerang_distance_set(12_in); // Defaults the turn behavior to always go the shortest way diff --git a/src/main.cpp b/src/main.cpp index d30fd858..79352bff 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -168,7 +168,7 @@ void ez_template_etxras() { 1); // Don't override the top Page line } // This is Blank Page 2, it will display every tracking wheel. - // Make sure the tracking wheels read POSITIVE going forwards or left. + // Make sure the tracking wheels read POSITIVE going forwards or right. else if (ez::as::page_blank_is_on(1)) { if (chassis.odom_left_tracker != nullptr) screen_print("left tracker: " + std::to_string(chassis.odom_left_tracker->get()), 1);