Go to Post With one post, Mr. Miller joins the top 0.7% of Chief Delphi, reputation-wise. I think the community supports him. - Taylor [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-19-2013, 02:49 PM
Zonder Zonder is offline
Registered User
FRC #2634
 
Join Date: Feb 2013
Location: Toronto
Posts: 1
Zonder is an unknown quantity at this point
Javadoc not found, victors not responding

Hi, I'm a programmer for team 2634
and we're having some MAJOR problems with the robot. The code builds, deploys, and runs fine, but nothing on the robot seems to respond. For example if push a button that is supposed to make a motor run the motor will not run, but if I put a print command the word is printed with no issues.

The victors are blinking orange. Under all the imported files it says "Javadoc not found" This happens even If I manually locate the file.

I have checkd all the wiring and the pwms multiple times. Everything mechanical and electrical on the robot is 100% correct from what I can tell. My code is below

Code:
package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Servo;
import edu .wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Victor;

/**
 * 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 {
    public Joystick stick = new Joystick(1);
    public Servo flag = new Servo(3);
    public Victor armX = new Victor(1);
    public Victor armY = new Victor(2);
    public DigitalInput switch1 = new DigitalInput(1);
   
    
     /**
     * 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() {
       
    double stickX = stick.getX();
    
    armX.setPosition(stickX*0.25);
    
    double throttle = stick.getThrottle();
    
    if(stick.getRawButton(3)){
        armY.set(stickX/throttle);
        System.out.println("Button 3 pressed");
    }
    if(switch1.get()){
        armX.set(0.2);
        Timer.delay(0.2);
        armX.set(0.0);
    }
    }
    
     
    public void test() {
    }
}
Reply With Quote
  #2   Spotlight this post!  
Unread 02-19-2013, 04:35 PM
pblankenbaker pblankenbaker is offline
Registered User
FRC #0868
 
Join Date: Feb 2012
Location: Carmel, IN, USA
Posts: 102
pblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of lightpblankenbaker is a glorious beacon of light
Re: Javadoc not found, victors not responding

Your program extends the SimpleRobot class. When you create a program using this as your base class, your operatorControl() method is called exactly one time during the match. So, you want to place the code you want to run inside a while loop. For example in the following, I renamed your method to "checkUserInputs()" and updated the operatorControl() method to call your method continuously while the robot is enabled and in the teleop period:

Code:
    /*
     * This function checks for and reacts to user inputs.
     */
    public void checkUserInputs() {
       
    double stickX = stick.getX();
    
    armX.setPosition(stickX*0.25);
    
    double throttle = stick.getThrottle();
    
    if(stick.getRawButton(3)){
        armY.set(stickX/throttle);
        System.out.println("Button 3 pressed");
    }
    if(switch1.get()){
        armX.set(0.2);
        Timer.delay(0.2);
        armX.set(0.0);
    }
    }

    /*
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl() {
       while (isOperatorControl() && isEnabled()) {
          checkUserInputs();
       }
    }
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 07:49 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