|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#3
|
||||
|
||||
|
Re: Error: a timeout has been exceeded
the only wait a have if the wait(0.005) for the motor update
Forgot to include my code here it is: #include "WPILib.h" /** * This is a demo program showing the use of the RobotBase class. * The SimpleRobot class is the base of a robot application that will automatically call your * Autonomous and OperatorControl methods at the right time as controlled by the switches on * the driver station or the field controls. */ class RobotDemo : public SimpleRobot { RobotDrive myRobot; // robot drive system Joystick stick; // only joystick Jaguar jag; public: RobotDemo(void): myRobot(1, 3, 2, 10), // front left, rear left, front right, rear right stick(1), //these must be initialized in the same order jag(9) { myRobot.SetExpiration(0.1); } /** * Drive left & right motors for 2 seconds then stop */ void Autonomous(void) { myRobot.SetSafetyEnabled(false); myRobot.MecanumDrive_Cartesian(0.0, 0.5, 0.0, 0.0); // drive forwards half speed Wait(2.0); // for 2 seconds myRobot.MecanumDrive_Cartesian(0.0, 0.0, 0.5, 0.0); // spin robot Wait(2.0); // for 2 seconds myRobot.MecanumDrive_Cartesian(0.0, 0.0, 0.0, 0.0); // stop robot } /* * Runs the motors with single stick holonomic steering. * comment */ void OperatorControl(void) { while (IsOperatorControl()); { myRobot.SetSafetyEnabled(true); myRobot.MecanumDrive_Cartesian(stick.GetX(), stick.GetY(), stick.GetTwist(), 0); // drive with arcade style (use right stick) Wait(0.005); // wait for a motor update time } } }; START_ROBOT_CLASS(RobotDemo); |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|