From 40da44008f8ce0034fdaabf1950d1f58d24fc684 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Tue, 17 Mar 2015 09:50:38 -0400 Subject: [PATCH] Worked on Autonomous --- Commands/Autonomous/AutoDrive.cpp | 7 +++++-- Commands/Autonomous/AutoDrive.h | 8 ++++++-- Commands/Autonomous/Autonomous.cpp | 19 ++++++++----------- Commands/Autonomous/CollectTote.cpp | 4 ++-- Commands/Autonomous/CollectTote.h | 4 +++- DentRobot.cpp | 12 +++++++++--- Makefile | 2 +- 7 files changed, 34 insertions(+), 22 deletions(-) diff --git a/Commands/Autonomous/AutoDrive.cpp b/Commands/Autonomous/AutoDrive.cpp index 475224b..711de7e 100644 --- a/Commands/Autonomous/AutoDrive.cpp +++ b/Commands/Autonomous/AutoDrive.cpp @@ -1,18 +1,21 @@ #include "AutoDrive.h" #include "../../DentRobot.h" // Drive for a short while then stop. Just for testing -AutoDrive::AutoDrive(double duration, double xtmp, double ytmp): Command("AutoDrive"){ +AutoDrive::AutoDrive(double duration, double xtmp, double ytmp, double ztmp, bool useGyro): Command("AutoDrive"){ Requires(DentRobot::drivetrain); SetTimeout(duration); x=xtmp; y=ytmp; + z=ztmp; + gyro=useGyro; } void AutoDrive::Initialize(){ DentRobot::drivetrain->ResetGyro(); } void AutoDrive::Execute(){ //X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle) - DentRobot::drivetrain->DriveMecanum(x, y, 0.0, 0.9, true); + printf("z: %f\n", z); + DentRobot::drivetrain->DriveMecanum(x, y, z, 0.9, gyro); } bool AutoDrive::IsFinished(){ return IsTimedOut(); diff --git a/Commands/Autonomous/AutoDrive.h b/Commands/Autonomous/AutoDrive.h index 96fa8a4..e2fa088 100644 --- a/Commands/Autonomous/AutoDrive.h +++ b/Commands/Autonomous/AutoDrive.h @@ -14,7 +14,9 @@ class AutoDrive: public Command{ private: double x, // /home/lvuser/FRCUserProgram;chmod a+x /home/lvuser/FRCUserProgram' + @/home/stonewareslord/git/pv-1.5.7/pv bin/FRCUserProgram | ssh admin@$(REMOTEIP) '(rm /home/lvuser/FRCUserProgram) /home/lvuser/FRCUserProgram;chmod a+x /home/lvuser/FRCUserProgram' debug: @cat bin/FRCUserProgram | ssh admin@$(REMOTEIP) '(rm /home/lvuser/FRCUserProgram) /home/lvuser/FRCUserProgram;chmod a+x /home/lvuser/FRCUserProgram;/home/lvuser/run.sh'