Go to Post Why silence the rude ones and naysayers when you could have the students learn to deal with them? - JackG [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 06-02-2012, 17:34
yBother yBother is offline
Registered User
FRC #2198
 
Join Date: Feb 2012
Location: Toronto
Posts: 3
yBother is an unknown quantity at this point
Question Jaguar Programming with NetBeans

Greetings! We're trying to program our Jaguar, but it does not respond to the commands that we copied from the official PDF. Can someone please take a look:

Here's our codes regarding the Jaguar:

private testJaguar;
testJaguar = new Jaguar(1);

testJaguar.setSafetyEnabled(true);
testJaguar.set(testJoystick.getY());

No error message appeared on the NetBeans, but we can't get control over the Jaguar.

THANKS SO MUCH!
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2012, 17:39
neal's Avatar
neal neal is offline
Neal
FRC #1777 (Viking Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: United States
Posts: 56
neal is an unknown quantity at this point
Re: Jaguar Programming with NetBeans

Have you declared testJoystick?

Are you sure the Jaguar is connected on the port 1 of the Digital Sidecar that is connected to module 1 on the cRIO?

Is the Jaguar light changing to red/green or is it always at yellow?

Last edited by neal : 06-02-2012 at 17:42.
Reply With Quote
  #3   Spotlight this post!  
Unread 07-02-2012, 17:13
yBother yBother is offline
Registered User
FRC #2198
 
Join Date: Feb 2012
Location: Toronto
Posts: 3
yBother is an unknown quantity at this point
Re: Jaguar Programming with NetBeans

Quote:
Originally Posted by neal View Post
Have you declared testJoystick?

Are you sure the Jaguar is connected on the port 1 of the Digital Sidecar that is connected to module 1 on the cRIO?

Is the Jaguar light changing to red/green or is it always at yellow?
The joystick is declared in the beginning.

The Jaguar is for sure connected to module 1.

And the light on the Jaguar is always blinking at yellow.
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2012, 22:06
severhale severhale is offline
Registered User
FRC #4097
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Northampton, MA
Posts: 10
severhale is an unknown quantity at this point
Re: Jaguar Programming with NetBeans

The fact that you're not getting any errors means that testJoystick is declared, but does it have a value? Are you saying
testJoystick = new Joystick(portNumber);
If you're not, you'd be getting a null pointer exception in the console.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-02-2012, 17:14
yBother yBother is offline
Registered User
FRC #2198
 
Join Date: Feb 2012
Location: Toronto
Posts: 3
yBother is an unknown quantity at this point
Re: Jaguar Programming with NetBeans

Quote:
Originally Posted by severhale View Post
The fact that you're not getting any errors means that testJoystick is declared, but does it have a value? Are you saying
testJoystick = new Joystick(portNumber);
If you're not, you'd be getting a null pointer exception in the console.
It is declared as testJoystick = new Joystick (1);

Is there anything else we need to do?
Reply With Quote
  #6   Spotlight this post!  
Unread 07-02-2012, 18:04
neal's Avatar
neal neal is offline
Neal
FRC #1777 (Viking Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2009
Location: United States
Posts: 56
neal is an unknown quantity at this point
Re: Jaguar Programming with NetBeans

Quote:
Originally Posted by yBother View Post
It is declared as testJoystick = new Joystick (1);

Is there anything else we need to do?
In the Setup tab in Driver Station, do you see your joystick in port 1?
Reply With Quote
  #7   Spotlight this post!  
Unread 08-02-2012, 16:23
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: Jaguar Programming with NetBeans

Quote:
Originally Posted by yBother View Post
Greetings! We're trying to program our Jaguar, but it does not respond to the commands that we copied from the official PDF. Can someone please take a look:

Here's our codes regarding the Jaguar:

private testJaguar;
testJaguar = new Jaguar(1);

testJaguar.setSafetyEnabled(true);
testJaguar.set(testJoystick.getY());

No error message appeared on the NetBeans, but we can't get control over the Jaguar.

THANKS SO MUCH!
Is your code in a loop in the OperatorControl part of the program? If not, it will execute once and exit.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #8   Spotlight this post!  
Unread 09-02-2012, 03:15
Patrick Chiang Patrick Chiang is offline
Programming
FRC #3070 (Team Pronto)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Seattle
Posts: 162
Patrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to allPatrick Chiang is a name known to all
Re: Jaguar Programming with NetBeans

Try putting:
Code:
System.out.println(testJoystick.getY());
somewhere in your code.

This will print out the values of your joystick so you can see if the problem is with the jaguars or with the joystick.

Also, as people have mentioned, you need to put the code in a loop.

These are the possible loops for an IterativeRobot implementation:
Code:
RobotInit
DisabledInit
DisabledPeriodic/DisabledContinuous
AutonomousInit
AutonomousPeriodic/AutonomousContinuous
TeleopInit
TeleopPeriodic/TeleopContinuous
Now, you probably want to put it in TeleopPeriodic(). If you put it in any ----Init() method, it will run it only once. Periodic methods run at a rate that's clocked to the FPGA, and continuous methods run as fast as possible. You want to put most of your code in periodic.
Reply With Quote
  #9   Spotlight this post!  
Unread 09-02-2012, 11:30
eddie12390's Avatar
eddie12390 eddie12390 is offline
Registered User
AKA: Eddie
FRC #3260 (SHARP)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Pittsburgh
Posts: 285
eddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of light
Re: Jaguar Programming with NetBeans

Can you post the entirety of your code? It would make diagnosing problems much easier.
Reply With Quote
  #10   Spotlight this post!  
Unread 09-02-2012, 16:19
Daniel Daniel is offline
Daniel Katanski
#0240
Team Role: Mentor
 
Join Date: Feb 2004
Location: Monroe, MI
Posts: 32
Daniel is on a distinguished road
Re: Jaguar Programming with NetBeans

Do not put your code in AutonomousContinuous or AutonomousPeriodic... These routines never get updates from the operator interface. You should use TeleopPeriodic this gets called only when there is a new message from the operator interface. (Been there, done that.)
Reply With Quote
  #11   Spotlight this post!  
Unread 14-02-2012, 20:26
Herbblood's Avatar
Herbblood Herbblood is offline
Knowledgeable
AKA: Ally
FRC #3044 (OxBE4)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2008
Location: Ballston Spa
Posts: 247
Herbblood is an unknown quantity at this point
Re: Jaguar Programming with NetBeans

You said the light was blinking on the jaguar, that means it is not getting the code, find electrical to check wires and make sure you have the right ports!
__________________
Off to WPI!
Go OxBE4
Reply With Quote
  #12   Spotlight this post!  
Unread 15-02-2012, 04:02
NotInControl NotInControl is offline
Controls Engineer
AKA: Kevin
FRC #2168 (Aluminum Falcons)
Team Role: Engineer
 
Join Date: Oct 2011
Rookie Year: 2004
Location: Groton, CT
Posts: 261
NotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond repute
Re: Jaguar Programming with NetBeans

as mentioned before... if you enable the robot and the light on the jags are still blinking then that means the jag is not properly receiving communication from the digital side car... it should go solid even if your joystick didn't work or if you had no joystick at all.

A blinking light indicated bad comms. This is true for jags and victors.

I would start by making sure your cables work and plugged in correctly. Make sure you are plugged into the PWM slot and not the DIO slot for example.

Then I would look so see where you are instantiating the new jag... you should be instantiating the new jag in RobotInit, AutoInit, or Teleop Init...

Once you have a solid light when the robot is enabled then I would make sure to call the set() method in a loop like teleop period, and you might want to use joystick.getrawaxis( # ) instead of gety() if you still cant command the jags.
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:39.

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