Go to Post Sorry, solenoids don't speak English. You can talk at them, but they won't answer except maybe to sigh... - Mark McLeod [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 25-01-2013, 22:06
Negative 9 Negative 9 is offline
Registered User
FRC #0611
 
Join Date: Dec 2012
Location: Mclean, VA
Posts: 46
Negative 9 is an unknown quantity at this point
Issue using code w/ multiple classes

So today we finally reimaged our cRIO to the latest v47 Java image and got a chance to compile our code.

Originally our code had two classes, one being the usual main class that all teams would be using to control their robots and the other being a custom DriveTrain class our lead programmer wrote to handle our Mecanum Drive.

When we tested our code 3 of the 4 jags were not initialized. The 4th jag that was initialized would not give input to the motor it was connected to. In troubleshooting we found that only the port on the Digital Sidecar that the 4th jag seemed to be initializing its respect jaguar. We tested all of our jags on that port and they all got initialized, but still would not take input. At that point, we swapped sidecars and the same issue still popped up.

Then we figured that it must have been something in the code. We implemented the same algorithms in the custom DriveTrain class in a single class and somehow everything seemed to work as it should. The thing that bugs me about all this is that one port on the Digital Sidecar was working with the multiple classes and I have absolutely no idea why that would be the case.

Any ideas on why that may have been the case? Is there something about how FRC Java supports classes that I'm missing here?
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2013, 00:50
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Issue using code w/ multiple classes

Quote:
Originally Posted by Negative 9 View Post
Any ideas on why that may have been the case? Is there something about how FRC Java supports classes that I'm missing here?
We've run FRC Java code with 60 classes. I suspect there is a bug in your code. If you posted your code, we could help better.
Reply With Quote
  #3   Spotlight this post!  
Unread 26-01-2013, 12:22
Negative 9 Negative 9 is offline
Registered User
FRC #0611
 
Join Date: Dec 2012
Location: Mclean, VA
Posts: 46
Negative 9 is an unknown quantity at this point
Re: Issue using code w/ multiple classes

Problem solved : )

Last edited by Negative 9 : 26-01-2013 at 20:22.
Reply With Quote
  #4   Spotlight this post!  
Unread 26-01-2013, 14:01
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Issue using code w/ multiple classes

The problem wasn't obvious off-hand, but you might try a few things:
  1. Use Test mode to verify that the motors are all working. Run SmartDashboard then using the Driver Station, put the robot in Test mode. You'll see sliders for each of the motors. You can move them to make sure that the motors are properly connected. Be sure you have the most recent update to the Netbeans plugin for this to work. Look here for some help: http://wpilib.screenstepslive.com/s/...ode-livewindow
  2. You might consider using the WPILib RobotDrive object. It will support mecanum drive, tank drive, and arcade drive and has been used successfully by many teams. Look at the example here:
    http://wpilib.screenstepslive.com/s/...botdrive-class

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
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 10:08.

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