View Single Post
  #3   Spotlight this post!  
Unread 12-01-2012, 21:20
Cody Trey's Avatar
Cody Trey Cody Trey is offline
Programing = hard + fun
FRC #2582 (Panther Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: US
Posts: 31
Cody Trey is an unknown quantity at this point
Send a message via Yahoo to Cody Trey
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);
__________________
Love, Peace, and Robot Grease
Reply With Quote