Go to Post Nothing is perfect - but AM is a phenomenal company! - iambujo [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 02-08-2012, 09:40 PM
korsuk19's Avatar
korsuk19 korsuk19 is offline
Registered User
FRC #3734 (Caxy's)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Lake Forest, Illinois
Posts: 14
korsuk19 is an unknown quantity at this point
cRIO not functioning

so I am the new programmer for my team. problem is I'm new to this FRC thing.
At the moment I am trying to code our robot so that we can drive in tank drive, and have a relay spike control one of our motors (in the future have 3 relay spikes control 3 motors) that will bring the ball off ground like a crane.

This is my code:
// Define user inputs
Joystick leftStick = new Joystick(1);
Joystick rightStick = new Joystick(2);

// Define the motor controllers. Uses the Jaguar PWM Modules
Jaguar left = new Jaguar(1);
Jaguar right = new Jaguar(2);
RobotDrive drive = new RobotDrive(1, 3, 2, 4);
//relay modules please
Relay lowBall = new Relay(5);
//Relay upBall = new Relay(6); //future 2 relay's
//Relay shootBall = new Relay(7);

public void operatorControl() { //new control
//
//----------
// Human Operation Mode
//----------
while (isEnabled()) {
//
Watchdog.getInstance().feed();

DriverStationLCD.getInstance().updateLCD();

drive.tankDrive(leftStick, rightStick);
// if button pressed reverse the specified ballMotor.
if(leftStick.getRawButton(2))
lowBall.set(Relay.Value.kReverse);
else
lowBall.set(Relay.Value.kForward);

//if(leftStick.getRawButton(3))
// upBall.set(Relay.Value.kReverse);
//else
// upBall.set(Relay.Value.kForward);

//if(rightStick.getTrigger())
// shootBall.set(Relay.Value.kForward);
//else
// shootBall.set(Relay.Value.kOff);
}
}
I have all the necessary imports, I hope, here they are if it helps:
import edu.wpi.first.wpilibj.camera.AxisCamera;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Watchdog;
import edu.wpi.first.wpilibj.DriverStationLCD;
import edu.wpi.first.wpilibj.Joystick.AxisType;

Issue:
for some reason, after this code is uploaded to the cRIO, nothing happens.
nothing functions, I cannot even drive it, no motors work, nothing works.
I've tried many things, like switching from, extends SimpleRobot, to extends IterativeRobot. I've checked, re-installed, re-everything the plug-ins and what not. We have connection, and our computer is talking with the cRIO. But still nothing happens.

Question:
Does anyone know why our cRIO (robot) isn't functioning? thanks for the help in advance.
__________________
just wanna learn

Last edited by korsuk19 : 02-09-2012 at 08:19 PM. Reason: typo's
Reply With Quote
  #2   Spotlight this post!  
Unread 02-08-2012, 10:42 PM
TravSatEE's Avatar
TravSatEE TravSatEE is offline
Spacecraft Engineer and more
FRC #2035 (Robo Rockin' Bots)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2002
Location: Monterey, CA
Posts: 26
TravSatEE is infamous around these partsTravSatEE is infamous around these parts
Re: cRIO not functioning

A quick check:
- Power on the robot. Jaguars should blink yellow.
- Your digital sidecar has 3 LEDs for the different voltages. Are all 3 lit up?
- Enable the robot in teleop mode on the driver station. Jaguars should be solid yellow. If not, your digital module on the cRIO is in the wrong slot, not seated correctly in the slot, or the ribbon cable is unplugged/incorrectly made (as some of them were).

You also start your Relay at 5. Relays are not PWM outputs. Relays are off of the relay connectors on the digital sidecar. Did you realize this or is it plugged into the digital sidecar in PWM output 5?

Last edited by TravSatEE : 02-08-2012 at 10:49 PM.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-09-2012, 12:31 AM
chi-town-biker chi-town-biker is offline
Registered User
FRC #3135 (Robotic Colonels)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Chicago
Posts: 46
chi-town-biker is an unknown quantity at this point
Re: cRIO not functioning

FYI... You can't use a spike to control a CIM. You must use a power controller (Jaguar or Victor).
Reply With Quote
  #4   Spotlight this post!  
Unread 02-09-2012, 12:38 AM
jesusrambo jesusrambo is offline
Self-Proclaimed Programmer Messiah
AKA: JD Russo
FRC #2035 (Robo Rockin' Bots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Carmel, CA
Posts: 114
jesusrambo is an unknown quantity at this point
Re: cRIO not functioning

Yep, and in fact there's a rule about that (http://www.chiefdelphi.com/forums/sh...1&postcount=6). CIM motors draw too much current to be safely used with a spike, IIRC
Reply With Quote
  #5   Spotlight this post!  
Unread 02-09-2012, 12:48 AM
jesusrambo jesusrambo is offline
Self-Proclaimed Programmer Messiah
AKA: JD Russo
FRC #2035 (Robo Rockin' Bots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Carmel, CA
Posts: 114
jesusrambo is an unknown quantity at this point
Re: cRIO not functioning

doublepost

Last edited by jesusrambo : 02-10-2012 at 12:42 AM.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-09-2012, 08:44 PM
korsuk19's Avatar
korsuk19 korsuk19 is offline
Registered User
FRC #3734 (Caxy's)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Lake Forest, Illinois
Posts: 14
korsuk19 is an unknown quantity at this point
Re: cRIO not functioning

ok, today, I tried taking out the while loop I had, and took out the if statement to see if that was messing with the robot, and nothing happened still.
__________________
just wanna learn
Reply With Quote
  #7   Spotlight this post!  
Unread 02-11-2012, 03:45 PM
korsuk19's Avatar
korsuk19 korsuk19 is offline
Registered User
FRC #3734 (Caxy's)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Lake Forest, Illinois
Posts: 14
korsuk19 is an unknown quantity at this point
Re: cRIO not functioning

So, I found out some new information. NetBeans is only uploading the BuiltInDefaultCode and not the one's we have created. Is there at all a fix to this?
__________________
just wanna learn
Reply With Quote
  #8   Spotlight this post!  
Unread 02-11-2012, 03:53 PM
jesusrambo jesusrambo is offline
Self-Proclaimed Programmer Messiah
AKA: JD Russo
FRC #2035 (Robo Rockin' Bots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Carmel, CA
Posts: 114
jesusrambo is an unknown quantity at this point
Re: cRIO not functioning

Make sure you're deploying the right project. Right click your project in the Project Explorer tab and click set as main project.
Reply With Quote
  #9   Spotlight this post!  
Unread 02-11-2012, 05:24 PM
Blondie3160 Blondie3160 is offline
Registered User
FRC #3160 (F.R.O.G.)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Grove, OK
Posts: 21
Blondie3160 is an unknown quantity at this point
Re: cRIO not functioning

Quote:
Originally Posted by TravSatEE View Post
A quick check:
- Power on the robot. Jaguars should blink yellow.
- Your digital sidecar has 3 LEDs for the different voltages. Are all 3 lit up?
- Enable the robot in teleop mode on the driver station. Jaguars should be solid yellow. If not, your digital module on the cRIO is in the wrong slot, not seated correctly in the slot, or the ribbon cable is unplugged/incorrectly made (as some of them were).

You also start your Relay at 5. Relays are not PWM outputs. Relays are off of the relay connectors on the digital sidecar. Did you realize this or is it plugged into the digital sidecar in PWM output 5?


Only two of the three voltage lights on the side car are lit up. how do i get the third? i have 12v and 24v, but not 5v. help?
__________________
Blondie3160
Reply With Quote
  #10   Spotlight this post!  
Unread 02-11-2012, 05:58 PM
korsuk19's Avatar
korsuk19 korsuk19 is offline
Registered User
FRC #3734 (Caxy's)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Lake Forest, Illinois
Posts: 14
korsuk19 is an unknown quantity at this point
Re: cRIO not functioning

thanks everyone! the issue is now fixed.
I could cry tears of joy right now.

cRIO or NB one of the two wasn't keen on my class name BallBot for some reason, using the SimpleRobot extension gave errors for some reason, and I needed to identify the Main Project.
__________________
just wanna learn
Reply With Quote
  #11   Spotlight this post!  
Unread 02-12-2012, 03:20 AM
LukeS LukeS is offline
4272 mentor, 1024 alumnus
AKA: Luke Shumaker
FRC #4272
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Indianapolis, IN
Posts: 60
LukeS is an unknown quantity at this point
Re: cRIO not functioning

Quote:
Originally Posted by korsuk19 View Post
cRIO or NB one of the two wasn't keen on my class name BallBot for some reason, using the SimpleRobot extension gave errors for some reason
When you are creating your project, it will ask you for a main class name; If you change it, you need to tell Netbeans (actually, ant) by editing "build.xml".
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 03:25 PM.

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