Initial checkin of unified hierarchy of WPILib 2015
@@ -0,0 +1,2 @@
|
||||
timestamp=${timestamp}
|
||||
version=${version}
|
||||
|
After Width: | Height: | Size: 790 B |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 983 B |
|
After Width: | Height: | Size: 894 B |
@@ -0,0 +1,7 @@
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="var" path="wpilib" sourcepath="wpilib.sources"/>
|
||||
<classpathentry kind="var" path="networktables" sourcepath="networktables.sources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,3 @@
|
||||
# Project specific information
|
||||
package=$package
|
||||
main=${package}.Robot
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project name="FRC Deployment" default="deploy">
|
||||
|
||||
<!--
|
||||
The following properties can be defined to override system level
|
||||
settings. These should not be touched unless you know what you're
|
||||
doing. The primary use is to override the wpilib version when
|
||||
working with older robots that can't compile with the latest
|
||||
libraries.
|
||||
-->
|
||||
|
||||
<!-- By default the system version of WPI is used -->
|
||||
<!-- <property name="version" value=""/> -->
|
||||
|
||||
<!-- By default the system team number is used -->
|
||||
<!-- <property name="team-number" value=""/> -->
|
||||
|
||||
<!-- By default the target is set to 10.TE.AM.2 -->
|
||||
<!-- <property name="target" value=""/> -->
|
||||
|
||||
<!-- Any other property in build.properties can also be overridden. -->
|
||||
|
||||
<property file="${user.home}/wpilib/wpilib.properties"/>
|
||||
<property file="build.properties"/>
|
||||
<property file="${user.home}/wpilib/java/${version}/ant/build.properties"/>
|
||||
|
||||
<import file="${wpilib.ant.dir}/build.xml"/>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,36 @@
|
||||
package $package;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Command;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class $classname extends Command {
|
||||
|
||||
public $classname() {
|
||||
// Use requires() here to declare subsystem dependencies
|
||||
// eg. requires(chassis);
|
||||
}
|
||||
|
||||
// Called just before this Command runs the first time
|
||||
protected void initialize() {
|
||||
}
|
||||
|
||||
// Called repeatedly when this Command is scheduled to run
|
||||
protected void execute() {
|
||||
}
|
||||
|
||||
// Make this return true when this Command no longer needs to run execute()
|
||||
protected boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Called once after isFinished returns true
|
||||
protected void end() {
|
||||
}
|
||||
|
||||
// Called when another command which requires one or more of the same
|
||||
// subsystems is scheduled to run
|
||||
protected void interrupted() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package $package;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.CommandGroup;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class $classname extends CommandGroup {
|
||||
|
||||
public $classname() {
|
||||
// Add Commands here:
|
||||
// e.g. addSequential(new Command1());
|
||||
// addSequential(new Command2());
|
||||
// these will run in order.
|
||||
|
||||
// To run multiple commands at the same time,
|
||||
// use addParallel()
|
||||
// e.g. addParallel(new Command1());
|
||||
// addSequential(new Command2());
|
||||
// Command1 and Command2 will run in parallel.
|
||||
|
||||
// A command group will require all of the subsystems that each member
|
||||
// would require.
|
||||
// e.g. if Command1 requires chassis, and Command2 requires arm,
|
||||
// a CommandGroup containing them would require both the chassis and the
|
||||
// arm.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
package $package.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Command;
|
||||
|
||||
import $package.Robot;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class ExampleCommand extends Command {
|
||||
|
||||
public ExampleCommand() {
|
||||
// Use requires() here to declare subsystem dependencies
|
||||
requires(Robot.exampleSubsystem);
|
||||
}
|
||||
|
||||
// Called just before this Command runs the first time
|
||||
protected void initialize() {
|
||||
}
|
||||
|
||||
// Called repeatedly when this Command is scheduled to run
|
||||
protected void execute() {
|
||||
}
|
||||
|
||||
// Make this return true when this Command no longer needs to run execute()
|
||||
protected boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Called once after isFinished returns true
|
||||
protected void end() {
|
||||
}
|
||||
|
||||
// Called when another command which requires one or more of the same
|
||||
// subsystems is scheduled to run
|
||||
protected void interrupted() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
package $package.subsystems;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Subsystem;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class ExampleSubsystem extends Subsystem {
|
||||
|
||||
// Put methods for controlling this subsystem
|
||||
// here. Call these from Commands.
|
||||
|
||||
public void initDefaultCommand() {
|
||||
// Set the default command for a subsystem here.
|
||||
//setDefaultCommand(new MySpecialCommand());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package $package;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.PIDSubsystem;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class $classname extends PIDSubsystem {
|
||||
|
||||
// Initialize your subsystem here
|
||||
public $classname() {
|
||||
// Use these to get going:
|
||||
// setSetpoint() - Sets where the PID controller should move the system
|
||||
// to
|
||||
// enable() - Enables the PID controller.
|
||||
}
|
||||
|
||||
public void initDefaultCommand() {
|
||||
// Set the default command for a subsystem here.
|
||||
//setDefaultCommand(new MySpecialCommand());
|
||||
}
|
||||
|
||||
protected double returnPIDInput() {
|
||||
// Return your input value for the PID loop
|
||||
// e.g. a sensor, like a potentiometer:
|
||||
// yourPot.getAverageVoltage() / kYourMaxVoltage;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
protected void usePIDOutput(double output) {
|
||||
// Use output to drive your system, like a motor
|
||||
// e.g. yourMotor.set(output);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
package $package;
|
||||
|
||||
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 $package.commands.ExampleCommand;
|
||||
import $package.subsystems.ExampleSubsystem;
|
||||
|
||||
/**
|
||||
* The VM is configured to automatically run this class, and to call the
|
||||
* functions corresponding to each mode, as described in the IterativeRobot
|
||||
* 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 Robot extends IterativeRobot {
|
||||
|
||||
public static final ExampleSubsystem exampleSubsystem = new ExampleSubsystem();
|
||||
|
||||
Command autonomousCommand;
|
||||
|
||||
/**
|
||||
* This function is run when the robot is first started up and should be
|
||||
* used for any initialization code.
|
||||
*/
|
||||
public void robotInit() {
|
||||
// instantiate the command used for the autonomous period
|
||||
autonomousCommand = new ExampleCommand();
|
||||
}
|
||||
|
||||
public void autonomousInit() {
|
||||
// schedule the autonomous command (example)
|
||||
autonomousCommand.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called periodically during autonomous
|
||||
*/
|
||||
public void autonomousPeriodic() {
|
||||
Scheduler.getInstance().run();
|
||||
}
|
||||
|
||||
public void teleopInit() {
|
||||
// This makes sure that the autonomous stops running when
|
||||
// teleop starts running. If you want the autonomous to
|
||||
// continue until interrupted by another command, remove
|
||||
// this line or comment it out.
|
||||
autonomousCommand.cancel();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called periodically during operator control
|
||||
*/
|
||||
public void teleopPeriodic() {
|
||||
Scheduler.getInstance().run();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called periodically during test mode
|
||||
*/
|
||||
public void testPeriodic() {
|
||||
LiveWindow.run();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package $package;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Subsystem;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class $classname extends Subsystem {
|
||||
|
||||
// Put methods for controlling this subsystem
|
||||
// here. Call these from Commands.
|
||||
|
||||
public void initDefaultCommand() {
|
||||
// Set the default command for a subsystem here.
|
||||
//setDefaultCommand(new MySpecialCommand());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package $package;
|
||||
|
||||
import edu.wpi.first.wpilibj.command.Trigger;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class $classname extends Trigger {
|
||||
|
||||
public boolean get() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package $package;
|
||||
|
||||
import edu.wpi.first.wpilibj.networktables.NetworkTable;
|
||||
|
||||
/**
|
||||
* An example of a network table counter.
|
||||
*
|
||||
* @author Team $team-number
|
||||
*/
|
||||
public class Robot {
|
||||
|
||||
private static NetworkTable table;
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
NetworkTable.setServerMode();
|
||||
NetworkTable.setTeam(190);
|
||||
table = NetworkTable.getTable("SmartDashboard");
|
||||
System.out.println("Started up");
|
||||
|
||||
long i = 0;
|
||||
while (true) {
|
||||
System.out.println(i);
|
||||
table.putNumber("i", i);
|
||||
i++;
|
||||
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package $package;
|
||||
|
||||
/**
|
||||
* Simplest possible robot program
|
||||
*
|
||||
* @author Team $team-number
|
||||
*/
|
||||
public class Robot {
|
||||
|
||||
/**
|
||||
* @param args Input....
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// Do stuff here!
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<examples>
|
||||
<tagDescription>
|
||||
<name>Simple Robot</name>
|
||||
<description>Examples for simple robot programs.</description>
|
||||
</tagDescription>
|
||||
<tagDescription>
|
||||
<name>Network Tables</name>
|
||||
<description>Examples of how to use Network Tables to accomplish a
|
||||
variety of tasks such as sending and receiving values to both
|
||||
dashboards and co-processors..</description>
|
||||
</tagDescription>
|
||||
|
||||
<example>
|
||||
<name>Simple Robot Example</name>
|
||||
<description>The simplest possible program that compiles. This
|
||||
shows the structure of a simple program that does nothing at
|
||||
all.</description>
|
||||
<tags>
|
||||
<tag>Simple Robot</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src/$package-dir</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/Simple Robot Example/Robot.java" destination="src/$package-dir/Robot.java" />
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Network Table Counter</name>
|
||||
<description>A simple program that increments a network table
|
||||
variable once every second. This shows the structure of a simple
|
||||
program that only uses network tables.</description>
|
||||
<tags>
|
||||
<tag>Simple Robot</tag>
|
||||
<tag>Network Tables</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src/$package-dir</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/Network Table Counter/Robot.java" destination="src/$package-dir/Robot.java" />
|
||||
</files>
|
||||
</example>
|
||||
|
||||
</examples>
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
package $package;
|
||||
|
||||
import edu.wpi.first.wpilibj.IterativeRobot;
|
||||
|
||||
/**
|
||||
* The VM is configured to automatically run this class, and to call the
|
||||
* functions corresponding to each mode, as described in the IterativeRobot
|
||||
* 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 Robot extends IterativeRobot {
|
||||
/**
|
||||
* This function is run when the robot is first started up and should be
|
||||
* used for any initialization code.
|
||||
*/
|
||||
public void robotInit() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called periodically during autonomous
|
||||
*/
|
||||
public void autonomousPeriodic() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called periodically during operator control
|
||||
*/
|
||||
public void teleopPeriodic() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called periodically during test mode
|
||||
*/
|
||||
public void testPeriodic() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
package $package;
|
||||
|
||||
|
||||
import edu.wpi.first.wpilibj.SimpleRobot;
|
||||
|
||||
/**
|
||||
* 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 Robot extends SimpleRobot {
|
||||
/**
|
||||
* 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() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called once each time the robot enters test mode.
|
||||
*/
|
||||
public void test() {
|
||||
|
||||
}
|
||||
}
|
||||