WPILibC++  2020.3.2
SwerveDriveKinematicsConstraint.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2019 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <cmath>
11 
12 #include <units/units.h>
13 
14 #include "frc/kinematics/SwerveDriveKinematics.h"
15 #include "frc/trajectory/constraint/TrajectoryConstraint.h"
16 
23 namespace frc {
24 
25 template <size_t NumModules>
27  public:
30  units::meters_per_second_t maxSpeed);
31 
32  units::meters_per_second_t MaxVelocity(
33  const Pose2d& pose, curvature_t curvature,
34  units::meters_per_second_t velocity) override;
35 
36  MinMax MinMaxAcceleration(const Pose2d& pose, curvature_t curvature,
37  units::meters_per_second_t speed) override;
38 
39  private:
41  units::meters_per_second_t m_maxSpeed;
42 };
43 } // namespace frc
44 
45 #include "SwerveDriveKinematicsConstraint.inc"
frc::TrajectoryConstraint::MinMax
Represents a minimum and maximum acceleration.
Definition: TrajectoryConstraint.h:37
frc::TrajectoryConstraint
An interface for defining user-defined velocity and acceleration constraints while generating traject...
Definition: TrajectoryConstraint.h:22
frc::Pose2d
Represents a 2d pose containing translational and rotational elements.
Definition: Pose2d.h:23
frc::curvature_t
units::unit_t< units::compound_unit< units::radian, units::inverse< units::meter > >> curvature_t
Define a unit for curvature.
Definition: Trajectory.h:27
frc::SwerveDriveKinematics
Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual module ...
Definition: SwerveDriveKinematics.h:47
frc::SwerveDriveKinematicsConstraint::MinMaxAcceleration
MinMax MinMaxAcceleration(const Pose2d &pose, curvature_t curvature, units::meters_per_second_t speed) override
Returns the minimum and maximum allowable acceleration for the trajectory given pose,...
Definition: SwerveDriveKinematicsConstraint.inc:43
frc::SwerveDriveKinematicsConstraint
Definition: SwerveDriveKinematicsConstraint.h:26
frc
A class that enforces constraints on the differential drive kinematics.
Definition: SPIAccelerometerSim.h:16
frc::SwerveDriveKinematicsConstraint::MaxVelocity
units::meters_per_second_t MaxVelocity(const Pose2d &pose, curvature_t curvature, units::meters_per_second_t velocity) override
Returns the max velocity given the current pose and curvature.
Definition: SwerveDriveKinematicsConstraint.inc:27