Go to Post My guess is you all are planning on being overweight......interesting strategy.....i like it - Stephen Kowski [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 01-19-2011, 11:10 AM
mint564 mint564 is offline
Registered User
FRC #0564 (Digital Impact)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2007
Location: New York
Posts: 7
mint564 is an unknown quantity at this point
downloading code on to robot difficulty

my team is having difficulty with downloading code once we edit it. we can download the default code just fine, but once we edit it we start having issues. we used java last year with no real problems like this.

when we compile our code there are no problems, but when we download our code it gives us an error saying that one of the jaguars we declared in our code is already being used, even though it isnt being used in anyway that i can see. we tried removing it then which made the code the same as the default, but we continue to have the same problem.

Does anyone know why its doing this?
Reply With Quote
  #2   Spotlight this post!  
Unread 01-19-2011, 10:24 PM
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: downloading code on to robot difficulty

Wanna share the error?
Reply With Quote
  #3   Spotlight this post!  
Unread 01-20-2011, 01:13 PM
sand500 sand500 is offline
Registered User
FRC #3540 (Wildcat Robotics)
 
Join Date: Jan 2011
Rookie Year: 2011
Location: United States
Posts: 81
sand500 is an unknown quantity at this point
Re: downloading code on to robot difficulty

you mean like imaging the Crio with the code right? or do you mean like what netbeans does. Are you running the code from netbeans or like what you would do in the competition with the drivers station stuff?
Reply With Quote
  #4   Spotlight this post!  
Unread 01-20-2011, 03:11 PM
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
Re: downloading code on to robot difficulty

Are you just adding a Jaguar without any other modifications? Is there a stack trace/exception being given?

The default code may have defined some things as examples, though I doubt it. What is the exact error and how is it shown? In the console output, error dialog?

And what/where are you coding? Java w/ FRC Plug-ins in NetBeans or Eclipse? Also, have you updated to the latest version of whichever plug-ins you are using? (the SDK was updated in the last few days)
__________________
CRUD Name: Windows
Rookie Year: 2005
Alumni to Team: 350
Reply With Quote
  #5   Spotlight this post!  
Unread 01-22-2011, 09:22 AM
mint564 mint564 is offline
Registered User
FRC #0564 (Digital Impact)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2007
Location: New York
Posts: 7
mint564 is an unknown quantity at this point
Re: downloading code on to robot difficulty

we're using netbeans, and w'ere declaring Jaguars the same way we did last year:

Jaguar one = new Jaguar(4,1);

um well this is what the error comes up as:

Uncaught exception in Thread.run():
[cRIO] on thread edu.wpi.first.wpilibj.defaultCode.DefaultRobot - main
[cRIO] edu.wpi.first.wpilibj.util.AllocationException: PWM channel 1 on module 4 is already allocated
[cRIO] at edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:112)
[cRIO] at edu.wpi.first.wpilibj.PWM.<init>(PWM.java:141)
[cRIO] at edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java: 33)
[cRIO] at edu.wpi.first.wpilibj.Jaguar.<init>(Jaguar.java:41 )
[cRIO] at edu.wpi.first.wpilibj.RobotDrive.<init>(RobotDrive .java:84)
[cRIO] at edu.wpi.first.wpilibj.defaultCode.DefaultRobot.<in it>(DefaultRobot.java:125)
[cRIO] in virtual method #11 of com.sun.squawk.Klass(bci=53)
[cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(99)
[cRIO] in virtual method #95 of com.sun.squawk.Klass(bci=25)
[cRIO] at com.sun.squawk.Isolate.run(1506)
[cRIO] at java.lang.Thread.run(231)
[cRIO] in virtual method #47 of com.sun.squawk.VMThread(bci=42)
[cRIO] in static method #3 of com.sun.squawk.VM(bci=6)
Reply With Quote
  #6   Spotlight this post!  
Unread 01-23-2011, 01:13 PM
flameout flameout is offline
AKA Ryan Van Why
FRC #0957 (SWARM)
Team Role: Alumni
 
Join Date: Sep 2009
Rookie Year: 2009
Location: Oregon
Posts: 168
flameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to allflameout is a name known to all
Re: downloading code on to robot difficulty

Can we please see your code?
Reply With Quote
  #7   Spotlight this post!  
Unread 01-23-2011, 02:00 PM
Fletch1373's Avatar
Fletch1373 Fletch1373 is offline
Registered User
AKA: Fletch
FRC #3181 (Panthers)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2004
Location: Rochester, NY
Posts: 247
Fletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud ofFletch1373 has much to be proud of
Re: downloading code on to robot difficulty

Do you have anything else using PWM channel 1? Victors, Jaguars? even if it's declared as:
Code:
new Jaguar(1)
instead of:
Code:
new Jaguar(4,1)
Slot 4 is the default Digital IO slot in the cRio.
__________________
Student:
<04: FRC0213> <05-08: FRC1373>
Mentor:
<09-10: FRC0809> <11-12: FRC3555> <12-14: FRC0073> <15-??: FRC3181>
Volunteer:
<FTAA> <CSA> <Defense Coordinator> <Scorekeeper> <Robot Inspector> <Official Scorer>
2016 Tour:
CTWAT [DefCoord] > Pittsburgh[Mentor/DefCoord] > TVR[FTAA] > FLR[CSA] > NE DCMP[CSA] > CMP[CSA]
Reply With Quote
  #8   Spotlight this post!  
Unread 02-08-2011, 11:06 PM
LiquidMagik LiquidMagik is offline
Registered User
FRC #0649
 
Join Date: Feb 2010
Location: Saratoga
Posts: 15
LiquidMagik is an unknown quantity at this point
Re: downloading code on to robot difficulty

we are having the same exact error except with a DigitalInput. the error line is instead:

[cRIO] edu.wpi.first.wpilibj.util.AllocationException: Digital channel 1 on module is already allocated

i dont think anyone replied with advice to the team and it has been a week or two so i assume the problem has been fixed. help? only 14 days left!
Reply With Quote
  #9   Spotlight this post!  
Unread 02-08-2011, 11:07 PM
LiquidMagik LiquidMagik is offline
Registered User
FRC #0649
 
Join Date: Feb 2010
Location: Saratoga
Posts: 15
LiquidMagik is an unknown quantity at this point
Re: downloading code on to robot difficulty

module 4*
Reply With Quote
  #10   Spotlight this post!  
Unread 02-09-2011, 11:17 AM
Ben_R_R's Avatar
Ben_R_R Ben_R_R is offline
Assistant Programing Mentor
FRC #2194 (Fondy Fire)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: WI
Posts: 21
Ben_R_R is an unknown quantity at this point
Re: downloading code on to robot difficulty

Solution to the original problem in case anyone else has this problem:

Check if you are declaring any new RobotDrive objects. If I recall the default code robot drive takes 4 PWM channels as arguments, but it will work if you are running the motors off the first 2 PWM channels. If you are only using 2 PWMs to run your motors, you can free up the extra channels like so:

Find this line:

m_robotDrive = new RobotDrive(1, 3, 2, 4);

Change to:

m_robotDrive = new RobotDrive(1, 2);

See if that helps.

@LiquidMagik

check along the same lines as above. Make sure none of the other objects are using the digital channel 1. If you can't find anything, see if the problem goes away when you change channels.
__________________
2194 Alumni and Mentor
Reply With Quote
  #11   Spotlight this post!  
Unread 02-09-2011, 11:00 PM
LiquidMagik LiquidMagik is offline
Registered User
FRC #0649
 
Join Date: Feb 2010
Location: Saratoga
Posts: 15
LiquidMagik is an unknown quantity at this point
Re: downloading code on to robot difficulty

Thank you for the help but we use different classes since we are using omni drive. We have each individual motor object from the victor class. We'll talk with our programming brobo tomorrow.

THANKS team 649
Reply With Quote
  #12   Spotlight this post!  
Unread 02-09-2011, 11:40 PM
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
Re: downloading code on to robot difficulty

Our team is using omni/mecanum wheels this year as well. I was just thinking, we had this same error and all too with our servos, and I think it might have something to do with not defining slots on any of the others.

such as
Code:
// see driver station dashboard for module numbers
Gyro gyro = new Gyro(1); // Gyro in PWM channel 1
Servo servo = new Servo(4,1); // Servo in Digital IO channel 1
Do you think it might have to be
Code:
Gyro gyro = new Gyro(1,1);
Servo servo = new Servo(4,1);
for it to work correctly?


All just complete guessing, I'm kind of hopeless right now, it seems the robot just doesn't want to cooperate this month.
If anyone finds the real answer, please share!

Thanks.
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
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 07:37 AM.

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