mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Run wpiformat on merged repo (#1021)
This commit is contained in:
committed by
Peter Johnson
parent
0babbf317c
commit
6729a7d6b1
@@ -12,9 +12,9 @@
|
||||
#include <SmartDashboard/SmartDashboard.h>
|
||||
|
||||
void Robot::RobotInit() {
|
||||
m_chooser.AddDefault(kAutoNameDefault, kAutoNameDefault);
|
||||
m_chooser.AddObject(kAutoNameCustom, kAutoNameCustom);
|
||||
frc::SmartDashboard::PutData("Auto Modes", &m_chooser);
|
||||
m_chooser.AddDefault(kAutoNameDefault, kAutoNameDefault);
|
||||
m_chooser.AddObject(kAutoNameCustom, kAutoNameCustom);
|
||||
frc::SmartDashboard::PutData("Auto Modes", &m_chooser);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,24 +29,24 @@ void Robot::RobotInit() {
|
||||
* make sure to add them to the chooser code above as well.
|
||||
*/
|
||||
void Robot::AutonomousInit() {
|
||||
m_autoSelected = m_chooser.GetSelected();
|
||||
// m_autoSelected = SmartDashboard::GetString("Auto Selector",
|
||||
// kAutoNameDefault);
|
||||
std::cout << "Auto selected: " << m_autoSelected << std::endl;
|
||||
m_autoSelected = m_chooser.GetSelected();
|
||||
// m_autoSelected = SmartDashboard::GetString("Auto Selector",
|
||||
// kAutoNameDefault);
|
||||
std::cout << "Auto selected: " << m_autoSelected << std::endl;
|
||||
|
||||
if (m_autoSelected == kAutoNameCustom) {
|
||||
// Custom Auto goes here
|
||||
} else {
|
||||
// Default Auto goes here
|
||||
}
|
||||
if (m_autoSelected == kAutoNameCustom) {
|
||||
// Custom Auto goes here
|
||||
} else {
|
||||
// Default Auto goes here
|
||||
}
|
||||
}
|
||||
|
||||
void Robot::AutonomousPeriodic() {
|
||||
if (m_autoSelected == kAutoNameCustom) {
|
||||
// Custom Auto goes here
|
||||
} else {
|
||||
// Default Auto goes here
|
||||
}
|
||||
if (m_autoSelected == kAutoNameCustom) {
|
||||
// Custom Auto goes here
|
||||
} else {
|
||||
// Default Auto goes here
|
||||
}
|
||||
}
|
||||
|
||||
void Robot::TeleopInit() {}
|
||||
|
||||
@@ -13,17 +13,17 @@
|
||||
#include <TimedRobot.h>
|
||||
|
||||
class Robot : public frc::TimedRobot {
|
||||
public:
|
||||
void RobotInit() override;
|
||||
void AutonomousInit() override;
|
||||
void AutonomousPeriodic() override;
|
||||
void TeleopInit() override;
|
||||
void TeleopPeriodic() override;
|
||||
void TestPeriodic() override;
|
||||
public:
|
||||
void RobotInit() override;
|
||||
void AutonomousInit() override;
|
||||
void AutonomousPeriodic() override;
|
||||
void TeleopInit() override;
|
||||
void TeleopPeriodic() override;
|
||||
void TestPeriodic() override;
|
||||
|
||||
private:
|
||||
frc::SendableChooser<std::string> m_chooser;
|
||||
const std::string kAutoNameDefault = "Default";
|
||||
const std::string kAutoNameCustom = "My Auto";
|
||||
std::string m_autoSelected;
|
||||
private:
|
||||
frc::SendableChooser<std::string> m_chooser;
|
||||
const std::string kAutoNameDefault = "Default";
|
||||
const std::string kAutoNameCustom = "My Auto";
|
||||
std::string m_autoSelected;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user