Some updates to mixing driving and shooting... More TODOs also
This commit is contained in:
commit
51741fe33b
@ -6,8 +6,16 @@
|
|||||||
* This sample shows how to use the new CANTalon to just run a motor in a basic
|
* This sample shows how to use the new CANTalon to just run a motor in a basic
|
||||||
* throttle mode, in the same manner as you might control a traditional PWM
|
* throttle mode, in the same manner as you might control a traditional PWM
|
||||||
* controlled motor.
|
* controlled motor.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef BUTTON_LAYOUT
|
||||||
|
#define BUTTON_LAYOUT
|
||||||
|
|
||||||
|
#define TRIGGER 10 // I have no idea what the right button number is...
|
||||||
|
#define THUMB 11
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
class Robot: public IterativeRobot {
|
class Robot: public IterativeRobot {
|
||||||
CANTalon r1_drive;
|
CANTalon r1_drive;
|
||||||
CANTalon r2_drive;
|
CANTalon r2_drive;
|
||||||
@ -64,10 +72,23 @@ public:
|
|||||||
drive.Drive(&lstick);
|
drive.Drive(&lstick);
|
||||||
|
|
||||||
float power = (1.0 - rstick.GetThrottle()) / 2.0;
|
float power = (1.0 - rstick.GetThrottle()) / 2.0;
|
||||||
//shooter1.Set(power);
|
|
||||||
//shooter2.Set(power);
|
|
||||||
shooter.SetPower(power);
|
|
||||||
|
|
||||||
|
//shooter.SetPower(power);
|
||||||
|
if(rstick.GetRawButton(TRIGGER))
|
||||||
|
{
|
||||||
|
// SHOOT THE BALL
|
||||||
|
}
|
||||||
|
|
||||||
|
if(rstick.GetRawButton(THUMB))
|
||||||
|
{
|
||||||
|
// lower the ramp
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// raise the ramp to HALF (so it isn't down all the time!)
|
||||||
|
}
|
||||||
|
|
||||||
|
// How to pickup?
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -51,8 +51,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
float speed = y * th;
|
float speed = y * th;
|
||||||
|
// TODO: do some math here to smooth out turning?
|
||||||
float rot = x; // TODO: do some math here to smooth out turning?
|
float rot = x * th;
|
||||||
|
|
||||||
dt1->ArcadeDrive(speed, rot, false);
|
dt1->ArcadeDrive(speed, rot, false);
|
||||||
dt2->ArcadeDrive(speed, rot, false);
|
dt2->ArcadeDrive(speed, rot, false);
|
||||||
|
Reference in New Issue
Block a user