A class responsible for following a choreo or custom trajectory.
More...
#include <valkyrie/TrajectoryFollower.h>
|
| enum class | TrajectoryEndCondition { TIME
, POSITION
} |
| | Enum to represent the how the trajectory determines that it is finished: time or position.
|
| enum class | FieldSymmetry { MIRROR
, ROTATE
} |
|
|
| TrajectoryFollower ()=delete |
| | The default constructor where everything is initialized to zero.
|
|
| TrajectoryFollower (TrajectoryFollower &)=delete |
|
| TrajectoryFollower (TrajectoryFollower &&)=delete |
|
| static void | Register (Config config) |
| | Defines the essential functions for the trajectory follower.
|
| static frc2::CommandPtr | FollowPath (std::optional< choreo::Trajectory< choreo::SwerveSample > > traj, std::optional< TrajectoryEndCondition > end, std::optional< units::meter_t > tol, std::optional< std::function< bool()> > inter, bool isMirrored, bool resetOdom) |
| | Follows a choreo trajectory.
|
| static void | SetPID (WorldAlign::TranslationalPIDF_t x, WorldAlign::TranslationalPIDF_t y, WorldAlign::RotationalPIDF_t rot) |
| | Sets a new PIDF config.
|
A class responsible for following a choreo or custom trajectory.
◆ FollowPath()
| frc2::CommandPtr valor::TrajectoryFollower::FollowPath |
( |
std::optional< choreo::Trajectory< choreo::SwerveSample > > | traj, |
|
|
std::optional< TrajectoryEndCondition > | end, |
|
|
std::optional< units::meter_t > | tol, |
|
|
std::optional< std::function< bool()> > | inter, |
|
|
bool | isMirrored, |
|
|
bool | resetOdom ) |
|
static |
Follows a choreo trajectory.
- Parameters
-
| traj | The choreo trajectory to be followed |
| end | The optional type of condition that ends the command. Defaults to time |
| tol | The position tolerance when using position end condition |
| inter | An optional function that describes an interrupted condition. Returns a boolean |
| isMirrored | A boolean to mirror paths over the middle of the field on one alliance side |
| resetOdom | Whether to reset the odom at the start of the path |
- Returns
- Returns a command pointer that follows the path
◆ Register()
| void valor::TrajectoryFollower::Register |
( |
Config | config | ) |
|
|
static |
Defines the essential functions for the trajectory follower.
- Parameters
-
| reset | The resetOdom function |
| drive | The drive function that is FIELD RELATIVE |
| getter | The pose getter |
| sym | The type of field symmetry |
| fieldSizeX | The x field length |
| fieldSizeY | The y field length |
| alliance | Callback that determines whether the trajectory should be flipped. Usually this should be set to return if the current alliance is red. |
◆ SetPID()
| void valor::TrajectoryFollower::SetPID |
( |
WorldAlign::TranslationalPIDF_t | x, |
|
|
WorldAlign::TranslationalPIDF_t | y, |
|
|
WorldAlign::RotationalPIDF_t | rot ) |
|
static |
Sets a new PIDF config.
- Parameters
-
| x | The x PIDF config |
| y | The y PIDF config |
| rot | The rotation PIDF config |
The documentation for this class was generated from the following file: