That did it. The jaguars were blinking as if they were receiving no signal. I started nosing around at the wiring and found that the signal cables were reversed. Thanks guys. The final problems found were as follows:
24v was being handed out to the ni9201 instead of 12v.
the command cables from the sidecar were plugged in backwards.
The getX(),getY() needed to be added.
After all that, it's driving and receiving commands. Thank you guys for helping me tackle getting this thing up and running. For reference, the final successful code for our tank drive template is as follows:
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. */
/*----------------------------------------------------------------------------*/
/*
* Ground Zero Template
* This Template is to be utilized to troubleshoot the robot. Please make no
* changes to this code. It's to be copied and branched off of for new projects
* and is for reference only.
*/
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Relay.Value;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the SimpleRobot
* 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 GroundZeroTemplate extends SimpleRobot {
RobotDrive drive = new RobotDrive(1,2);
Joystick leftStick = new Joystick(1);
Joystick rightStick = new Joystick(2);
Relay firingMechanism;
public void robotInit() {
firingMechanism = new Relay(1);
}
/**
* This function is called once each time the robot enters autonomous mode.
*/
public void autonomous() {
/*getWatchdog().setEnabled(true);
getWatchdog().setExpiration(0.5);
drive.drive(1,0);
Timer.delay(2);
drive.drive(0,0);*/
for (int i = 0; i < 4; i++) {
drive.drive(0.5, 0.0); // drive 50% fwd 0% turn
Timer.delay(2.0); // wait 2 seconds
drive.drive(0.0, 0.75); // drive 0% fwd 0% turn
}
}
/**
* This function is called once each time the robot enters operator control.
*/
public void operatorControl() {
while (true && isOperatorControl() && isEnabled()) // loop until change
{
drive.tankDrive(leftStick.getY(), rightStick.getX()); // drive w/ joysticks
Timer.delay(0.005);
System.out.println("Left: "+leftStick.getX()+", "+leftStick.getY());
System.out.println("Right: "+rightStick.getX()+"' "+rightStick.getY());
if(rightStick.getTrigger()){
firingMechanism.set(Value.kReverse);
}
if(leftStick.getTrigger()){
firingMechanism.set(Value.kForward);
}
}
}
}