PathPlannerLib
Loading...
Searching...
No Matches
Pathfinding.h
1#pragma once
2
3#include "pathplanner/lib/pathfinding/Pathfinder.h"
4#include <memory>
5
6namespace pathplanner {
8public:
14 static inline void setPathfinder(std::unique_ptr<Pathfinder> pathfinder) {
15 Pathfinding::pathfinder = std::move(pathfinder);
16 }
17
19 static void ensureInitialized();
20
26 static inline bool isNewPathAvailable() {
27 return pathfinder->isNewPathAvailable();
28 }
29
37 static inline std::shared_ptr<PathPlannerPath> getCurrentPath(
38 PathConstraints constraints, GoalEndState goalEndState) {
39 return pathfinder->getCurrentPath(constraints, goalEndState);
40 }
41
48 static inline void setStartPosition(
49 const frc::Translation2d &startPosition) {
50 pathfinder->setStartPosition(startPosition);
51 }
52
59 static inline void setGoalPosition(const frc::Translation2d &goalPosition) {
60 pathfinder->setGoalPosition(goalPosition);
61 }
62
71 static inline void setDynamicObstacles(
72 const std::vector<std::pair<frc::Translation2d, frc::Translation2d>> &obs,
73 const frc::Translation2d &currentRobotPos) {
74 pathfinder->setDynamicObstacles(obs, currentRobotPos);
75 }
76
77private:
78 static std::unique_ptr<Pathfinder> pathfinder;
79};
80}
Definition: GoalEndState.h:9
Definition: PathConstraints.h:12
Definition: Pathfinding.h:7
static void setGoalPosition(const frc::Translation2d &goalPosition)
Definition: Pathfinding.h:59
static void setPathfinder(std::unique_ptr< Pathfinder > pathfinder)
Definition: Pathfinding.h:14
static std::shared_ptr< PathPlannerPath > getCurrentPath(PathConstraints constraints, GoalEndState goalEndState)
Definition: Pathfinding.h:37
static void setStartPosition(const frc::Translation2d &startPosition)
Definition: Pathfinding.h:48
static bool isNewPathAvailable()
Definition: Pathfinding.h:26
static void setDynamicObstacles(const std::vector< std::pair< frc::Translation2d, frc::Translation2d > > &obs, const frc::Translation2d &currentRobotPos)
Definition: Pathfinding.h:71
static void ensureInitialized()
Definition: Pathfinding.cpp:9