View Single Post
  #1   Spotlight this post!  
Unread 10-01-2012, 17:03
krudeboy51's Avatar
krudeboy51 krudeboy51 is offline
Only Programmer
AKA: kory
FRC #0369 (369)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: brooklyn
Posts: 151
krudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of lightkrudeboy51 is a glorious beacon of light
Send a message via AIM to krudeboy51
Re: Output not updated enough

Quote:
Originally Posted by BradAMiller View Post
The RobotDrive class implements a feature called MotorSafety. What happens is that if you don't continue to supply values to the motors (or the RobotDrive object) it assumes that your program has crashed and shuts down the motors.

Can you check if you removed the myRobot.SetSafetyEnabled(false) line? It would disable the safety feature and allow the robot to continue running over the Sleep(2.0); Without disabling MotorSafety the motors will stop soon after you first started them going in an attempt to keep your robot from running with a broken program.

Brad
I added the line "myRobot.SetSafetyEnabled(false);" in the code and still the same error. I also set it to true and the same error popped up. I switched the code from C++ to Java and I would get the same error "output not updated often enough" in the deploy/run window on netbeans. Even when SetSafetyEnabled is set to true or false. I even took it completely out of the code still the same error, is there somethinig here that I am doing wrong?
here's the code:
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 com.sun.squawk.Driver;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
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 RobotTemplate extends SimpleRobot {
    RobotDrive Drive = new RobotDrive(1, 2);
    Joystick stick = new Joystick(1);
    

    
    /**robot work
     * This function is called once each time the robot enters autonomous mode.
     */
    public void autonomous() {
        
    }

    /**
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl() {
        while(isEnabled() && isAutonomous()){
            Drive.setSafetyEnabled(true);
            Drive.arcadeDrive(stick);
            Timer.delay(0.0004);
        }

    }
}
Reply With Quote