Go to Post I can't wait to be one of those old kids who can say "Yeah, I remember the days before districts." and then watch the kid's eyes widen when I explain the days of regionals.. - rachelholladay [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-17-2010, 10:47 PM
1195mentor 1195mentor is offline
Registered User
FRC #1195
 
Join Date: Jan 2010
Location: Bowie, MD
Posts: 4
1195mentor is an unknown quantity at this point
Desperate for watchdog help

Hello,
Last year we programmed in LabView and though we would try Java this year. We are in Maryland and we have lost 2 weeks due to snowstorms and are basically back at square one with programming. Our teleoperated code keeps shutting down because we aren't feeding the watchdog though we have tried to use the examples in the Getting Started guide. I would greatly appreciate any assistance you can provide

Here is the 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. */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Joystick;
/**
* 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 Wednesday extends SimpleRobot
{
private RobotDrive drivetrain;
private Joystick leftStick;
private Joystick rightStick;

public Wednesday()
{
drivetrain = new RobotDrive(1, 2, 3, 4, 0.5); //create RobotDrive
leftStick = new Joystick(1);
rightStick = new Joystick(2);
}

public void autonomous() {

getWatchdog().setEnabled(false);
// rtimer.start();
while (true && isAutonomous() && isEnabled()) {

for (int i = 0; i < 4; i++)
{
drivetrain.drive(0.5, 0.0); // drive 50% fwd 0% turn
Timer.delay(2.0); // wait 2 seconds
drivetrain.drive(0.5, 0.75); // drive 0% fwd, 75% turn
Timer.delay(2.0); // wait 2 seconds
}
drivetrain.drive(0.0, 0.0); // drive 0% forward, 0% turn
}
}
/**
* This function is called once each time the robot enters operator control.
*/
public void OperatorControl()
{
getWatchdog().setEnabled(true);
while (true && isOperatorControl() && isEnabled()) // loop until change
{getWatchdog().feed();

// Watchdog.getInstance().feed();
drivetrain.tankDrive(leftStick, rightStick); // drive with joysticks
Timer.delay(0.005);
}
}

}


/*----------------------------------------------------------------------------*/
/* 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. */
/*----------------------------------------------------------------------------*/


Thank you very much!
Reply With Quote
  #2   Spotlight this post!  
Unread 02-17-2010, 11:57 PM
Robopanda6 Robopanda6 is offline
Registered User
FRC #2477
 
Join Date: Jan 2009
Location: Waipahu,HI
Posts: 18
Robopanda6 is an unknown quantity at this point
Re: Desperate for watchdog help

The things you could possibly do to fix problem:
1.add a robot main
2.specifly the slot of the module that connencts the CRIO to the sidecar
3.Test one part of your code at a time to see what is causing the problem

This is what our team did, hope it helps you.
Sorry if it doesn't
__________________
"They say the struggle only sweetens the success"...I guess that's why I stayed in Robotics.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-20-2010, 06:55 PM
Bro Bro is offline
Registered User
FRC #2771
 
Join Date: Feb 2010
Location: Michigan
Posts: 1
Bro is an unknown quantity at this point
Re: Desperate for watchdog help

Hi 1195,

We had watchdog woes until I adopted a new strategy.

(BTW, you don't need a robotMain() with SimpleRobot. In fact, don't include one unless you read the source for SimpleRobot and RobotBase.)

1. Feed the dog often, after every few lines--and after every line that does could pause (because it's a delay, or because it does i/o, or does a lot of math).

2. If you still have problems, comment out everything, then slowly comment lines back in until you find the one that makes the watchdog die. Tedious, but it works, and it teaches you a lot about the watchdog.

3. You can ease the pain of number 2 by increasing the watchdog time a bit.

Hats off to you for keeping the watchdog enabled! I know many teams just disable it, which isn't good practice.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-20-2010, 08:57 PM
Merle Merle is offline
FRC Mentor, FLL Coach
FRC #3146 (GRUNTS)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Granby, CT
Posts: 42
Merle has a spectacular aura aboutMerle has a spectacular aura aboutMerle has a spectacular aura about
Re: Desperate for watchdog help

I want to issue a warning to any teams experiencing intermittent watchdog timer issues... while you may see minor glitches in motion or relay actions while practicing with your router wireless connection, when you operate with the FIRST Field setup computer system (ie. when your at a competition) when you experience a watchdog error, the field system will shut down your communication for the rest of the match. We experienced this in multiple rounds at the Suffield Scrimmage today which uses the official field setup control.

So, If you are experiencing watchdog errors you MUST resolve this before competition, or you will have a dead robot on the field following your first watchdog error.

We were finally able to elimate our issue (we saw 1-4 watchdog errors per minute) by removing all unused code (LabView - we weren't using the camera, gyro, and some other solenoid controls that we dont have installed on the bot yet). We will be adding in some of our other code step by step later to see what might be causing the errors we saw. BTW, our errors were System Watchdog errors (I disabled the User watchdog for a period, but still got system type errors).

Merle Yoder
GRUNTS Team 3146
Granby, CT
Reply With Quote
  #5   Spotlight this post!  
Unread 02-21-2010, 04:41 PM
chris janney chris janney is offline
Registered User
FRC #3266
 
Join Date: Jan 2010
Location: eaton ohio
Posts: 46
chris janney is an unknown quantity at this point
Re: Desperate for watchdog help

ok so how do we disable user watchdog then.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a Full "Watchdog for idiots" explanation K Lenox NI LabVIEW 9 02-16-2010 02:10 PM
Desperate need of help MrExploiter Programming 9 02-25-2008 10:38 PM
Desperate for help in camera tracking itsme Programming 9 02-06-2007 03:55 PM
In desperate need of some help archiver 2000 0 06-23-2002 11:40 PM
desperate help Andrew Dahl General Forum 0 11-21-2001 12:08 PM


All times are GMT -5. The time now is 09:01 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi