-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added skeleton for path planner * Added pathweaver to wombat * Fixed errors in pathplanner * ran wpiformat --------- Co-authored-by: Paul Hodges <paul.hodges@student.education.wa.edu.au>
- Loading branch information
1 parent
da92a90
commit b063d97
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2023-2024 CurtinFRC | ||
// Open Source Software, you can modify it according to the terms | ||
// of the MIT License at the root of this project | ||
|
||
#include "utils/Pathplanner.h" | ||
|
||
using namespace wom; | ||
|
||
utils::Pathplanner::Pathplanner() {} | ||
|
||
frc::Trajectory utils::Pathplanner::getTrajectory(std::string_view path) { | ||
try { | ||
fs::path path_location = deploy_directory / path; | ||
return frc::TrajectoryUtil::FromPathweaverJson(path_location.string()); | ||
} catch (std::exception& e) { | ||
return getTrajectory(path); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2023-2024 CurtinFRC | ||
// Open Source Software, you can modify it according to the terms | ||
// of the MIT License at the root of this project | ||
|
||
#pragma once | ||
|
||
#include <frc/Filesystem.h> | ||
#include <frc/trajectory/TrajectoryUtil.h> | ||
#include <wpi/fs.h> | ||
|
||
#include "utils/Util.h" | ||
|
||
namespace wom { | ||
namespace utils { | ||
class Pathplanner { | ||
public: | ||
Pathplanner(); | ||
|
||
frc::Trajectory getTrajectory(std::string_view path); | ||
|
||
private: | ||
fs::path deploy_directory = frc::filesystem::GetDeployDirectory(); | ||
}; | ||
} // namespace utils | ||
} // namespace wom |