From a09e61b07f0786f7b3ed7594c353e3128bb613b4 Mon Sep 17 00:00:00 2001 From: ary Date: Tue, 3 Oct 2023 08:27:37 -0400 Subject: [PATCH] update superstructure update naming conventions for cleaner usage. driveChassis() -> - driveSync() - driveAsync() - driveWithMD turnChassis() -> - turnSync() - turnAsync() --- RELENTLESS/include/superstructure.hpp | 10 ++++++---- RELENTLESS/src/superstructure.cpp | 14 ++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/RELENTLESS/include/superstructure.hpp b/RELENTLESS/include/superstructure.hpp index 6d777c0..245f82e 100644 --- a/RELENTLESS/include/superstructure.hpp +++ b/RELENTLESS/include/superstructure.hpp @@ -19,11 +19,13 @@ namespace superstruct { // Movement Methods - void driveChassisAsync(double dist, bool useHeadingCorrection); - void driveChassisSync(double dist, bool useHeadingCorrection); - void driveChasissWithMD(double dist, bool useHeadingCorrection, double waitUntilDist); + void driveAsync(double dist, bool useHeadingCorrection); + void driveSync(double dist, bool useHeadingCorrection); + void driveWithMD(double dist, bool useHeadingCorrection, double waitUntilDist); + + void turnSync(double theta); + void turnAsync(double theta); - void turnChassis(double theta); void leftSwing(double theta); void rightSwing(double theta); diff --git a/RELENTLESS/src/superstructure.cpp b/RELENTLESS/src/superstructure.cpp index 6c2a6ee..dd4b8af 100644 --- a/RELENTLESS/src/superstructure.cpp +++ b/RELENTLESS/src/superstructure.cpp @@ -53,24 +53,30 @@ namespace superstruct { // motion and stuff - void driveChassisAsync(double dist, bool useHeadingCorrection) { + void driveAsync(double dist, bool useHeadingCorrection) { //chassis.set_mode(ary::DRIVE); chassis.set_drive(dist, DRIVE_SPEED * speedScale, (dist > 14.0) ? true : false, useHeadingCorrection); } - void driveChassisSync(double dist, bool useHeadingCorrection) { + void driveSync(double dist, bool useHeadingCorrection) { //chassis.set_mode(ary::DRIVE); chassis.set_drive(dist, DRIVE_SPEED * speedScale, (dist > 14.0) ? true : false, useHeadingCorrection); chassis.wait_drive(); } - void driveChasissWithMD(double dist, bool useHeadingCorrection, double waitUntilDist) { + void driveWithMD(double dist, bool useHeadingCorrection, double waitUntilDist) { //chassis.set_mode(ary::DRIVE); chassis.set_drive(dist, DRIVE_SPEED * speedScale, (dist > 14.0) ? true : false, useHeadingCorrection); chassis.wait_until(waitUntilDist); } - void turnChassis(double theta) { + void turnSync(double theta) { + //chassis.set_mode(ary::TURN); + chassis.set_turn(theta, TURN_SPEED * turnScale); + chassis.wait_drive(); + } + + void turnAsync(double theta) { //chassis.set_mode(ary::TURN); chassis.set_turn(theta, TURN_SPEED * turnScale); }