|
Re: Unresponsive Code... Help Please?
Still no luck, how exactly do you initalize a command? the cookbook says it's supposed to happen automatically when the joystick is pressed...
David, I have this in Sweeper.java. is this not "constructed" as you say:
public class Sweeper extends Subsystem {
Victor sweep;
public void initDefaultCommand() {
setDefaultCommand(new SweepStop());
}
public Sweeper(){
sweep = new Victor(RobotMap.sweeperMotor);
}
}
Since my last post I added a getInstance method to the DriveTrain subsystem as Mr Lim's suggested. I also got rid of all subsystems except for the DriveSystem and the commands pertaining to that just to rule out any conflicts. This includes the Sweeper subsystem and commands.
line 55 in pleasework.java is this, doesn't that need to be there?
public void teleopInit() {
autonomousCommand.cancel();
}
i commented it out to just to give it a try and it gets rid of the null pointer but still no movement in the robot.
Now, the last few lines in Netbeans' output window show:
[cRIO] Default IterativeRobot.disabledInit() method... Overload me!
[cRIO] Default IterativeRobot.disabledContinuous() method... Overload me!
[cRIO] Default IterativeRobot.disabledPeriodic() method... Overload me!
[cRIO] teleopInit
[cRIO] edu.wpi.first.wpilibj.util.AllocationException: PWM channel 2 on module 1 is already allocated
[cRIO] at edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:t edu.wpi.first.wpilibj.RobotDrive.<init>(RobotDrive .java:110)
[cRIO] at edu.wpi.first.wpilibj.templates.subsystems.DriveTr ain.<init>(DriveTrain.java:41)
[cRIO] at edu.wpi.first.wpilibj.templates.subsystems.DriveTr ain.getInstance(DriveTrain.java:30)
[cRIO] at edu.wpi.first.wpilibj.templates.commands.DriveWith Joy.<init>(DriveWithJoy.java:27)
[cRIO] at edu.wpi.first.wpilibj.templates.subsystems.DriveTr ain.initDeat edu.wpi.first.wpilibj.templates.pleasework.teleopP eriodic(pleasework.java:70)
[cRIO] at edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:145)
[cRIO] at edu.wpi.first.wpilibj.RobotBase.startApp(RobotBase .java:156)
[cRIO] in virtual method #10 of javax.microedition.midlet.MIDlet(bci=17)
[cRIO] at javax.microedition.midlet.MIDletTunnelImpl.callSta rtApp(64)
[cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(110)
[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)
[cRIO] WARNING: Robots don't quit!
[cRIO] ---> The startCompetition() method (or methods called by it) should have handled the exception above.
[cRIO] Robot Drive... Output not updated often enough.
[cRIO] Robot Drive... Output not updated often enough.
__________________
Wendy
Team 3502
|