Thread: CANJaguar
View Single Post
  #14   Spotlight this post!  
Unread 20-01-2012, 19:49
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

Thank you for your replies. No matter what we try we cannot seem to get our robot to move. This is the code I have been trying:
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; 
    
    public void robotInit() {
 
  
        robot = new RobotDrive(1,2,3,4);
        left = new Joystick(1);
        right = new Joystick(2);
        System.out.println("RobotInit() completed.");
    }

    public void autonomousPeriodic() {

    }

    public void teleopPeriodic() {
        //robot.tankDrive(left.getThrottle(),(-1*right.getThrottle()));
        //robot.tankDrive(left, right);

        robot.tankDrive(2,2);
        
        //System.out.println("left:"+left.getThrottle());
        //System.out.println("right:"+right.getThrottle());
        //System.out.println("LMAG:"+ left.getMagnitude());
        //System.out.println("RMAG:"+ right.getMagnitude());

    }
    
}
the getThrottle() method always returns a 0 regardless of what we do to the joystick. The getMagnitude() method show change as we move the joystick. However, what worries me is that the robot doesn't seem to move even if i input doubles into the tankDrive() method. The jaguars lights should stop blinking and become solid when they are receiving a signal right? They never seem to do this and stay blinking no matter what.
Reply With Quote