Go to Post This is one area where you want an old hand in the room to show you how to work on this thing. .... If you survive it, electricity hurts really bad. - ebarker [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 13-02-2010, 02:47
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Relay AllocationException

When attempting to initialize relays on a additional Sidecar, connected to slot 6, I receive an AllocationException with a message to the effect of: "Channel X on slot Y has already been initalized."

Adding the code "Relay r = new Relay(6, 1);" to RobotInit() in an empty project reproduces this error.

Is there a solution to this?
__________________
Eric Haskins KC9JVH
Reply With Quote
  #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
  #3   Spotlight this post!  
Unread 13-02-2010, 09:41
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Relay AllocationException

I'll try that today.

Thanks.
__________________
Eric Haskins KC9JVH
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2010, 15:30
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Relay AllocationException

That fixed it. Works perfectly now.
__________________
Eric Haskins KC9JVH
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Relay Robopanda6 Java 5 07-02-2010 01:08
Relay (Spike) elbuo Electrical 2 09-02-2009 20:36
Relay Help JCODER Programming 2 06-02-2008 16:49
Relay Commands Matt Krass Programming 6 18-02-2006 23:03
Relay Assignments MulletFish Programming 9 27-01-2005 14:15


All times are GMT -5. The time now is 12: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