OCCRA
Go to Post At a much more pragmatic level, organization is what seperates a team full people with really cool unrealized dreams and a team that is trying to figure out it's alliance picks. - phrontist [more]
Home
Go Back   Chief Delphi > Technical > Programming > WindRiver C++
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-17-2012, 11:41 PM
cjlane1138 cjlane1138 is offline
Team 1138
FRC #1138 (Eagle Engineering)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Los Angeles
Posts: 88
cjlane1138 is an unknown quantity at this point
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.
__________________
Eagle Engineering 1138
Reply With Quote
  #2   Spotlight this post!  
Unread 02-18-2012, 03:14 PM
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Robot "Output Not updated often Enough" Help Please!

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.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-18-2012, 03:24 PM
cjlane1138 cjlane1138 is offline
Team 1138
FRC #1138 (Eagle Engineering)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Los Angeles
Posts: 88
cjlane1138 is an unknown quantity at this point
Re: Robot "Output Not updated often Enough" Help Please!

Quote:
Originally Posted by DjScribbles View Post
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.
Code:
	
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);
__________________
Eagle Engineering 1138
Reply With Quote
  #4   Spotlight this post!  
Unread 02-18-2012, 04:17 PM
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Robot "Output Not updated often Enough" Help Please!

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!? ) seems to crash trying to derefernce these pointers.

Code:
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

You can also do it like this:
Code:
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)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:26 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi