#include <TrajectoryRunnerProperties.hpp>
|
|
using | GetPoseFunc = std::function<frc::Pose2d()> |
| |
|
using | ResetPoseFunc = std::function<void(const frc::Pose2d&)> |
| |
|
using | GetSpeedsFunc = std::function<frc::ChassisSpeeds()> |
| |
|
using | SetSpeedsFunc = std::function<void(const frc::ChassisSpeeds&)> |
| |
| using | SetSpeedsWithDiagnosticsFunc |
| |
|
using | ControlFunc = std::function<void(const DriveControllerInputData&)> |
| |
|
using | StopFunc = std::function<void()> |
| |
|
| | TrajectoryRunnerProperties (GetPoseFunc getPoseFunc, ResetPoseFunc resetPoseFunc, SetSpeedsFunc setSpeedsFunc, std::shared_ptr< frc::HolonomicDriveController > holonomicDriveController) |
| |
| | TrajectoryRunnerProperties (GetPoseFunc getPoseFunc, ResetPoseFunc resetPoseFunc, SetSpeedsWithDiagnosticsFunc setSpeedsWithDiagnosticsFunc, std::shared_ptr< frc::HolonomicDriveController > holonomicDriveController) |
| |
| | TrajectoryRunnerProperties (GetPoseFunc getPose, ResetPoseFunc resetPose, ControlFunc control, StopFunc stop) |
| |
|
bool | isValid () const |
| |
|
| operator bool () const |
| |
A set of callback functions and properties required to run a trajectory.
◆ SetSpeedsWithDiagnosticsFunc
| using thunder::TrajectoryRunnerProperties::SetSpeedsWithDiagnosticsFunc |
Initial value:
std::function<void(const frc::ChassisSpeeds&, const DriveControllerInputData&)>
◆ TrajectoryRunnerProperties() [1/3]
| thunder::TrajectoryRunnerProperties::TrajectoryRunnerProperties |
( |
GetPoseFunc | getPoseFunc, |
|
|
ResetPoseFunc | resetPoseFunc, |
|
|
SetSpeedsFunc | setSpeedsFunc, |
|
|
std::shared_ptr< frc::HolonomicDriveController > | holonomicDriveController ) |
|
inline |
Constructor for TrajectoryRunnerProperties.
- Parameters
-
| getPose | Function that returns the current robot pose. |
| resetPose | Function that resets the robot pose (and PID controllers too!) |
| setSpeeds | Function that controls the robot chassis speeds (robot-centric). |
| holonomicDriveController | The holonomic drive controller for trajectory following. ThunderLib will NOT reset its x, y, or theta PID controllers; the user should do that in the resetPose function if desired. |
◆ TrajectoryRunnerProperties() [2/3]
| thunder::TrajectoryRunnerProperties::TrajectoryRunnerProperties |
( |
GetPoseFunc | getPoseFunc, |
|
|
ResetPoseFunc | resetPoseFunc, |
|
|
SetSpeedsWithDiagnosticsFunc | setSpeedsWithDiagnosticsFunc, |
|
|
std::shared_ptr< frc::HolonomicDriveController > | holonomicDriveController ) |
|
inline |
Constructor for TrajectoryRunnerProperties.
- Parameters
-
| getPose | Function that returns the current robot pose. |
| resetPose | Function that resets the robot pose (and PID controllers too!) |
| setSpeedsWithDiagnostics | Function that controls the robot chassis speeds (robot-centric) with diagnostic data. |
| holonomicDriveController | The holonomic drive controller for trajectory following. ThunderLib will NOT reset its x, y, or theta PID controllers; the user should do that in the resetPose function if desired. |
◆ TrajectoryRunnerProperties() [3/3]
| thunder::TrajectoryRunnerProperties::TrajectoryRunnerProperties |
( |
GetPoseFunc | getPose, |
|
|
ResetPoseFunc | resetPose, |
|
|
ControlFunc | control, |
|
|
StopFunc | stop ) |
|
inline |
Constructor for TrajectoryRunnerProperties, with no drive controller. Instead, a consumer of DriveControllerInputData must be provided instead of the typical chassis speeds consumer, and the user is responsible for calculating the appropriate speeds on their own.
- Parameters
-
| getPose | Function that returns the current robot pose. |
| resetPose | Function that resets the robot pose (and PID controllers too!) |
| control | Function that controls the robot based on the provided DriveControllerInputData. |
| stop | Function that stops the robot. |
◆ control
| const ControlFunc thunder::TrajectoryRunnerProperties::control = nullptr |
◆ controller
| const std::shared_ptr<frc::HolonomicDriveController> thunder::TrajectoryRunnerProperties::controller = nullptr |
Holonomic drive controller to use for following the trajectory.
- Note
- ThunderLib will NOT reset the controller's x, y, or theta PID controllers; the user should do that in the resetPose function if desired.
◆ getPose
| const GetPoseFunc thunder::TrajectoryRunnerProperties::getPose = nullptr |
Gets the current pose of the robot.
◆ resetPose
| const ResetPoseFunc thunder::TrajectoryRunnerProperties::resetPose = nullptr |
Resets the robot's pose to the specified pose (and PID controllers too!).
If not provided (nullptr), the robot's pose will not be reset at the start of the trajectory.
◆ setSpeeds
| const SetSpeedsFunc thunder::TrajectoryRunnerProperties::setSpeeds = nullptr |
Control the robot's chassis speeds.
Speeds are robot-relative, not field-relative.
◆ setSpeedsWithDiagnostics
| const SetSpeedsWithDiagnosticsFunc thunder::TrajectoryRunnerProperties::setSpeedsWithDiagnostics = nullptr |
Control the robot's chassis speeds with diagnostic data.
Speeds are robot-relative, not field-relative.
◆ stop
| const StopFunc thunder::TrajectoryRunnerProperties::stop = nullptr |
Stop the robot (at the end of the trajectory or on interruption).
The documentation for this struct was generated from the following file: