Robot "Output Not updated often Enough" Help Please!

So, I get the robot to test today, and we run into some problems with ports. We fixed them all, but then we figured out that we needed the RobotDrive and all of the Jaguars to be pointers. The second we do this…

  1. Code Builds Correctly
  2. Deployed Correctly
  3. Reboot
  4. Enable
  5. The robot then is enabled for a second, and then we lose robot code. I go to the Diagnostics tab and see that the error “ERROR: A timeout has been exceeded: RobotDrive… Output not updated often enough… in Check() in C:/WindRiver/workspace/WPILib/MotorSafetyHelper.cpp at line 123.” had appeared, which killed the robot code.

We tried turning off the watchdog GetWatchdog().Kill(); and setting the safety of the robotdrive to false myRobot->SetSafetyEnabled(false);. This gave us the same results as above. Is there any way that I can fix this? Is there a certain wait time to put in or shorten?

Thanks.

From the sounds of your post you maybe doing something naughty with your pointers, which is causing your code to crash during the constructor; when this happens the driver station will give you the “no robot code loaded” error (I think) due to the underlying WPI services no longer running.

It’s likely the timeout exceeded message is erroneous, but I’m not 100% sure.

If you would like you can post or PM me your code (be sure to use CODE tags) and I can review it for you for pointer mistakes.

	
Jaguar *leftmotor;
Jaguar *rightmotor;
Jaguar *leftbackmotor;
Jaguar *rightbackmotor;

myRobot = new RobotDrive(leftmotor,leftbackmotor,rightmotor,leftbackmotor);
leftmotor = new Jaguar(1);
rightmotor = new Jaguar(2);
leftbackmotor = new Jaguar(3);
rightbackmotor = new Jaguar(4);

Ok, so what has happened is your declared several pointers to jaguars, then gave them to myRobot to use, however the pointers don’t point to anything until you call new, so myRobot (which apparantly doesn’t null protect itself!? ::ouch:: ) seems to crash trying to derefernce these pointers.


Jaguar *leftmotor;
Jaguar *rightmotor;
Jaguar *leftbackmotor;
Jaguar *rightbackmotor;

leftmotor = new Jaguar(1);
rightmotor = new Jaguar(2);
leftbackmotor = new Jaguar(3);
rightbackmotor = new Jaguar(4);

myRobot = new RobotDrive(leftmotor,leftbackmotor,rightmotor,leftbackmotor);

^That’s all you need to do to fix it :slight_smile:

You can also do it like this:



class Robot2012 : public IterativeRobot
{
	Jaguar jaguarFrontLeft;
	Jaguar jaguarFrontRight;
	Jaguar jaguarRearLeft;
	Jaguar jaguarRearRight;

	Robot2012(void):
		jaguarFrontLeft(1),
		jaguarFrontRight(2),
		jaguarRearLeft(3),
		jaguarRearRight(4),
		myRobot(&jaguarFrontLeft, &jaguarRearLeft, &jaguarFrontRight, &jaguarRearRight),

Putting an & in front of an object gives you a reference to that object(aka it’s pointer)