Go to Post Sadly this bot uses better punctuation and capitalization than many on this site. - Andrew Schreiber [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 Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 01-20-2012, 09:06 PM
kingkurry kingkurry is offline
Registered User
FRC #4067
 
Join Date: Jan 2012
Location: Maryland
Posts: 20
kingkurry is an unknown quantity at this point
Re: CANJaguar

Yes I tried that as well. I declared 4 of them. Something along the lines of

SpeedController frontLeft = new Jaguar(1,1);
SpeedController rearLeft = new Jaguar(1,2);
SpeedController frontRight = new Jaguar(1,3);
SpeedController rearRight = new Jaguar(1,4);

To be honest, I am not entirely sure what the slot number on the chassis is supposed to signify, so i just used 1 because that seems to be what everyone used in the examples i have seen. For the channel number, I used the PWM slot number i connected each jaguar to on the digital side car.

Then I used the set method, passing in the throttle value from a joystick, to set the speeds. Then I passed the speed controllers into the tankDrive() method.

One more thing that i have noticed is that the the green diagnostic light in the driver station diagnostic console doesnt change color to blue when i move the sticks. It does, however, change color when i press buttons on the stick. Does this have any significance?
Reply With Quote
  #17   Spotlight this post!  
Unread 01-20-2012, 09:17 PM
nickpeq nickpeq is offline
Turing-complete
FRC #1255 (Blarglefish)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Baytown, TX
Posts: 60
nickpeq is an unknown quantity at this point
Re: CANJaguar

Quote:
Originally Posted by kingkurry View Post
Yes I tried that as well. I declared 4 of them. Something along the lines of

SpeedController frontLeft = new Jaguar(1,1);
SpeedController rearLeft = new Jaguar(1,2);
SpeedController frontRight = new Jaguar(1,3);
SpeedController rearRight = new Jaguar(1,4);

To be honest, I am not entirely sure what the slot number on the chassis is supposed to signify, so i just used 1 because that seems to be what everyone used in the examples i have seen. For the channel number, I used the PWM slot number i connected each jaguar to on the digital side car.

Then I used the set method, passing in the throttle value from a joystick, to set the speeds. Then I passed the speed controllers into the tankDrive() method.

One more thing that i have noticed is that the the green diagnostic light in the driver station diagnostic console doesnt change color to blue when i move the sticks. It does, however, change color when i press buttons on the stick. Does this have any significance?
If the code isn't working, try removing the slot number. Instantiate your Jaguars with only the PWM number. Also, I've never used "SpeedController x = new Jaguar(etc)". I believe I always use "Jaguar x = new Jaguar(blah)"... If that makes any difference.
And the dashboard is just like that. No real significance. It changes color only for button-presses.
Reply With Quote
  #18   Spotlight this post!  
Unread 01-20-2012, 09:22 PM
Kodiak's Avatar
Kodiak Kodiak is offline
Registered User
AKA: Boston
FRC #3325 (Chaos Order)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Texas
Posts: 13
Kodiak is an unknown quantity at this point
Re: CANJaguar

Quote:
Originally Posted by nickpeq View Post
If the code isn't working, try removing the slot number. Instantiate your Jaguars with only the PWM number. Also, I've never used "SpeedController x = new Jaguar(etc)". I believe I always use "Jaguar x = new Jaguar(blah)"... If that makes any difference.
And the dashboard is just like that. No real significance. It changes color only for button-presses.
I do what nick does, works just fine for me, and for Java I think the Digital Side car module is on the second slot and for Labview the 4th one, maybe you have one of the modules wrong?
Reply With Quote
  #19   Spotlight this post!  
Unread 01-21-2012, 12:31 AM
CodeYeti's Avatar
CodeYeti CodeYeti is offline
FRC Addict
AKA: Matt Coffin
FRC #0662 (Rocky Mountain Robotics)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Colorado
Posts: 81
CodeYeti is an unknown quantity at this point
Re: CANJaguar

We had some problems with things getting initiated at the beginning of the year because some standards have changed with regards to the numbering of the modules. Your digital module should be in slot 2, and then you should just remove the slot number from the lines that instantiate the motors. Also, how to OTHER things connected to the sidecar work? I saw a person earlier today that had a faulty ribbon cable.
Reply With Quote
  #20   Spotlight this post!  
Unread 01-21-2012, 10:14 AM
Mike Copioli's Avatar
Mike Copioli Mike Copioli is offline
You make it pretty We make it dance
no team (Retired(3539, 217))
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2001
Location: Romeo
Posts: 453
Mike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond repute
Re: CANJaguar

Quote:
Originally Posted by dyanoshak View Post
Bryscus is correct:

We found that 20' of cable, 100 ohm termination resistors, and ~16 Jags on a bus is a good limit for reliable operation. It may be possible to get more Jags, but the cable lengths will have to be shorter.

-David
David,

I have to disagree with you on this. According to CAN spec IS0 11898:1993(E) Table 15, the maximum cable distance for 1Mbit/second is 40 Meters not 20 feet.

We have also tested at distances much greater than 20 feet without issue using 120 Ohm's of termination on each end of the BUS.

FYI a termination resistor of 100 ohms is outside of the spec. Teams using 120 ohms resistors should have no issues related to signal reflection.
__________________
Mike Copioli
CTRE Hardware Engineer
http://www.ctr-electronics.com

Team 3539 The Byting Bull Dogs
2013 Michigan State Champions
Team 217 The Thunder Chickens
2006 World Champions
2008 World Champions
2009 Michigan State Champions
Reply With Quote
  #21   Spotlight this post!  
Unread 01-21-2012, 09:52 PM
Bryscus's Avatar
Bryscus Bryscus is offline
EE, CpE
AKA: Bryce B.
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 1999
Location: Jupiter, FL
Posts: 173
Bryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud of
Re: CANJaguar

Quote:
Originally Posted by Mike Copioli View Post
David,

I have to disagree with you on this. According to CAN spec IS0 11898:1993(E) Table 15, the maximum cable distance for 1Mbit/second is 40 Meters not 20 feet.

We have also tested at distances much greater than 20 feet without issue using 120 Ohm's of termination on each end of the BUS.

FYI a termination resistor of 100 ohms is outside of the spec. Teams using 120 ohms resistors should have no issues related to signal reflection.
From the getting started guide:

Total Cable Length
(maximum)
20 ft / 6.1m Tip: Start with this length of bulk cable and cut all
segments from it to ensure compliance.

Termination Resistance 100 At each end of the network.

Just quoting specs.

- Bryce
__________________
The opulence of the front office decor varies inversely with the fundamental solvency of the firm.
Reply With Quote
  #22   Spotlight this post!  
Unread 01-22-2012, 01:22 AM
Kodiak's Avatar
Kodiak Kodiak is offline
Registered User
AKA: Boston
FRC #3325 (Chaos Order)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Texas
Posts: 13
Kodiak is an unknown quantity at this point
Re: CANJaguar

Quote:
Total Cable Length
(maximum)
20 ft / 6.1m Tip: Start with this length of bulk cable and cut all
segments from it to ensure compliance.

Termination Resistance 100 At each end of the network.

Just quoting specs.
Hmm, it may be that 20 feet is the best length for the best outcome, but if you need more it may not be THE limit.
Reply With Quote
  #23   Spotlight this post!  
Unread 01-22-2012, 01:15 PM
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 429
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: CANJaguar

Quote:
Originally Posted by kingkurry View Post
To be honest, I am not entirely sure what the slot number on the chassis is supposed to signify, so i just used 1 because that seems to be what everyone used in the examples i have seen. For the channel number, I used the PWM slot number i connected each jaguar to on the digital side car.
For 2012 I believe the Java methods referring to "Slot" numbers essentially mean the instance of the particular card you are trying to access. I think the same is true for how LabVIEW is identifying the modules. For example: in the 8 or 4 slot cRIO chassis the DIO module in slot position two would be identified to the program as "Slot" 1. A second DIO module in slot position 4 (on the cRIO II) or slot position 6 (on the cRIO) would be identified to the program as "Slot" 2.

I think this deviates from what "Slot" meant in the past: the actual physical position the card was at (i.e. slot 4 of 8 for previous years was the slot for the first DIO module)

Again this is just what I remember from beta test, and what I've observed from my testing. If I'm wrong, let me know so I can avoid headaches down the road.
__________________
http://team2168.org
Reply With Quote
  #24   Spotlight this post!  
Unread 01-22-2012, 02:54 PM
Mike Copioli's Avatar
Mike Copioli Mike Copioli is offline
You make it pretty We make it dance
no team (Retired(3539, 217))
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2001
Location: Romeo
Posts: 453
Mike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond repute
Re: CANJaguar

Quote:
Originally Posted by Bryscus View Post
From the getting started guide:

Total Cable Length
(maximum)
20 ft / 6.1m Tip: Start with this length of bulk cable and cut all
segments from it to ensure compliance.

Termination Resistance 100 At each end of the network.

Just quoting specs.

- Bryce
The 'Getting Started Guide' is not the CAN spec, IS0 11898:1993(E) is.
__________________
Mike Copioli
CTRE Hardware Engineer
http://www.ctr-electronics.com

Team 3539 The Byting Bull Dogs
2013 Michigan State Champions
Team 217 The Thunder Chickens
2006 World Champions
2008 World Champions
2009 Michigan State Champions
Reply With Quote
  #25   Spotlight this post!  
Unread 01-22-2012, 03:20 PM
kingkurry kingkurry is offline
Registered User
FRC #4067
 
Join Date: Jan 2012
Location: Maryland
Posts: 20
kingkurry is an unknown quantity at this point
Re: CANJaguar

Quote:
Originally Posted by nickpeq View Post
If the code isn't working, try removing the slot number. Instantiate your Jaguars with only the PWM number. Also, I've never used "SpeedController x = new Jaguar(etc)". I believe I always use "Jaguar x = new Jaguar(blah)"... If that makes any difference.
And the dashboard is just like that. No real significance. It changes color only for button-presses.
I just tried instantiating the jaguars without a slot number. This didn't work either. This is the code I have been trying. I have also tried all the code that I commented out, still without results

Code:
package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Watchdog;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Jaguar;

public class RobotTemplate extends IterativeRobot {
    RobotDrive robot;
    Joystick left;
    Joystick right; 
    Jaguar leftFront;
    Jaguar leftRear;
    Jaguar rightFront;
    Jaguar rightRear;
    
    public void robotInit() {
        Jaguar leftFront = new Jaguar(1);
        Jaguar leftRear= new Jaguar(2);
        Jaguar rightFront= new Jaguar(3);
        Jaguar rightRear= new Jaguar(4);
        
        robot = new RobotDrive(leftFront,leftRear,rightFront,rightRear);
  
        //robot = new RobotDrive(1,2,3,4);
        left = new Joystick(1);
        right = new Joystick(2);
        System.out.println("RobotInit() completed.\n");
    }
    
    public void disabledContinuous(){
        leftFront.set(1);
        //robot.tankDrive(1,1);
        
        
    }
    
    public void disabledPeriodic(){
        leftFront.set(1);
        //robot.tankDrive(1,1);
    }

    public void autonomousPeriodic() {
        leftFront.set(1);
        //robot.tankDrive(1,1);

    }
    
    public void teleopContinuous(){
        leftFront.set(1);
        //robot.tankDrive(1,1);
    }

    public void teleopPeriodic() {
        //robot.tankDrive(left.getThrottle(),(-1*right.getThrottle()));
        leftFront.set(1);
        //rightFront.set(right.getMagnitude());
        //robot.tankDrive(leftFront.get(), rightFront.get());
        
        //robot.tankDrive(left, right);
        //robot.tankDrive(1,1);
       
        
        //System.out.println("left:"+left.getThrottle());
        //System.out.println("right:"+right.getThrottle());
        //System.out.println("LMAG:"+ left.getMagnitude());
        //System.out.println("RMAG:"+ right.getMagnitude());
        //System.out.println("LRAD"+left.getDirectionDegrees());
        //System.out.println("RRAD"+right.getDirectionDegrees());
        
        System.out.println("Tank Drive");
    }
    
}
As you can see, I have tried to create a robot drive specifying the pwm outputs, then driving it with tankDrive(2,2)

I have also tried creating jaguar objects and setting their speed manually. Again this did not work.

I even took a multimeter to my sidecar, testing each of the signal pins in both the 3 pin PWM and the 3 pin Digital I/O. No matter what code I tried, the signal pins never presented any current.

What do you guys think the problem could be? My code looks fine right? Could it be the ribbon cable connecting the cRIO to the sidecar?
Reply With Quote
  #26   Spotlight this post!  
Unread 01-22-2012, 05:02 PM
Bryscus's Avatar
Bryscus Bryscus is offline
EE, CpE
AKA: Bryce B.
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 1999
Location: Jupiter, FL
Posts: 173
Bryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud ofBryscus has much to be proud of
Quote:
Originally Posted by Mike Copioli View Post
The 'Getting Started Guide' is not the CAN spec, IS0 11898:1993(E) is.
Mike,

This wouldn't be the first time a device isn't fully compliant with a spec. One thing I've learned in the industry is that if you design a system to the spec of a bus and not that of a part you'll get burned every time - SPI, I2C, EBI, you name it. The reason microprocessors have so many options for these buses is that parts are so varied.

- Bryce
__________________
The opulence of the front office decor varies inversely with the fundamental solvency of the firm.

Last edited by Bryscus : 01-22-2012 at 05:17 PM.
Reply With Quote
  #27   Spotlight this post!  
Unread 01-22-2012, 05:37 PM
dyanoshak dyanoshak is offline
Registered User
AKA: David Yanoshak
FRC #2158 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Austin, TX
Posts: 189
dyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond repute
Re: CANJaguar

Quote:
Originally Posted by Mike Copioli View Post
David,

I have to disagree with you on this. According to CAN spec IS0 11898:1993(E) Table 15, the maximum cable distance for 1Mbit/second is 40 Meters not 20 feet.

We have also tested at distances much greater than 20 feet without issue using 120 Ohm's of termination on each end of the BUS.

FYI a termination resistor of 100 ohms is outside of the spec. Teams using 120 ohms resistors should have no issues related to signal reflection.
Yes, that is what the CAN spec says. However, I am talking about what we specify for Jaguar.

They differ in the following ways:
  • CAN Spec states 40 meter cable lengths using twisted pair cable
    • Jaguar uses non-twisted modular cable
  • CAN Spec states 120 ohm terminators
    • TI specifies 100 ohm terminators for the following reasons:
The concern is with bit timing, not signal reflections.

Ideally each Jaguar would be configured with its own specific bit-timing parameters (parameters that define when the CAN module samples the bit). These parameters depend on a lot of factors including location on the bus, bus impedance, the number of drivers on the bus, etc.

In this specific application (FRC) a lot of those factors are unknown. What works for one setup may not work as well for another. During our testing of Jaguar we found that as the number of Jaguars increased and the cable lengths got longer, some Jaguars would not sample the bits correctly. We saw that the bus was taking longer to transition from the dominant to recessive states fast enough when every CAN driver on the bus was driving dominant.

We were able to successfully improve the timing by lowering the resistance of the terminator to 100 ohms. The lower resistance helped pull the CANH and CANL to the recessive state much faster. We also found that minimizing the cable lengths between the Jaguars helped a bit too.

The bottom line:

TI specifies 100 ohm termination resistors and ~20' total of cabling. This differs from the official ISO specification for CAN, but should ensure that teams have the best experience with the Jaguar when using CAN.

-David
Reply With Quote
  #28   Spotlight this post!  
Unread 01-22-2012, 09:38 PM
Mike Copioli's Avatar
Mike Copioli Mike Copioli is offline
You make it pretty We make it dance
no team (Retired(3539, 217))
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2001
Location: Romeo
Posts: 453
Mike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond repute
Re: CANJaguar

Quote:
Originally Posted by dyanoshak View Post
Yes, that is what the CAN spec says. However, I am talking about what we specify for Jaguar.

They differ in the following ways:
  • CAN Spec states 40 meter cable lengths using twisted pair cable
    • Jaguar uses non-twisted modular cable
  • CAN Spec states 120 ohm terminators
    • TI specifies 100 ohm terminators for the following reasons:
The concern is with bit timing, not signal reflections.

Ideally each Jaguar would be configured with its own specific bit-timing parameters (parameters that define when the CAN module samples the bit). These parameters depend on a lot of factors including location on the bus, bus impedance, the number of drivers on the bus, etc.

In this specific application (FRC) a lot of those factors are unknown. What works for one setup may not work as well for another. During our testing of Jaguar we found that as the number of Jaguars increased and the cable lengths got longer, some Jaguars would not sample the bits correctly. We saw that the bus was taking longer to transition from the dominant to recessive states fast enough when every CAN driver on the bus was driving dominant.

We were able to successfully improve the timing by lowering the resistance of the terminator to 100 ohms. The lower resistance helped pull the CANH and CANL to the recessive state much faster. We also found that minimizing the cable lengths between the Jaguars helped a bit too.

The bottom line:

TI specifies 100 ohm termination resistors and ~20' total of cabling. This differs from the official ISO specification for CAN, but should ensure that teams have the best experience with the Jaguar when using CAN.

-David
Dave,

Our findings tell a different story. I would be happy to share them with you.
__________________
Mike Copioli
CTRE Hardware Engineer
http://www.ctr-electronics.com

Team 3539 The Byting Bull Dogs
2013 Michigan State Champions
Team 217 The Thunder Chickens
2006 World Champions
2008 World Champions
2009 Michigan State Champions
Reply With Quote
  #29   Spotlight this post!  
Unread 01-23-2012, 01:19 AM
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 429
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: CANJaguar

Quote:
Originally Posted by kingkurry View Post
I just tried instantiating the jaguars without a slot number. This didn't work either. This is the code I have been trying. I have also tried all the code that I commented out, still without results

Code:
package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Watchdog;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.Jaguar;

public class RobotTemplate extends IterativeRobot {
    RobotDrive robot;
    Joystick left;
    Joystick right; 
    Jaguar leftFront;
    Jaguar leftRear;
    Jaguar rightFront;
    Jaguar rightRear;
    
    public void robotInit() {
        Jaguar leftFront = new Jaguar(1);
        Jaguar leftRear= new Jaguar(2);
        Jaguar rightFront= new Jaguar(3);
        Jaguar rightRear= new Jaguar(4);
        
        robot = new RobotDrive(leftFront,leftRear,rightFront,rightRear);
  
        //robot = new RobotDrive(1,2,3,4);
        left = new Joystick(1);
        right = new Joystick(2);
        System.out.println("RobotInit() completed.\n");
    }
I believe you have a scope problem.
You instantiate your jaguars as class variables (green lines), then create four new jaguar variables within the robotInit() method (red lines). You're not initializing the class variables as you may think. Basically you're telling the program that within the robotInit() class it should use the local copies of those Jag variables (red), instead of the ones the rest of the program knows about (green). Any reference to the Jag variables outside of the robotInit() method will refer to the ones that aren't initialized (green), and since they aren't initialized they won't be sending commands to any motor controllers.

Remove the "Jaguar" text thats highlighted red and that should fix your problem.

Read up on scope: http://sip.clarku.edu/tutorials/java/java.html#scope
__________________
http://team2168.org
Reply With Quote
  #30   Spotlight this post!  
Unread 01-23-2012, 02:11 AM
Kodiak's Avatar
Kodiak Kodiak is offline
Registered User
AKA: Boston
FRC #3325 (Chaos Order)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Texas
Posts: 13
Kodiak is an unknown quantity at this point
Re: CANJaguar

Quote:
Originally Posted by otherguy View Post
I believe you have a scope problem.
You instantiate your jaguars as class variables (green lines), then create four new jaguar variables within the robotInit() method (red lines). You're not initializing the class variables as you may think. Basically you're telling the program that within the robotInit() class it should use the local copies of those Jag variables (red), instead of the ones the rest of the program knows about (green). Any reference to the Jag variables outside of the robotInit() method will refer to the ones that aren't initialized (green), and since they aren't initialized they won't be sending commands to any motor controllers.

Remove the "Jaguar" text thats highlighted red and that should fix your problem.

Read up on scope: http://sip.clarku.edu/tutorials/java/java.html#scope
Yup, he is right, you having that is like pretty much trying to make two jaguars of the same variable name, and in any programming language you can't simply do that.
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 08:44 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