Move CameraServer and WPILib headers into their own folder

The old headers were moved into folders because doing so avoids polluting
the system include directories.

Folder names were also normalized to lowercase.
This commit is contained in:
Tyler Veness
2018-07-20 00:03:45 -07:00
committed by Peter Johnson
parent 31ced30c1e
commit d89b7dd412
728 changed files with 1876 additions and 1851 deletions

View File

@@ -0,0 +1,22 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/Command.h>
/**
* This command looks for the hot goal and waits until it's detected or timed
* out. The timeout is because it's better to shoot and get some autonomous
* 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 : public frc::Command {
public:
explicit CheckForHotGoal(double time);
bool IsFinished() override;
};

View File

@@ -0,0 +1,22 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/InstantCommand.h>
/**
* Close the claw.
*
* NOTE: It doesn't wait for the claw to close since there is no sensor to
* detect that.
*/
class CloseClaw : public frc::InstantCommand {
public:
CloseClaw();
void Initialize() override;
};

View File

@@ -0,0 +1,18 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/CommandGroup.h>
/**
* Get the robot set to collect balls.
*/
class Collect : public frc::CommandGroup {
public:
Collect();
};

View File

@@ -0,0 +1,19 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/CommandGroup.h>
/**
* Drive over the line and then shoot the ball. If the hot goal is not detected,
* it will wait briefly.
*/
class DriveAndShootAutonomous : public frc::CommandGroup {
public:
DriveAndShootAutonomous();
};

View File

@@ -0,0 +1,34 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/Command.h>
/**
* This command drives the robot over a given distance with simple proportional
* control This command will drive a given distance limiting to a maximum speed.
*/
class DriveForward : public frc::Command {
public:
DriveForward();
explicit DriveForward(double dist);
DriveForward(double dist, double maxSpeed);
void Initialize() override;
void Execute() override;
bool IsFinished() override;
void End() override;
private:
double m_driveForwardSpeed;
double m_distance;
double m_error = 0;
static constexpr double kTolerance = 0.1;
static constexpr double kP = -1.0 / 5.0;
void init(double dist, double maxSpeed);
};

View File

@@ -0,0 +1,22 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/Command.h>
/**
* This command allows PS3 joystick to drive the robot. It is always running
* except when interrupted by another command.
*/
class DriveWithJoystick : public frc::Command {
public:
DriveWithJoystick();
void Execute() override;
bool IsFinished() override;
void End() override;
};

View File

@@ -0,0 +1,20 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/TimedCommand.h>
/**
* Extend the shooter and then retract it after a second.
*/
class ExtendShooter : public frc::TimedCommand {
public:
ExtendShooter();
void Initialize() override;
void End() override;
};

View File

@@ -0,0 +1,19 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/CommandGroup.h>
/**
* Spit the ball out into the low goal assuming that the robot is in front of
* it.
*/
class LowGoal : public frc::CommandGroup {
public:
LowGoal();
};

View File

@@ -0,0 +1,20 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/Command.h>
/**
* Opens the claw
*/
class OpenClaw : public frc::Command {
public:
OpenClaw();
void Initialize() override;
bool IsFinished() override;
};

View File

@@ -0,0 +1,24 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/InstantCommand.h>
/**
* This command sets the collector rollers spinning at the given speed. Since
* there is no sensor for detecting speed, it finishes immediately. As a result,
* the spinners may still be adjusting their speed.
*/
class SetCollectionSpeed : public frc::InstantCommand {
public:
explicit SetCollectionSpeed(double speed);
void Initialize() override;
private:
double m_speed;
};

View File

@@ -0,0 +1,25 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/Command.h>
/**
* Moves the pivot to a given angle. This command finishes when it is within
* the tolerance, but leaves the PID loop running to maintain the position.
* Other commands using the pivot should make sure they disable PID!
*/
class SetPivotSetpoint : public frc::Command {
public:
explicit SetPivotSetpoint(double setpoint);
void Initialize() override;
bool IsFinished() override;
private:
double m_setpoint;
};

View File

@@ -0,0 +1,18 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/CommandGroup.h>
/**
* Shoot the ball at the current angle.
*/
class Shoot : public frc::CommandGroup {
public:
Shoot();
};

View File

@@ -0,0 +1,21 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/Command.h>
/**
* Wait until the collector senses that it has the ball. This command does
* nothing and is intended to be used in command groups to wait for this
* condition.
*/
class WaitForBall : public frc::Command {
public:
WaitForBall();
bool IsFinished() override;
};

View File

@@ -0,0 +1,20 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2017-2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <frc/commands/Command.h>
/**
* Wait until the pneumatics are fully pressurized. This command does nothing
* and is intended to be used in command groups to wait for this condition.
*/
class WaitForPressure : public frc::Command {
public:
WaitForPressure();
bool IsFinished() override;
};