2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00

Changed power from pointer (untested)

This commit is contained in:
Austen Adler 2015-02-14 13:36:50 -05:00
parent d92afcde6e
commit e66a67143a
3 changed files with 7 additions and 6 deletions

View File

@ -4,21 +4,22 @@
AutoDrive::AutoDrive(double wait) : Command("AutoDrive"){ AutoDrive::AutoDrive(double wait) : Command("AutoDrive"){
Requires(DentRobot::drivetrain); Requires(DentRobot::drivetrain);
SetTimeout(wait); SetTimeout(wait);
power=NULL; power=5;
} }
AutoDrive::AutoDrive(double wait, double p) : Command("AutoDrive"){ AutoDrive::AutoDrive(double wait, double p) : Command("AutoDrive"){
Requires(DentRobot::drivetrain); Requires(DentRobot::drivetrain);
SetTimeout(wait); SetTimeout(wait);
*power=p; power=p;
} }
void AutoDrive::Initialize(){ void AutoDrive::Initialize(){
} }
void AutoDrive::Execute(){ void AutoDrive::Execute(){
//X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle), gyro //X axis, Y axis, Z axis, sensitivity, speed threshold (usually throttle), gyro
if(power==NULL){ //if(power==NULL){
if(power==5){
DentRobot::drivetrain->DriveMecanum(0.0,-.75,0.0,0.9,0.0); DentRobot::drivetrain->DriveMecanum(0.0,-.75,0.0,0.9,0.0);
}else{ }else{
DentRobot::drivetrain->DriveMecanum(0.0,*power,0.0,0.9,0.0); DentRobot::drivetrain->DriveMecanum(0.0,power,0.0,0.9,0.0);
} }
} }
bool AutoDrive::IsFinished(){ bool AutoDrive::IsFinished(){

View File

@ -8,7 +8,7 @@
class AutoDrive: public Command{ class AutoDrive: public Command{
private: private:
double *power; double power;
public: public:
AutoDrive(double); AutoDrive(double);
AutoDrive(double, double); AutoDrive(double, double);

View File

@ -5,8 +5,8 @@
#include "CloseCollector.h" #include "CloseCollector.h"
CollectTote::CollectTote(){ CollectTote::CollectTote(){
AddParallel(new CloseCollector()); AddParallel(new CloseCollector());
AddSequential(new RollIn());
// TODO: Fix null error // TODO: Fix null error
//AddParallel(new AutoDrive(0.5, -0.75)); //AddParallel(new AutoDrive(0.5, -0.75));
AddSequential(new RollIn());
} }
// vim: ts=2:sw=2:et // vim: ts=2:sw=2:et