ThunderLib
Loading...
Searching...
No Matches
TrajectoryRunnerProperties.hpp
1#pragma once
2
3#include <frc/controller/HolonomicDriveController.h>
4#include <frc/geometry/Pose2d.h>
5#include <frc/kinematics/ChassisSpeeds.h>
6#include <functional>
7#include <memory>
8
9namespace thunder {
10
15 using GetPoseFunc = std::function<frc::Pose2d()>;
16 using ResetPoseFunc = std::function<void(const frc::Pose2d&)>;
17 using GetSpeedsFunc = std::function<frc::ChassisSpeeds()>;
18 using SetSpeedsFunc = std::function<void(const frc::ChassisSpeeds&)>;
19
23 GetPoseFunc getPose;
24
30 ResetPoseFunc resetPose;
31
37 SetSpeedsFunc setSpeeds;
38
45 std::shared_ptr<frc::HolonomicDriveController> controller;
46
47 bool isValid() const { return (getPose != nullptr) && (setSpeeds != nullptr) && (controller != nullptr); }
48
49 explicit operator bool() const { return isValid(); }
50};
51
52} // namespace thunder
Definition TrajectoryRunnerProperties.hpp:14
std::shared_ptr< frc::HolonomicDriveController > controller
Definition TrajectoryRunnerProperties.hpp:45
ResetPoseFunc resetPose
Definition TrajectoryRunnerProperties.hpp:30
SetSpeedsFunc setSpeeds
Definition TrajectoryRunnerProperties.hpp:37
GetPoseFunc getPose
Definition TrajectoryRunnerProperties.hpp:23