2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
auto_selector.h
Go to the documentation of this file.
1
4
5#pragma once
6
9#include <frc2/command/Command.h>
10
11#include <initializer_list>
12#include <vector>
13
18 public:
23
30 AutoSelector(std::initializer_list<AutonomousCommand*> commands, AutonomousCommand* defaultCommand = nullptr);
31
37 void AddCommand(std::initializer_list<AutonomousCommand*> commands);
38
44 void AddCommand(AutonomousCommand* command);
45
51 void SetDefaultCommand(AutonomousCommand* defaultCommand);
52
59 frc2::Command* GetSelectedCommand() const;
60
61 private:
62 std::vector<AutonomousCommand*> m_commands;
65
69 void UpdateSelectorEntries() const;
70};
Allow user to select from auto routines using the default dashboard autonomous selector.
Definition auto_selector.h:17
std::vector< AutonomousCommand * > m_commands
All autonomous commands that can be selected.
Definition auto_selector.h:62
argos_lib::ArgosLogger m_log
Definition auto_selector.h:64
AutoSelector()
Initialize with no available auto routines. More may be added later.
Definition auto_selector.cpp:9
void SetDefaultCommand(AutonomousCommand *defaultCommand)
Set the default command to run if user selection is invalid.
Definition auto_selector.cpp:28
frc2::Command * GetSelectedCommand() const
Get the command selected by the user on the dashboard. Will return default command if no match is fou...
Definition auto_selector.cpp:32
void AddCommand(std::initializer_list< AutonomousCommand * > commands)
Add a set of commands to the selector.
Definition auto_selector.cpp:18
AutonomousCommand * m_default
Command to run if dashboard selection is invalid.
Definition auto_selector.h:63
void UpdateSelectorEntries() const
Update dashboard with latest command list.
Definition auto_selector.cpp:56
A command that can be selected from the dashboard.
Definition autonomous_command.h:14
Log to the console in a clean, repeatable manner.
Definition log.h:22