mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Fix the example programs
Remove the test examples that don't do anything helpful Fix the PacGoat and GearsBot examples to compile Change-Id: Ic11ca7a97a5b52524fe60dc24fcec6ecfae7ebb7
This commit is contained in:
@@ -26,9 +26,6 @@ DriveTrain::DriveTrain() : Subsystem("DriveTrain") {
|
||||
right_encoder->SetDistancePerPulse((double) (4.0/12.0*M_PI) / 360.0);
|
||||
#endif
|
||||
|
||||
left_encoder->Start();
|
||||
right_encoder->Start();
|
||||
|
||||
rangefinder = new AnalogInput(6);
|
||||
gyro = new Gyro(1);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef DriveTrain_H
|
||||
#define DriveTrain_H
|
||||
|
||||
#include "Commands/Subsystem.h"
|
||||
#include "WPILib.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#include <networktables/NetworkTable.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
// This is a simple robot program
|
||||
int main()
|
||||
{
|
||||
NetworkTable::SetServerMode();
|
||||
NetworkTable::SetTeam(190);
|
||||
NetworkTable* table = NetworkTable::GetTable("SmartDashboard");
|
||||
cout << "Started up" << endl;
|
||||
|
||||
long i = 0;
|
||||
while (true)
|
||||
{
|
||||
cout << i << endl;
|
||||
table->PutNumber("i", i);
|
||||
i++;
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
* points than get none. When called sequentially, this command will block until
|
||||
* the hot goal is detected or until it is timed out.
|
||||
*/
|
||||
class CheckForHotGoal : Command {
|
||||
class CheckForHotGoal : public Command {
|
||||
public:
|
||||
CheckForHotGoal(double time);
|
||||
void Initialize();
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Commands/SetPivotSetpoint.h"
|
||||
#include "Commands/DriveForward.h"
|
||||
#include "Commands/Shoot.h"
|
||||
#include "Commands/CheckForHotGoal.h"
|
||||
|
||||
DriveAndShootAutonomous::DriveAndShootAutonomous() {
|
||||
AddSequential(new CloseClaw());
|
||||
|
||||
@@ -43,8 +43,6 @@ DriveTrain::DriveTrain() :
|
||||
leftEncoder->SetDistancePerPulse((4.0/*in*/*M_PI)/(360.0*12.0/*in/ft*/));
|
||||
#endif
|
||||
|
||||
rightEncoder->Start();
|
||||
leftEncoder->Start();
|
||||
LiveWindow::GetInstance()->AddSensor("DriveTrain", "Right Encoder", rightEncoder);
|
||||
LiveWindow::GetInstance()->AddSensor("DriveTrain", "Left Encoder", leftEncoder);
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
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!
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<examples>
|
||||
<!-- TODO add back in when there are enough samples to justify tags
|
||||
<tagDescription>
|
||||
<name>Simple Robot</name>
|
||||
<description>Examples for simple robot programs.</description>
|
||||
@@ -10,47 +11,14 @@
|
||||
variety of tasks such as sending and receiving values to both
|
||||
dashboards and co-processors.</description>
|
||||
</tagDescription>
|
||||
<tagDescription>
|
||||
<name>Simulation</name>
|
||||
<description>Examples that can be run in simulation.</description>
|
||||
</tagDescription>-->
|
||||
<tagDescription>
|
||||
<name>CommandBased Robot</name>
|
||||
<description>Examples for CommandBased robot programs.</description>
|
||||
</tagDescription>
|
||||
<tagDescription>
|
||||
<name>Simulation</name>
|
||||
<description>Examples that can be run in simulation.</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>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/Simple Robot Example/Robot.java" destination="src/Robot.cpp" />
|
||||
</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>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/Network Table Counter/Robot.cpp" destination="src/Robot.cpp" />
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>GearsBot</name>
|
||||
@@ -59,7 +27,6 @@
|
||||
supports simulation.</description>
|
||||
<tags>
|
||||
<tag>CommandBased Robot</tag>
|
||||
<tag>Simulation</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
@@ -137,14 +104,12 @@
|
||||
destination="src/Subsystems/Wrist.h"></file>
|
||||
</files>
|
||||
</example>
|
||||
|
||||
|
||||
<example>
|
||||
<name>PacGoat</name>
|
||||
<description>A fully functional example CommandBased program for FRC Team 190's 2014 robot. This code can run on your computer if it supports simulation.</description>
|
||||
<tags>
|
||||
<tag>CommandBased Robot</tag>
|
||||
<tag>Simulation</tag>
|
||||
<tag>2014 Season</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
|
||||
Reference in New Issue
Block a user