Go to Post The Indiana Mafia? We are very insulted. Another comment like that and you could wind up having a couple of broken legs. But thanks for the good words - Bill Beatty [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 09-01-2012, 20:27
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
Output not updated enough

I was showing the new students how programming works on the robot with c++ and I downloaded the simple robot template to the robot and rebooted it. After it was rebooted, I enabled the autonomous on the driverstation which would drive for about 2 seconds but nothing happened, the victors and jags were still blinking. Even when I enabled the Tele-op mode the same thing happened. I did get an error on the driverstation
Code:
ERROR: A timeout has been exceeded: RobotDrive... Output not
updated often enough. ...in Check() in C:/WindRiver/workspace/
WPILib/MotorSafetyHelper.cpp at line 123
any one knows how to fix this?

Thanks in advance!
Reply With Quote
  #2   Spotlight this post!  
Unread 09-01-2012, 22:35
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 588
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Output not updated enough

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
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute

Last edited by BradAMiller : 09-01-2012 at 22:40. Reason: wrote java answer by accident
Reply With Quote
  #3   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
  #4   Spotlight this post!  
Unread 10-01-2012, 17:38
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Output not updated enough

Quote:
Originally Posted by krudeboy51 View Post
Code:
    public void operatorControl() {
        while(isEnabled() && isAutonomous()){
            Drive.setSafetyEnabled(true);
            Drive.arcadeDrive(stick);
            Timer.delay(0.0004);
        }

    }
Your code isn't getting called. Your isAutonomous should be isOperatorControl.

Your delay is also very short, only 400 microseconds. The motors will only be updated at 5 ms, so use a delay of at least 0.005. You only get new joystick data every 20ms, so if you're only doing operator control, you can have a delay of 0.02
Reply With Quote
  #5   Spotlight this post!  
Unread 10-01-2012, 17:46
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

It works, I forgot about that. I used auto complete and did not check what was put there, Thank you!
Reply With Quote
  #6   Spotlight this post!  
Unread 15-01-2012, 11:44
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

how would I figure out how long I get back data from a HID or sensor?, is there a way to find out?
I added something else to the code now, and I am still getting the same error, I tried increasing and decreasing the delay and the same error still, I even enabled the Safety and disabled.
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.*;
/**
 * 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);
    Victor m_shooter1 = new Victor(3);
    Victor m_shooter2 = new Victor(3);
    /**
     * 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(isOperatorControl()){
            Drive.arcadeDrive(stick);
            Timer.delay(0.001);
            m_shooter1.set((stick.getThrottle()/2)-0.5);
            m_shooter1.set(((stick.getThrottle()/2)-0.5)*-1);
        }
    }
}

Last edited by krudeboy51 : 15-01-2012 at 12:49.
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


All times are GMT -5. The time now is 13:27.

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