Go to Post if you want to repay us for the omni-wheels, use the money to help out a few rookie teams next year. Buy them batteries or help build them bumpers, anything you see fit will be much better than cash back to us. - AllenGregoryIV [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 17-01-2012, 19:50
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
Jaguar problem?

We just have the jaguars hooked up to the cRIO board and we're having some trouble with the Jaguar. We hooked the Jaguar's output to a multimeter to test our circuits.

For some reason the code is not working.

Code:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/
package frc.t4069.robots;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.Scheduler;
import frc.t4069.utils.GameController;
import frc.t4069.utils.math.Point;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class The2012Robot extends IterativeRobot {

	Command autonomousCommand;
	GameController gc = new GameController(new Joystick(1));
	Jaguar j;

	/**
	 * This function is run when the robot is first started up and should be
	 * used for any initialization code.
	 */

	public void robotInit() {
		// instantiate the command used for the autonomous period
		// autonomousCommand = new ExampleCommand();

		// Initialize all subsystems
		// CommandBase.init();
		j = new Jaguar(2, 1);
	}

	public void autonomousInit() {
		// schedule the autonomous command (example)
		// autonomousCommand.start();
	}

	/**
	 * This function is called periodically during autonomous
	 */

	public void autonomousPeriodic() {
		Scheduler.getInstance().run();
	}

	public void teleopInit() {
		// This makes sure that the autonomous stops running when
		// teleop starts running. If you want the autonomous to
		// continue until interrupted by another command, remove
		// this line or comment it out.
		// autonomousCommand.cancel();
	}

	/**
	 * This function is called periodically during operator control
	 */
	public void teleopPeriodic() {
		Scheduler.getInstance().run();
		Point rightStick = gc.getRightStick();
		System.out.println(rightStick.y);
		j.set(rightStick.y);
	}
}
The GameController code is verified to be working, and rightStick.y is a value between -1 and 1

and our Jaguar is connected to PWM1
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2012, 21:54
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: Jaguar problem?

Try removing the slot from your Jaguar object.

Code:
Jaguar j = new Jaguar(1);
Wouldn't hurt to try. We had a similar problem getting our drive train to work, and this seemed to fix it. I'm still not sure how the new cRIO slots work yet... so I guess I'll have to get back to you on that.
__________________
[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
  #3   Spotlight this post!  
Unread 17-01-2012, 22:37
cgmv123's Avatar
cgmv123 cgmv123 is online now
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,078
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: Jaguar problem?

Quote:
Originally Posted by Robby Unruh View Post
I'm still not sure how the new cRIO slots work yet... so I guess I'll have to get back to you on that.
If you have the old cRIO, any module in slots 4-3 is module 1, regardless of the slot and and module in slots 5-7 is module 2 regardless of the slot. Any module in slots 1-3 of the new cRIO is module 1 and the module in slot 4 is module 2 even though it's in slot 4. The code defaults to module 1 (slot 1, 2 or 3) unless you say otherwise. Thus, getting rid of the slot number in the code should work. It's confused a fair number of people here from what I can tell.
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)


Last edited by cgmv123 : 17-01-2012 at 22:39. Reason: new crio
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2012, 23:06
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
Re: Jaguar problem?

Quote:
Originally Posted by Robby Unruh View Post
Try removing the slot from your Jaguar object.

Code:
Jaguar j = new Jaguar(1);
Wouldn't hurt to try. We had a similar problem getting our drive train to work, and this seemed to fix it. I'm still not sure how the new cRIO slots work yet... so I guess I'll have to get back to you on that.

No effect..

and I'm also on the new cRIO

Also prehaps I should clarify that the multimeter doesn't show anything other than 0.
Reply With Quote
  #5   Spotlight this post!  
Unread 18-01-2012, 22:30
mkoval's Avatar
mkoval mkoval is offline
Registered User
AKA: Michael Koval
FRC #4281 (Bulldogs)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: New Jersey, USA
Posts: 8
mkoval has a spectacular aura aboutmkoval has a spectacular aura about
Re: Jaguar problem?

We're having the same problem. There is already some discussion about the same issue in this thread.
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 22:22.

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