joelg236
31-01-2013, 20:19
We have reimaged the CRIO with the slots in 1,3 and 4 (1=analog,3=pneumatic,4=digital) and deployed code where the speed controllers are declared using
SpeedController s = new Talon(4,1);
The digital sidecar is powered and works when in slot 2. The digital sidecar is powered and works when in slot 2.
Output when deployed:
[cRIO] Digital module 4 is not present.
[cRIO] Uncaught exception in Thread.run():
[cRIO] on thread testing.Test - main
[cRIO] edu.wpi.first.wpilibj.util.AllocationException: PWM channel 1 on module 4 is already allocated
[cRIO] at edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:116)
[cRIO] at edu.wpi.first.wpilibj.PWM.<init>(PWM.java:135)
[cRIO] at edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java:43)
[cRIO] at edu.wpi.first.wpilibj.Talon.<init>(Talon.java:59)
[cRIO] at testing.Test.<init>(Test.java:26)
[cRIO] in virtual method #11 of com.sun.squawk.Klass(bci=53)
[cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(99)
[cRIO] in virtual method #95 of com.sun.squawk.Klass(bci=25)
[cRIO] at com.sun.squawk.Isolate.run(1506)
[cRIO] at java.lang.Thread.run(231)
[cRIO] in virtual method #47 of com.sun.squawk.VMThread(bci=42)
[cRIO] in static method #3 of com.sun.squawk.VM(bci=6)
We made a new project with only creating objects and it still gave this error. I am 100% sure it does not instantialize the object more than once. Any ideas?
Full code of test:
public class Test extends IterativeRobot {
private Joystick j = new Joystick(1);
private SpeedController s1 = new Talon(4, 1),
s2 = new Talon(4, 2),
s3 = new Jaguar(4, 3),
s4 = new Jaguar(4, 4),
s5 = new Jaguar(4, 5),
s6 = new Jaguar(4, 6);
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
double speed = j.getRawAxis(3);
SmartDashboard.putNumber("Speed", speed);
s1.set(speed);
s2.set(speed);
s3.set(speed);
s4.set(speed);
s5.set(speed);
s6.set(speed);
}
}
SpeedController s = new Talon(4,1);
The digital sidecar is powered and works when in slot 2. The digital sidecar is powered and works when in slot 2.
Output when deployed:
[cRIO] Digital module 4 is not present.
[cRIO] Uncaught exception in Thread.run():
[cRIO] on thread testing.Test - main
[cRIO] edu.wpi.first.wpilibj.util.AllocationException: PWM channel 1 on module 4 is already allocated
[cRIO] at edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:116)
[cRIO] at edu.wpi.first.wpilibj.PWM.<init>(PWM.java:135)
[cRIO] at edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java:43)
[cRIO] at edu.wpi.first.wpilibj.Talon.<init>(Talon.java:59)
[cRIO] at testing.Test.<init>(Test.java:26)
[cRIO] in virtual method #11 of com.sun.squawk.Klass(bci=53)
[cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(99)
[cRIO] in virtual method #95 of com.sun.squawk.Klass(bci=25)
[cRIO] at com.sun.squawk.Isolate.run(1506)
[cRIO] at java.lang.Thread.run(231)
[cRIO] in virtual method #47 of com.sun.squawk.VMThread(bci=42)
[cRIO] in static method #3 of com.sun.squawk.VM(bci=6)
We made a new project with only creating objects and it still gave this error. I am 100% sure it does not instantialize the object more than once. Any ideas?
Full code of test:
public class Test extends IterativeRobot {
private Joystick j = new Joystick(1);
private SpeedController s1 = new Talon(4, 1),
s2 = new Talon(4, 2),
s3 = new Jaguar(4, 3),
s4 = new Jaguar(4, 4),
s5 = new Jaguar(4, 5),
s6 = new Jaguar(4, 6);
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
double speed = j.getRawAxis(3);
SmartDashboard.putNumber("Speed", speed);
s1.set(speed);
s2.set(speed);
s3.set(speed);
s4.set(speed);
s5.set(speed);
s6.set(speed);
}
}