|
ThunderLib
|
Public Member Functions | |
| ThunderAutoProject () noexcept | |
| ThunderAutoProject (const std::filesystem::path &projectPath) noexcept | |
| bool | load (const std::filesystem::path &projectPath) noexcept |
| bool | discoverAndLoadFromDeployDirectory () noexcept |
| bool | isLoaded () const noexcept |
| operator bool () const noexcept | |
| std::string | getName () const noexcept |
| void | registerActionCommand (const std::string &actionName, frc2::CommandPtr command) |
| void | registerActionCommand (const std::string &actionName, std::shared_ptr< frc2::Command > command) |
| bool | isActionCommandRegistered (const std::string &actionName) const noexcept |
| bool | hasAction (const std::string &actionName) const noexcept |
| frc2::CommandPtr | getActionCommand (const std::string &actionName) const noexcept |
| void | registerBooleanCondition (const std::string &conditionName, BooleanConditionFunc condition) |
| bool | isBooleanConditionRegistered (const std::string &conditionName) const noexcept |
| BooleanConditionFunc | getBooleanCondition (const std::string &conditionName) const noexcept |
| void | registerSwitchCondition (const std::string &conditionName, SwitchConditionFunc condition) |
| bool | isSwitchConditionRegistered (const std::string &conditionName) const noexcept |
| SwitchConditionFunc | getSwitchCondition (const std::string &conditionName) const noexcept |
| std::unique_ptr< ThunderAutoTrajectory > | getTrajectory (const std::string &trajectoryName) const noexcept |
| bool | hasTrajectory (const std::string &trajectoryName) const noexcept |
| std::unordered_set< std::string > | getTrajectoryNames () const noexcept |
| std::unique_ptr< ThunderAutoMode > | getAutoMode (const std::string &autoModeName) const noexcept |
| bool | hasAutoMode (const std::string &autoModeName) const noexcept |
| std::unordered_set< std::string > | getAutoModeNames () const noexcept |
| FieldSymmetry | getFieldSymmetry () const noexcept |
| FieldDimensions | getFieldDimensions () const noexcept |
| void | setRemoteUpdatesEnabled (bool enabled) noexcept |
| void | enableRemoteUpdates () noexcept |
| void | disableRemoteUpdates () noexcept |
| bool | areRemoteUpdatesEnabled () const noexcept |
| RemoteUpdateSubscriberID | registerRemoteUpdateSubscriber (RemoteUpdateCallbackFunc callback) noexcept |
| bool | unregisterRemoteUpdateSubscriber (RemoteUpdateSubscriberID id) noexcept |
| driver::ThunderAutoProject * | getHandle () noexcept |
| const driver::ThunderAutoProject * | getHandle () const noexcept |
|
noexcept |
Default constructor. Creates an empty ThunderAuto project that is not loaded.
|
explicitnoexcept |
Loads a ThunderAuto project from the specified path.
| projectPath | The path to the ThunderAuto project. If an absolute path is provided, it will be used as-is. If a relative path is provided, it will be considered relative to the deploy directory. |
|
noexcept |
Check if remote project updates from ThunderAuto are enabled (enabled by default).
|
noexcept |
Disable remote project updates from ThunderAuto.
|
noexcept |
Scans the deploy directory for a ThunderAuto project and loads the first one it finds.
|
noexcept |
Enable remote project updates from ThunderAuto (enabled by default).
|
noexcept |
Get an action command by name.
If the action name references an action group defined in the project, the corresponding command group will be constructed and returned.
If the action name references an action command that has been registered via registerActionCommand(), the registered command will be returned.
If the action name does not reference a valid action group in the project or a registered command, a None command will be returned.
| actionName | The name of the action to get. |
|
nodiscardnoexcept |
Get an autonomous mode by name.
| autoModeName | The name of the autonomous mode to get. |
|
noexcept |
Get the names of all autonomous modes in the project.
|
noexcept |
Get a registered boolean condition by name.
| conditionName | The name of the condition to get. |
|
noexcept |
Get the size of the configured field for the loaded project.
|
noexcept |
Get the symmetry of the configured field for the loaded project.
|
noexcept |
Get the name of the loaded project.
|
noexcept |
Get a registered switch condition by name.
| conditionName | The name of the condition to get. |
|
nodiscardnoexcept |
Get a trajectory by name.
| trajectoryName | The name of the trajectory to get. |
|
noexcept |
Get the names of all trajectories in the project.
|
noexcept |
Check if an action with the given name exists in the project.
| actionName | The name of the action to check. |
|
noexcept |
Check if an autonomous mode with the given name exists.
| autoModeName | The name of the autonomous mode to check. |
|
noexcept |
Check if a trajectory with the given name exists.
| trajectoryName | The name of the trajectory to check. |
|
noexcept |
Check if an action command with the given name is registered.
| actionName | The name of the action to check. |
|
noexcept |
Check if a boolean condition with the given name is registered.
| conditionName | The name of the condition to check. |
|
noexcept |
Returns whether a project is successfully loaded.
|
noexcept |
Check if a switch condition with the given name is registered.
| conditionName | The name of the condition to check. |
|
noexcept |
Loads a ThunderAuto project from the specified path.
| projectPath | The path to the ThunderAuto project. If an absolute path is provided, it will be used as-is. If a relative path is provided, it will be considered relative to the deploy directory. |
|
explicitnoexcept |
Returns whether a project is successfully loaded.
| void thunder::ThunderAutoProject::registerActionCommand | ( | const std::string & | actionName, |
| frc2::CommandPtr | command ) |
Register an action command that is used in a trajectory or auto mode. If an action is already registered with the same name, it will be replaced. If an action referenced during the execution of a trajectory or auto mode is not found, nothing will be executed.
| actionName | The name of the action. |
| command | The command to be executed when the action is called. |
| void thunder::ThunderAutoProject::registerActionCommand | ( | const std::string & | actionName, |
| std::shared_ptr< frc2::Command > | command ) |
Register an action command that is used in a trajectory or auto mode. If an action is already registered with the same name, it will be replaced. If an action referenced during the execution of a trajectory or auto mode is not found, nothing will be executed.
| actionNameame | The name of the action. |
| command | The command to be executed when the action is called. |
| void thunder::ThunderAutoProject::registerBooleanCondition | ( | const std::string & | conditionName, |
| BooleanConditionFunc | condition ) |
Register a boolean condition that is used during a branch step in an auto mode to determine the next step to run. If a condition is already registered with the same name, it will be replaced. If a condition that is referenced during the execution of an auto mode is not found, the auto mode will stop executing and an error will be logged.
| conditionName | The name of the condition. |
| condition | The function that returns a boolean indicating the next step to run. |
|
noexcept |
Register a callback function to be called when the project is updated remotely from ThunderAuto.
| callback | The callback function to register. |
| void thunder::ThunderAutoProject::registerSwitchCondition | ( | const std::string & | conditionName, |
| SwitchConditionFunc | condition ) |
Register a switch condition that is used during a branch step in an auto mode to determine the next step to run. If a condition is already registered with the same name, it will be replaced. If a condition that is referenced during the execution of an auto mode is not found, the auto mode will stop executing and an error will be logged.
| conditionName | The name of the condition. |
| condition | The function that returns an integer indicating the next step to run. |
|
noexcept |
Set whether remote project updates from ThunderAuto are enabled (enabled by default). Remote updates will only occur only when the robot is in Disabled mode and FMS is not connected.
| enabled | True to enable remote updates, false to disable them. |
|
noexcept |
Unregister a previously registered remote update subscriber.
| id | The subscriber ID returned by registerRemoteUpdateSubscriber(). |