Go to Post We're not here to build robots. We're here to build students. - GreyingJay [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-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 11-02-2012, 13:28
MrTimms MrTimms is offline
Registered User
FRC #1165
 
Join Date: Feb 2012
Location: Phoenix
Posts: 1
MrTimms is on a distinguished road
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.



Reply With Quote
  #2   Spotlight this post!  
Unread 12-02-2012, 10:21
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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?
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 17:36.

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


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