ChoreoLib
Loading...
Searching...
No Matches
Choreo.h
1// Copyright (c) Choreo contributors
2
3#pragma once
4
5#include <frc/controller/PIDController.h>
6#include <frc/kinematics/ChassisSpeeds.h>
7#include <frc2/command/CommandPtr.h>
8#include <frc2/command/Requirements.h>
9
10#include <functional>
11#include <string>
12#include <string_view>
13#include <vector>
14
15#include "ChoreoTrajectory.h"
16
17namespace choreolib {
18
20using ChoreoControllerFunction =
21 std::function<frc::ChassisSpeeds(frc::Pose2d, ChoreoTrajectoryState)>;
22
25class Choreo {
26 public:
36 static ChoreoTrajectory GetTrajectory(std::string_view trajName);
37
53 static std::vector<ChoreoTrajectory> GetTrajectoryGroup(
54 std::string_view trajName);
55
78 static frc2::CommandPtr ChoreoSwerveCommandFactory(
79 ChoreoTrajectory trajectory, std::function<frc::Pose2d()> poseSupplier,
80 frc::PIDController xController, frc::PIDController yController,
81 frc::PIDController rotationController,
82 std::function<void(frc::ChassisSpeeds)> outputChassisSpeeds,
83 std::function<bool(void)> mirrorTrajectory,
84 frc2::Requirements requirements = {});
85
104 static frc2::CommandPtr ChoreoSwerveCommandFactory(
105 ChoreoTrajectory trajectory, std::function<frc::Pose2d()> poseSupplier,
106 ChoreoControllerFunction controller,
107 std::function<void(frc::ChassisSpeeds)> outputChassisSpeeds,
108 std::function<bool(void)> mirrorTrajectory,
109 frc2::Requirements requirements = {});
110
123 static ChoreoControllerFunction ChoreoSwerveController(
124 frc::PIDController xController, frc::PIDController yController,
125 frc::PIDController rotationController);
126};
127} // namespace choreolib
Definition ChoreoTrajectory.h:13
Definition Choreo.h:25
static ChoreoControllerFunction ChoreoSwerveController(frc::PIDController xController, frc::PIDController yController, frc::PIDController rotationController)
Definition Choreo.cpp:92
static std::vector< ChoreoTrajectory > GetTrajectoryGroup(std::string_view trajName)
Definition Choreo.cpp:39
static ChoreoTrajectory GetTrajectory(std::string_view trajName)
Definition Choreo.cpp:21
static frc2::CommandPtr ChoreoSwerveCommandFactory(ChoreoTrajectory trajectory, std::function< frc::Pose2d()> poseSupplier, frc::PIDController xController, frc::PIDController yController, frc::PIDController rotationController, std::function< void(frc::ChassisSpeeds)> outputChassisSpeeds, std::function< bool(void)> mirrorTrajectory, frc2::Requirements requirements={})
Definition Choreo.cpp:65