Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Enabling autonomous cuts communication (http://www.chiefdelphi.com/forums/showthread.php?t=102544)

MrTimms 11-02-2012 13:28

Enabling autonomous cuts communication
 
Yeah. When we enable autonomous, the Robot Code and then the Communication lights cut out. Our autonomous function looks like:

Code:

void Autonomous(void) {
d_base->SetSafetyEnabled(true);
Timer timer;
timer.Start();
while (IsAutonomous()) {
Aim();
GetWatchdog().Feed();
Wait(0.01);
}
}

d_base is our RobotDrive, Aim() uses a modified version of the 2012 Vision example, and there's a problem that may or may not be related. In messages, whenever the robot starts, we get "ERROR: Attempted to reuse allocated resource: Forward Relay 1 (Module: 1) ...in Allocate() in C:/WindRiver/workspace/WPILib/Resource.cpp at line 76."

When we comment out the vision code, autonomous doesn't cut communication, but the reuse error still comes up and it prints "ERROR: A timeout has been exceeded: RobotDrive... Output not updated often enough ..." etc even though Expiration is set at 0.1s and we are feeding the watchdog every 0.01s. We also kind of need the vision code working to help aim/autoaim. Help would be appreciated.

I would put a smiley here, but they are too smarmy for my tastes, so I'll put them lower instead.



;) :p ;) :confused: :)

Alan Anderson 12-02-2012 10:21

Re: Enabling autonomous cuts communication
 
Fixing the relay reallocation error should be easy. I'd do that before trying to debug the autonomous code.

The RobotDrive timeout isn't coming from the watchdog. It's coming from the motor safety associated with the drive motors. Some call it a "watchpuppy". If you don't set a motor output value every 100 milliseconds or faster, the safety cuts off the motor and reports the error. It's only enabled by default on the drive motors. Since your autonomous loop doesn't do any drive motor control, you'll get that error.

It's apparent from your description that something in Aim() is crashing the code. Do you see any relevant messages on the console?


All times are GMT -5. The time now is 17:36.

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