|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Watchdog programming error
Hello everyone. I'm from team 2503 in Brainerd, Minnesota. Being the only student on the team with prior programming experience, it was up to me to design our program code this year. I am using Java this year, as it's simpler in terms of references (I originally learned C# as my first real computer language). However, I keep encountering a "watchdog not fed error on the console every time I go to run the code. This has still occurred after the 2.1/1.1 Labview/DS updates. I cannot for the life of me figure out the reason for this. The default code works fine, yet whatever I build myself does not
Some of the coding examples Ive tried are as follows: I've added this section into the default code's teleopPeriodic method just to test whether I was doing something wrong with my programming. It works perfectly. if (m_rightStick.getTrigger()) { m_robotDrive.arcadeDrive(1.0, 0.0); } If I add this following line, however, the motor runs for about a tenth of a second, then a watchdog error trips and everything shuts down. I did modify the original RobotDrive to work on only ports 1 and 2, as we have only two drive motors. This let everything still work fine. These lines were added simply to test theories, and I know its very ugly in practice). if (m_rightStick.getTop(Hand.kLeft)) { RobotDrive pulley = new RobotDrive(3,4); stuper.arcadeDrive(1.0, 0.0); } The last code segment is a full iterative robot template I've been using, and also trips the watchdog for unknown reasons. Any help will be much appreciated. Thanks. (note: I've omitted the import commands to save space). public class RobotTemplate extends IterativeRobot { /** * This function is run when the robot is first started up and should be * used for any initialization code. */ Jaguar right_drive_jaguar; Jaguar left_drive_jaguar; Jaguar pulley_motor; Joystick loneRanger; Watchdog idiot; Compressor airthing; Solenoid springLatcheron; Solenoid springLatcherback; Solenoid superKicker; boolean on_off_kicker; AxisCamera supercamerathing; double x_value; double y_value; double leftdriver; double rightdriver; public void RobotTemplate() { //create all objects this.right_drive_jaguar = new Jaguar(1); this.left_drive_jaguar = new Jaguar(2); this.pulley_motor = new Jaguar(3); this.loneRanger = new Joystick(1); this.airthing = new Compressor(1,1); this.on_off_kicker = true; this.superKicker = new Solenoid(1); this.springLatcheron = new Solenoid(2); this.springLatcherback = new Solenoid(3); //this.idiot = Watchdog.getInstance(); Watchdog.getInstance().feed(); //set all values right_drive_jaguar.set(0); left_drive_jaguar.set(0); pulley_motor.set(0); superKicker.set(false); springLatcherback.set(true); springLatcheron.set(true); airthing.start(); //this.supercamerathing = AxisCamera.getInstance(); } public void robotInit() { } public void disabledPeriodic() { //idiot.feed(); Watchdog.getInstance().feed(); } /** * This function is called periodically during autonomous */ public void autonomousPeriodic() { //idiot.feed(); right_drive_jaguar.set(.2); left_drive_jaguar.set(.2); Watchdog.getInstance().feed(); } /** * This function is called periodically during operator control */ public void teleopInit() { right_drive_jaguar.set(0); left_drive_jaguar.set(0); } public void teleopPeriodic() { //idiot.feed(); Watchdog.getInstance().feed(); this.x_value = loneRanger.getX(); this.y_value = loneRanger.getY(); right_drive_jaguar.set(x_value); left_drive_jaguar.set(y_value); if (loneRanger.getTrigger(Hand.kLeft)) { pulley_motor.set(.99); } else { pulley_motor.set(0); } } } |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| "watchdog not fed" error | Lumit | NI LabVIEW | 8 | 04-02-2010 18:45 |
| Button Programming Error? | pyr0b0y | NI LabVIEW | 5 | 06-04-2009 17:18 |
| Programming Error | chinckley | Programming | 24 | 25-02-2009 20:29 |
| CMU / RC / programming error | N7UJJ | Programming | 3 | 18-02-2005 17:05 |
| programming error | agenova | Programming | 1 | 20-02-2002 13:00 |