Go to Post There will inevitably be enough unintentional failure in any endeavor we take on that adding intentional failure on top of that seems unnecessary. - Jared Russell [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 20-12-2011, 18:05
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
Robot getting disabled?

I just managed to deploy the code to the cRIO. For some reason, my sample code doesn't seems to be firing.


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


import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.RobotDrive;
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 {
    /**
     * This function is called once each time the robot enters autonomous mode.
     */
    public void autonomous() {
        RobotDrive drive = new RobotDrive(1, 2);
        for (int i=0; i<4; i++){
            System.out.println("Running drive " + i);
            drive.drive(0.5, 0);
            Timer.delay(2);
        }
        
    }

    /**
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl() {

    }
}
Here's the last 2 entry in the log:
Code:
[cRIO] Default robotInit() method running, consider providing your own
[cRIO] Default disabled() method running, consider providing your own

Also BTW how do I compile on linux and deploy on windows? (I'm fine with ant)
Reply With Quote
  #2   Spotlight this post!  
Unread 20-12-2011, 18:51
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Robot getting disabled?

I don't see what the problem is - you didn't define the methods robotInit() or disabled(), so the default ones are used, which just print the messages you're seeing. From what I'm seeing, the robot shouldn't do anything until autonomous is enabled, and then it drive forward at half power for 8 seconds.

As for compiling on linux and deploying on windows, I believe that deploying simply entails FTPing onto the robot (which is simpler than it sounds, you just use windows explorer) and putting the correct file in the correct place. So, once you figure out the correct file, you can just copy that from linux to windows.
Reply With Quote
  #3   Spotlight this post!  
Unread 20-12-2011, 19:01
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
Re: Robot getting disabled?

How would I enable autonomous mode?
Reply With Quote
  #4   Spotlight this post!  
Unread 20-12-2011, 20:03
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Robot getting disabled?

Once the code is loaded onto the robot, you start up the driver station, press the autonomous switch, then press enable.

Check out here for more info about how to "do" the control system. The "installing the driver station software on a non-classmate" may be helpful if you don't have it. This may also be helpful.
Reply With Quote
  #5   Spotlight this post!  
Unread 25-12-2011, 02:49
Kevin Wang's Avatar
Kevin Wang Kevin Wang is offline
Software Engineer, Webmaster
FRC #0694 (StuyPulse)
Team Role: Alumni
 
Join Date: Jun 2010
Rookie Year: 2010
Location: New York
Posts: 28
Kevin Wang is an unknown quantity at this point
Re: Robot getting disabled?

As a side note, I recommend making drive an instance variable so that it can be accessed from other methods as well.
__________________
Reply With Quote
  #6   Spotlight this post!  
Unread 26-12-2011, 23:25
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: Robot getting disabled?

we usually use iterative mode, but isnt there supposed to be a main method that calls the mode? Making a guess here, being that its been a while since ive looked at simplerobot
__________________
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 11:17.

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