Okay so here is where I stand, don't have a chance to test it on the practice bot today but will tomorrow. Anyone got any advice on the program and is there anything essential I should add or do to this program? Not totally sure how to do the twist part for the Mecanum wheels using an Attack3 joystick...
Here it is:
Code:
#include "WPILib.h"
class RobotDemo : public SimpleRobot
{
RobotDrive *drive;
Victor *leftFrontMotor;
Victor *leftRearMotor;
Victor *rightFrontMotor;
Victor *rightRearMotor;
Joystick *Attack1;
Joystick *Attack2;
public:
RobotDemo(void)
{
drive = new RobotDrive(leftFrontMotor,leftRearMotor,rightFrontMotor,rightRearMotor);
Attack1 = new Joystick(1);
Attack2 = new Joystick(2);
GetWatchdog().SetExpiration(0.1);
drive->SetExpiration(0.1);
}
void Autonomous(void)
{
}
void OperatorControl(void)
{
GetWatchdog().SetEnabled(true);
drive->SetSafetyEnabled(true);
while (IsOperatorControl())
{
drive->MecanumDrive_Cartesian(Attack1->GetX(),Attack1->GetY(),Attack2->GetTwist());
Wait(0.005);
}
}
};
START_ROBOT_CLASS(RobotDemo);