Skip to content

Commit

Permalink
[choreolib] Remove AutoFactory reference from Choreo.h (#976)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Dec 6, 2024
1 parent f4c70fb commit c7a3ffc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 31 deletions.
30 changes: 1 addition & 29 deletions choreolib/src/main/native/include/choreo/Choreo.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma once

#include <concepts>
#include <functional>
#include <filesystem>
#include <optional>
#include <string>
#include <string_view>
Expand All @@ -13,7 +13,6 @@
#include <fmt/format.h>
#include <frc/Errors.h>
#include <frc/Filesystem.h>
#include <frc/geometry/Pose2d.h>
#include <frc2/command/Subsystem.h>
#include <hal/FRCUsageReporting.h>
#include <wpi/MemoryBuffer.h>
Expand All @@ -30,9 +29,6 @@ namespace choreo {

inline constexpr uint32_t kSpecVersion = 1;

template <TrajectorySample SampleType, int Year>
class AutoFactory;

/**
* A class that handles loading choreo and caching choreo trajectories.
*/
Expand Down Expand Up @@ -243,30 +239,6 @@ class Choreo {
cache;
};

/**
* Create a factory that can be used to create AutoRoutine and AutoTrajectory.
*
* @tparam SampleType The type of samples in the trajectory.
* @tparam Year The field year. Defaults to the current year.
* @param poseSupplier A function that returns the current field-relative
* Pose2d of the robot.
* @param controller A function for following the current trajectory.
* @param mirrorTrajectory If this returns true, the path will be mirrored to
* the opposite side, while keeping the same coordinate system origin.
* This will be called every loop during the command.
* @param driveSubsystem The drive Subsystem to require for AutoTrajectory
* Commands.
* @return An AutoFactory that can be used to create AutoRoutines and
* AutoTrajectories.
* @see AutoChooser using this factory with AutoChooser to generate auto
* routines.
*/
template <TrajectorySample SampleType, int Year = util::kDefaultYear>
static AutoFactory<SampleType, Year> CreateAutoFactory(
std::function<frc::Pose2d()> poseSupplier,
std::function<void(frc::Pose2d, SampleType)> controller,
std::function<bool()> mirrorTrajectory, frc2::Subsystem driveSubsystem);

private:
static constexpr std::string_view TRAJECTORY_FILE_EXTENSION = ".traj";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#pragma once

#include <type_traits>

#include <frc/geometry/Pose2d.h>
#include <frc/kinematics/ChassisSpeeds.h>
#include <units/acceleration.h>
Expand All @@ -10,6 +12,7 @@
#include <units/angular_velocity.h>
#include <units/force.h>
#include <units/length.h>
#include <units/time.h>
#include <units/velocity.h>
#include <wpi/MathExtras.h>
#include <wpi/json_fwd.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#pragma once

#include <cmath>
#include <string>
#include <unordered_map>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <algorithm>
#include <array>
#include <type_traits>

#include <frc/kinematics/ChassisSpeeds.h>
#include <units/acceleration.h>
Expand All @@ -12,6 +13,7 @@
#include <units/angular_velocity.h>
#include <units/force.h>
#include <units/length.h>
#include <units/time.h>
#include <units/velocity.h>
#include <wpi/MathExtras.h>
#include <wpi/json_fwd.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#pragma once

#include <concepts>

#include <frc/geometry/Pose2d.h>
#include <frc/kinematics/ChassisSpeeds.h>
#include <units/time.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

#pragma once

#include <array>
#include <numbers>
#include <utility>

#include <frc/geometry/Pose2d.h>
#include <units/base.h>
#include <units/angle.h>
#include <units/length.h>

#include "choreo/util/Map.h"

Expand Down

0 comments on commit c7a3ffc

Please sign in to comment.