Go to Post I wouldn't trade my FIRST experiences for the world. - Koko Ed [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 12-02-2015, 17:20
antonyebert antonyebert is offline
Registered User
FRC #4993
 
Join Date: Jan 2015
Location: NCA - Hutchinson, MN
Posts: 9
antonyebert is an unknown quantity at this point
Exclamation Running Commands

Okay so, I pretty much have my entire program done (except for the autonomous), and tried to test it out on our robot. I got everything hooked up, all the lights were on on the robot, and the driver station was giving me the go ahead. Once I hit enable though, nothing happens. I'm thinking there's a problem with my program, namely in making all of the code I wrote actually run.

In the Robot.java class (the one that has all of the Scheduler.getinstance.run() lines), do I need to run my commands for teleop and autonomous there? Or do I just leave it as is? And, if I do need to run my commands from there, how do I go about doing that? (I know how to call and run a method from an alternate class, but not the entire alternate class itself)


package org.usfirst.frc4993.Mater;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.Scheduler;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;

import org.usfirst.frc4993.Mater.commands.*;
import org.usfirst.frc4993.Mater.subsystems.*;


public class Robot extends IterativeRobot

Command autonomousCommand;

public static OI oi;

public static DriveTrain driveTrain;
public static Arms arms;




public void robotInit() {
RobotMap.init();

driveTrain = new DriveTrain();
arms = new Arms();

oi = new OI();

autonomousCommand = new AutonomousDrive();
autonomousCommand = new AutonoumousLift();

}

public void disabledInit(){

}

public void disabledPeriodic() {
Scheduler.getInstance().run();
}

public void autonomousInit() {
if (autonomousCommand != null) autonomousCommand.start();
}

public void autonomousPeriodic() {
Scheduler.getInstance().run();
}

public void teleopInit() {
if (autonomousCommand != null) autonomousCommand.cancel();
}

public void teleopPeriodic() {
Scheduler.getInstance().run();
}

public void testPeriodic() {
LiveWindow.run();
}
}
Reply With Quote
 


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:45.

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