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,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>
/**
* The main autonomous command to pickup and deliver the soda to the box.
*/
class Autonomous : public frc::CommandGroup {
public:
Autonomous();
};

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>
/**
* Opens the claw for one second. Real robots should use sensors, stalling
* motors is BAD!
*/
class CloseClaw : public frc::Command {
public:
CloseClaw();
void Initialize() override;
bool IsFinished() override;
void End() override;
};

View File

@@ -0,0 +1,44 @@
/*----------------------------------------------------------------------------*/
/* 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/PIDController.h>
#include <frc/PIDOutput.h>
#include <frc/PIDSource.h>
#include <frc/commands/Command.h>
/**
* Drive the given distance straight (negative values go backwards).
* Uses a local PID controller to run a simple PID loop that is only
* enabled while this command is running. The input is the averaged
* values of the left and right encoders.
*/
class DriveStraight : public frc::Command {
public:
explicit DriveStraight(double distance);
void Initialize() override;
bool IsFinished() override;
void End() override;
class DriveStraightPIDSource : public frc::PIDSource {
public:
virtual ~DriveStraightPIDSource() = default;
double PIDGet() override;
};
class DriveStraightPIDOutput : public frc::PIDOutput {
public:
virtual ~DriveStraightPIDOutput() = default;
void PIDWrite(double d) override;
};
private:
DriveStraightPIDSource m_source;
DriveStraightPIDOutput m_output;
frc::PIDController m_pid{4, 0, 0, &m_source, &m_output};
};

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>
/**
* Opens the claw for one second. Real robots should use sensors, stalling
* motors is BAD!
*/
class OpenClaw : public frc::Command {
public:
OpenClaw();
void Initialize() override;
bool IsFinished() 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>
/**
* Pickup a soda can (if one is between the open claws) and
* get it in a safe state to drive around.
*/
class Pickup : public frc::CommandGroup {
public:
Pickup();
};

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>
/**
* Place a held soda can onto the platform.
*/
class Place : public frc::CommandGroup {
public:
Place();
};

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>
/**
* Make sure the robot is in a state to pickup soda cans.
*/
class PrepareToPickup : public frc::CommandGroup {
public:
PrepareToPickup();
};

View File

@@ -0,0 +1,44 @@
/*----------------------------------------------------------------------------*/
/* 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/PIDController.h>
#include <frc/PIDOutput.h>
#include <frc/PIDSource.h>
#include <frc/commands/Command.h>
/**
* Drive until the robot is the given distance away from the box. Uses a local
* PID controller to run a simple PID loop that is only enabled while this
* command is running. The input is the averaged values of the left and right
* encoders.
*/
class SetDistanceToBox : public frc::Command {
public:
explicit SetDistanceToBox(double distance);
void Initialize() override;
bool IsFinished() override;
void End() override;
class SetDistanceToBoxPIDSource : public frc::PIDSource {
public:
virtual ~SetDistanceToBoxPIDSource() = default;
double PIDGet() override;
};
class SetDistanceToBoxPIDOutput : public frc::PIDOutput {
public:
virtual ~SetDistanceToBoxPIDOutput() = default;
void PIDWrite(double d) override;
};
private:
SetDistanceToBoxPIDSource m_source;
SetDistanceToBoxPIDOutput m_output;
frc::PIDController m_pid{-2, 0, 0, &m_source, &m_output};
};

View File

@@ -0,0 +1,27 @@
/*----------------------------------------------------------------------------*/
/* 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>
/**
* Move the elevator to a given location. This command finishes when it is
* within
* the tolerance, but leaves the PID loop running to maintain the position.
* Other
* commands using the elevator should make sure they disable PID!
*/
class SetElevatorSetpoint : public frc::Command {
public:
explicit SetElevatorSetpoint(double setpoint);
void Initialize() override;
bool IsFinished() override;
private:
double m_setpoint;
};

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>
/**
* Move the wrist 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 wrist should make sure they disable PID!
*/
class SetWristSetpoint : public frc::Command {
public:
explicit SetWristSetpoint(double setpoint);
void Initialize() override;
bool IsFinished() override;
private:
double m_setpoint;
};

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>
/**
* Have the robot drive tank style using the PS3 Joystick until interrupted.
*/
class TankDriveWithJoystick : public frc::Command {
public:
TankDriveWithJoystick();
void Execute() override;
bool IsFinished() override;
void End() override;
};