formatting
This commit is contained in:
parent
2cbc02c3bb
commit
11be5085b5
8 changed files with 17 additions and 21 deletions
|
@ -16,9 +16,7 @@ void Robot::RobotInit() {}
|
||||||
* <p> This runs after the mode specific periodic functions, but before
|
* <p> This runs after the mode specific periodic functions, but before
|
||||||
* LiveWindow and SmartDashboard integrated updating.
|
* LiveWindow and SmartDashboard integrated updating.
|
||||||
*/
|
*/
|
||||||
void Robot::RobotPeriodic() {
|
void Robot::RobotPeriodic() { frc2::CommandScheduler::GetInstance().Run(); }
|
||||||
frc2::CommandScheduler::GetInstance().Run();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is called once each time the robot enters Disabled mode. You
|
* This function is called once each time the robot enters Disabled mode. You
|
||||||
|
@ -74,7 +72,5 @@ void Robot::SimulationInit() {}
|
||||||
void Robot::SimulationPeriodic() {}
|
void Robot::SimulationPeriodic() {}
|
||||||
|
|
||||||
#ifndef RUNNING_FRC_TESTS
|
#ifndef RUNNING_FRC_TESTS
|
||||||
int main() {
|
int main() { return frc::StartRobot<Robot>(); }
|
||||||
return frc::StartRobot<Robot>();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,4 +18,4 @@ namespace OperatorConstants {
|
||||||
|
|
||||||
inline constexpr int kDriverControllerPort = 0;
|
inline constexpr int kDriverControllerPort = 0;
|
||||||
|
|
||||||
} // namespace OperatorConstants
|
} // namespace OperatorConstants
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "RobotContainer.h"
|
#include "RobotContainer.h"
|
||||||
|
|
||||||
class Robot : public frc::TimedRobot {
|
class Robot : public frc::TimedRobot {
|
||||||
public:
|
public:
|
||||||
void RobotInit() override;
|
void RobotInit() override;
|
||||||
void RobotPeriodic() override;
|
void RobotPeriodic() override;
|
||||||
void DisabledInit() override;
|
void DisabledInit() override;
|
||||||
|
@ -25,7 +25,7 @@ class Robot : public frc::TimedRobot {
|
||||||
void SimulationInit() override;
|
void SimulationInit() override;
|
||||||
void SimulationPeriodic() override;
|
void SimulationPeriodic() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Have it empty by default so that if testing teleop it
|
// Have it empty by default so that if testing teleop it
|
||||||
// doesn't have undefined behavior and potentially crash.
|
// doesn't have undefined behavior and potentially crash.
|
||||||
std::optional<frc2::CommandPtr> m_autonomousCommand;
|
std::optional<frc2::CommandPtr> m_autonomousCommand;
|
||||||
|
|
|
@ -18,12 +18,12 @@
|
||||||
* commands, and trigger mappings) should be declared here.
|
* commands, and trigger mappings) should be declared here.
|
||||||
*/
|
*/
|
||||||
class RobotContainer {
|
class RobotContainer {
|
||||||
public:
|
public:
|
||||||
RobotContainer();
|
RobotContainer();
|
||||||
|
|
||||||
frc2::CommandPtr GetAutonomousCommand();
|
frc2::CommandPtr GetAutonomousCommand();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Replace with CommandPS4Controller or CommandJoystick if needed
|
// Replace with CommandPS4Controller or CommandJoystick if needed
|
||||||
frc2::CommandXboxController m_driverController{
|
frc2::CommandXboxController m_driverController{
|
||||||
OperatorConstants::kDriverControllerPort};
|
OperatorConstants::kDriverControllerPort};
|
||||||
|
|
|
@ -12,5 +12,5 @@ namespace autos {
|
||||||
/**
|
/**
|
||||||
* Example static factory for an autonomous command.
|
* Example static factory for an autonomous command.
|
||||||
*/
|
*/
|
||||||
frc2::CommandPtr ExampleAuto(ExampleSubsystem* subsystem);
|
frc2::CommandPtr ExampleAuto(ExampleSubsystem *subsystem);
|
||||||
} // namespace autos
|
} // namespace autos
|
||||||
|
|
|
@ -18,14 +18,14 @@
|
||||||
*/
|
*/
|
||||||
class ExampleCommand
|
class ExampleCommand
|
||||||
: public frc2::CommandHelper<frc2::Command, ExampleCommand> {
|
: public frc2::CommandHelper<frc2::Command, ExampleCommand> {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Creates a new ExampleCommand.
|
* Creates a new ExampleCommand.
|
||||||
*
|
*
|
||||||
* @param subsystem The subsystem used by this command.
|
* @param subsystem The subsystem used by this command.
|
||||||
*/
|
*/
|
||||||
explicit ExampleCommand(ExampleSubsystem* subsystem);
|
explicit ExampleCommand(ExampleSubsystem *subsystem);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ExampleSubsystem* m_subsystem;
|
ExampleSubsystem *m_subsystem;
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <frc2/command/SubsystemBase.h>
|
#include <frc2/command/SubsystemBase.h>
|
||||||
|
|
||||||
class Drivebase : public frc2::SubsystemBase {
|
class Drivebase : public frc2::SubsystemBase {
|
||||||
public:
|
public:
|
||||||
Drivebase();
|
Drivebase();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,7 @@ class Drivebase : public frc2::SubsystemBase {
|
||||||
*/
|
*/
|
||||||
void Periodic() override;
|
void Periodic() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Components (e.g. motor controllers and sensors) should generally be
|
// Components (e.g. motor controllers and sensors) should generally be
|
||||||
// declared private and exposed only through public methods.
|
// declared private and exposed only through public methods.
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <frc2/command/SubsystemBase.h>
|
#include <frc2/command/SubsystemBase.h>
|
||||||
|
|
||||||
class ExampleSubsystem : public frc2::SubsystemBase {
|
class ExampleSubsystem : public frc2::SubsystemBase {
|
||||||
public:
|
public:
|
||||||
ExampleSubsystem();
|
ExampleSubsystem();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,7 +35,7 @@ class ExampleSubsystem : public frc2::SubsystemBase {
|
||||||
*/
|
*/
|
||||||
void SimulationPeriodic() override;
|
void SimulationPeriodic() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Components (e.g. motor controllers and sensors) should generally be
|
// Components (e.g. motor controllers and sensors) should generally be
|
||||||
// declared private and exposed only through public methods.
|
// declared private and exposed only through public methods.
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue