mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Moves C++ templates and examples to match gradle setup (#1065)
This commit is contained in:
committed by
Peter Johnson
parent
d564e19ef3
commit
cff475c1fc
@@ -3,6 +3,7 @@ import org.gradle.language.base.internal.ProjectLayout
|
||||
apply plugin: 'cpp'
|
||||
apply plugin: 'visual-studio'
|
||||
apply plugin: 'edu.wpi.first.NativeUtils'
|
||||
apply plugin: ExtraTasks
|
||||
|
||||
apply from: '../shared/config.gradle'
|
||||
|
||||
@@ -59,9 +60,13 @@ model {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'src/main/cpp/examples/' + "${key}"
|
||||
srcDirs 'src/main/cpp/examples/' + "${key}" + "/cpp"
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/cpp/examples/' + "${key}" + "/include"
|
||||
include '**/*.h'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,9 +96,13 @@ model {
|
||||
sources {
|
||||
cpp {
|
||||
source {
|
||||
srcDirs 'src/main/cpp/templates/' + "${key}"
|
||||
srcDirs 'src/main/cpp/templates/' + "${key}" + "/cpp"
|
||||
include '**/*.cpp'
|
||||
}
|
||||
exportedHeaders {
|
||||
srcDirs 'src/main/cpp/templates/' + "${key}" + "/include"
|
||||
include '**/*.h'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Autonomous.h"
|
||||
#include "Commands/Autonomous.h"
|
||||
|
||||
#include "CloseClaw.h"
|
||||
#include "DriveStraight.h"
|
||||
#include "Pickup.h"
|
||||
#include "Place.h"
|
||||
#include "PrepareToPickup.h"
|
||||
#include "SetDistanceToBox.h"
|
||||
#include "SetWristSetpoint.h"
|
||||
#include "Commands/CloseClaw.h"
|
||||
#include "Commands/DriveStraight.h"
|
||||
#include "Commands/Pickup.h"
|
||||
#include "Commands/Place.h"
|
||||
#include "Commands/PrepareToPickup.h"
|
||||
#include "Commands/SetDistanceToBox.h"
|
||||
#include "Commands/SetWristSetpoint.h"
|
||||
|
||||
Autonomous::Autonomous() : frc::CommandGroup("Autonomous") {
|
||||
AddSequential(new PrepareToPickup());
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "CloseClaw.h"
|
||||
#include "Commands/CloseClaw.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
CloseClaw::CloseClaw() : frc::Command("CloseClaw") { Requires(&Robot::claw); }
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "DriveStraight.h"
|
||||
#include "Commands/DriveStraight.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
DriveStraight::DriveStraight(double distance) {
|
||||
Requires(&Robot::drivetrain);
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "OpenClaw.h"
|
||||
#include "Commands/OpenClaw.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
OpenClaw::OpenClaw() : frc::Command("OpenClaw") {
|
||||
Requires(&Robot::claw);
|
||||
@@ -5,11 +5,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Pickup.h"
|
||||
#include "Commands/Pickup.h"
|
||||
|
||||
#include "CloseClaw.h"
|
||||
#include "SetElevatorSetpoint.h"
|
||||
#include "SetWristSetpoint.h"
|
||||
#include "Commands/CloseClaw.h"
|
||||
#include "Commands/SetElevatorSetpoint.h"
|
||||
#include "Commands/SetWristSetpoint.h"
|
||||
|
||||
Pickup::Pickup() : frc::CommandGroup("Pickup") {
|
||||
AddSequential(new CloseClaw());
|
||||
@@ -5,11 +5,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Place.h"
|
||||
#include "Commands/Place.h"
|
||||
|
||||
#include "OpenClaw.h"
|
||||
#include "SetElevatorSetpoint.h"
|
||||
#include "SetWristSetpoint.h"
|
||||
#include "Commands/OpenClaw.h"
|
||||
#include "Commands/SetElevatorSetpoint.h"
|
||||
#include "Commands/SetWristSetpoint.h"
|
||||
|
||||
Place::Place() : frc::CommandGroup("Place") {
|
||||
AddSequential(new SetElevatorSetpoint(0.25));
|
||||
@@ -5,11 +5,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "PrepareToPickup.h"
|
||||
#include "Commands/PrepareToPickup.h"
|
||||
|
||||
#include "OpenClaw.h"
|
||||
#include "SetElevatorSetpoint.h"
|
||||
#include "SetWristSetpoint.h"
|
||||
#include "Commands/OpenClaw.h"
|
||||
#include "Commands/SetElevatorSetpoint.h"
|
||||
#include "Commands/SetWristSetpoint.h"
|
||||
|
||||
PrepareToPickup::PrepareToPickup() : frc::CommandGroup("PrepareToPickup") {
|
||||
AddParallel(new OpenClaw());
|
||||
@@ -5,11 +5,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "SetDistanceToBox.h"
|
||||
#include "Commands/SetDistanceToBox.h"
|
||||
|
||||
#include <PIDController.h>
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
SetDistanceToBox::SetDistanceToBox(double distance) {
|
||||
Requires(&Robot::drivetrain);
|
||||
@@ -5,11 +5,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "SetElevatorSetpoint.h"
|
||||
#include "Commands/SetElevatorSetpoint.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
SetElevatorSetpoint::SetElevatorSetpoint(double setpoint)
|
||||
: frc::Command("SetElevatorSetpoint") {
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "SetWristSetpoint.h"
|
||||
#include "Commands/SetWristSetpoint.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
SetWristSetpoint::SetWristSetpoint(double setpoint)
|
||||
: frc::Command("SetWristSetpoint") {
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "TankDriveWithJoystick.h"
|
||||
#include "Commands/TankDriveWithJoystick.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
TankDriveWithJoystick::TankDriveWithJoystick()
|
||||
: frc::Command("TankDriveWithJoystick") {
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Claw.h"
|
||||
#include "Subsystems/Claw.h"
|
||||
|
||||
Claw::Claw() : frc::Subsystem("Claw") {
|
||||
// Let's show everything on the LiveWindow
|
||||
@@ -5,12 +5,12 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "DriveTrain.h"
|
||||
#include "Subsystems/DriveTrain.h"
|
||||
|
||||
#include <Joystick.h>
|
||||
#include <SmartDashboard/SmartDashboard.h>
|
||||
|
||||
#include "../Commands/TankDriveWithJoystick.h"
|
||||
#include "Commands/TankDriveWithJoystick.h"
|
||||
|
||||
DriveTrain::DriveTrain() : frc::Subsystem("DriveTrain") {
|
||||
// Encoders may measure differently in the real world and in
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Elevator.h"
|
||||
#include "Subsystems/Elevator.h"
|
||||
|
||||
#include <LiveWindow/LiveWindow.h>
|
||||
#include <SmartDashboard/SmartDashboard.h>
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Wrist.h"
|
||||
#include "Subsystems/Wrist.h"
|
||||
|
||||
#include <SmartDashboard/SmartDashboard.h>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "CheckForHotGoal.h"
|
||||
#include "Commands/CheckForHotGoal.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
CheckForHotGoal::CheckForHotGoal(double time) { SetTimeout(time); }
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "CloseClaw.h"
|
||||
#include "Commands/CloseClaw.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
CloseClaw::CloseClaw() { Requires(&Robot::collector); }
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Collect.h"
|
||||
#include "Commands/Collect.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "CloseClaw.h"
|
||||
#include "SetCollectionSpeed.h"
|
||||
#include "SetPivotSetpoint.h"
|
||||
#include "WaitForBall.h"
|
||||
#include "Commands/CloseClaw.h"
|
||||
#include "Commands/SetCollectionSpeed.h"
|
||||
#include "Commands/SetPivotSetpoint.h"
|
||||
#include "Commands/WaitForBall.h"
|
||||
#include "Robot.h"
|
||||
|
||||
Collect::Collect() {
|
||||
AddSequential(new SetCollectionSpeed(Collector::kForward));
|
||||
@@ -5,15 +5,15 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "DriveAndShootAutonomous.h"
|
||||
#include "Commands/DriveAndShootAutonomous.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "CheckForHotGoal.h"
|
||||
#include "CloseClaw.h"
|
||||
#include "DriveForward.h"
|
||||
#include "SetPivotSetpoint.h"
|
||||
#include "Shoot.h"
|
||||
#include "WaitForPressure.h"
|
||||
#include "Commands/CheckForHotGoal.h"
|
||||
#include "Commands/CloseClaw.h"
|
||||
#include "Commands/DriveForward.h"
|
||||
#include "Commands/SetPivotSetpoint.h"
|
||||
#include "Commands/Shoot.h"
|
||||
#include "Commands/WaitForPressure.h"
|
||||
#include "Robot.h"
|
||||
|
||||
DriveAndShootAutonomous::DriveAndShootAutonomous() {
|
||||
AddSequential(new CloseClaw());
|
||||
@@ -5,11 +5,11 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "DriveForward.h"
|
||||
#include "Commands/DriveForward.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
void DriveForward::init(double dist, double maxSpeed) {
|
||||
Requires(&Robot::drivetrain);
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "DriveWithJoystick.h"
|
||||
#include "Commands/DriveWithJoystick.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
DriveWithJoystick::DriveWithJoystick() { Requires(&Robot::drivetrain); }
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "ExtendShooter.h"
|
||||
#include "Commands/ExtendShooter.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
ExtendShooter::ExtendShooter() : frc::TimedCommand(1.0) {
|
||||
Requires(&Robot::shooter);
|
||||
@@ -5,12 +5,12 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "LowGoal.h"
|
||||
#include "Commands/LowGoal.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "ExtendShooter.h"
|
||||
#include "SetCollectionSpeed.h"
|
||||
#include "SetPivotSetpoint.h"
|
||||
#include "Commands/ExtendShooter.h"
|
||||
#include "Commands/SetCollectionSpeed.h"
|
||||
#include "Commands/SetPivotSetpoint.h"
|
||||
#include "Robot.h"
|
||||
|
||||
LowGoal::LowGoal() {
|
||||
AddSequential(new SetPivotSetpoint(Pivot::kLowGoal));
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "OpenClaw.h"
|
||||
#include "Commands/OpenClaw.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
OpenClaw::OpenClaw() { Requires(&Robot::collector); }
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "SetCollectionSpeed.h"
|
||||
#include "Commands/SetCollectionSpeed.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
SetCollectionSpeed::SetCollectionSpeed(double speed) {
|
||||
Requires(&Robot::collector);
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "SetPivotSetpoint.h"
|
||||
#include "Commands/SetPivotSetpoint.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
SetPivotSetpoint::SetPivotSetpoint(double setpoint) {
|
||||
m_setpoint = setpoint;
|
||||
@@ -5,13 +5,13 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Shoot.h"
|
||||
#include "Commands/Shoot.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "ExtendShooter.h"
|
||||
#include "OpenClaw.h"
|
||||
#include "SetCollectionSpeed.h"
|
||||
#include "WaitForPressure.h"
|
||||
#include "Commands/ExtendShooter.h"
|
||||
#include "Commands/OpenClaw.h"
|
||||
#include "Commands/SetCollectionSpeed.h"
|
||||
#include "Commands/WaitForPressure.h"
|
||||
#include "Robot.h"
|
||||
|
||||
Shoot::Shoot() {
|
||||
AddSequential(new WaitForPressure());
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WaitForBall.h"
|
||||
#include "Commands/WaitForBall.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
WaitForBall::WaitForBall() { Requires(&Robot::collector); }
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "WaitForPressure.h"
|
||||
#include "Commands/WaitForPressure.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
WaitForPressure::WaitForPressure() { Requires(&Robot::pneumatics); }
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Collector.h"
|
||||
#include "Subsystems/Collector.h"
|
||||
|
||||
#include <LiveWindow/LiveWindow.h>
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "DriveTrain.h"
|
||||
#include "Subsystems/DriveTrain.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <Joystick.h>
|
||||
|
||||
#include "../Commands/DriveWithJoystick.h"
|
||||
#include "Commands/DriveWithJoystick.h"
|
||||
|
||||
DriveTrain::DriveTrain() : frc::Subsystem("DriveTrain") {
|
||||
// AddChild("Front Left CIM", m_frontLeftCIM);
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Pivot.h"
|
||||
#include "Subsystems/Pivot.h"
|
||||
|
||||
Pivot::Pivot() : frc::PIDSubsystem("Pivot", 7.0, 0.0, 8.0) {
|
||||
SetAbsoluteTolerance(0.005);
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Pneumatics.h"
|
||||
#include "Subsystems/Pneumatics.h"
|
||||
|
||||
#include <SmartDashboard/SmartDashboard.h>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "Shooter.h"
|
||||
#include "Subsystems/Shooter.h"
|
||||
|
||||
Shooter::Shooter() : Subsystem("Shooter") {
|
||||
// Put everything to the LiveWindow for testing.
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "DoubleButton.h"
|
||||
#include "Triggers/DoubleButton.h"
|
||||
|
||||
#include <Joystick.h>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "ExampleCommand.h"
|
||||
#include "Commands/ExampleCommand.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
ExampleCommand::ExampleCommand() {
|
||||
// Use Requires() here to declare subsystem dependencies
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "MyAutoCommand.h"
|
||||
#include "Commands/MyAutoCommand.h"
|
||||
|
||||
#include "../Robot.h"
|
||||
#include "Robot.h"
|
||||
|
||||
MyAutoCommand::MyAutoCommand() {
|
||||
// Use Requires() here to declare subsystem dependencies
|
||||
@@ -5,9 +5,9 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "ExampleSubsystem.h"
|
||||
#include "Subsystems/ExampleSubsystem.h"
|
||||
|
||||
#include "../RobotMap.h"
|
||||
#include "RobotMap.h"
|
||||
|
||||
ExampleSubsystem::ExampleSubsystem() : frc::Subsystem("ExampleSubsystem") {}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user