View Single Post
  #2   Spotlight this post!  
Unread 13-02-2010, 03:25
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: Relay AllocationException

It looks like you've found a bug in WPILibJ. I've looked at the source for the Relay class, and it appears that it only allocates a Resource object large enough track relay channels on the first DIO module.

Java version:
Code:
private static Resource relayChannels = new Resource(tDIO.kNumSystems * kRelayChannels);
This isn't enough, since a separate resource is allocated for Forward and Reverse.

C++ version:
Code:
Resource::CreateResourceObject(&relayChannels, tDIO::kNumSystems * kRelayChannels * 2);
Until it's fixed in an update, you could copy the Relay.java source code from ~/sunspotfrcsdk/lib/WPILibJ/src into your project and correct it by adding in the factor of 2.

If this fixes the issue a bug report should be submitted on FIRSTForge.
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award

Last edited by MattD : 13-02-2010 at 03:31.
Reply With Quote