47 :
public Kinematics<MecanumDriveWheelPositions, MecanumDriveWheelVelocities,
48 MecanumDriveWheelAccelerations> {
66 : m_frontLeftWheel{frontLeftWheel},
67 m_frontRightWheel{frontRightWheel},
68 m_rearLeftWheel{rearLeftWheel},
69 m_rearRightWheel{rearRightWheel} {
70 SetInverseKinematics(frontLeftWheel, frontRightWheel, rearLeftWheel,
72 m_forwardKinematics = m_inverseKinematics.householderQr();
174 return start.Interpolate(end, t);
191 Eigen::HouseholderQR<Matrixd<4, 3>> m_forwardKinematics;
#define WPILIB_DLLEXPORT
Definition SymbolExports.hpp:36
Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual wheel v...
Definition Kinematics.hpp:26
static void ReportUsage(std::string_view resource, std::string_view data)
Definition MathShared.hpp:61
MecanumDriveWheelVelocities ToWheelVelocities(const ChassisVelocities &chassisVelocities) const override
Performs inverse kinematics to return the wheel velocities from a desired chassis velocity.
Definition MecanumDriveKinematics.hpp:110
const Translation2d & GetRearRight() const
Returns the rear-right wheel translation.
Definition MecanumDriveKinematics.hpp:169
const Translation2d & GetFrontLeft() const
Returns the front-left wheel translation.
Definition MecanumDriveKinematics.hpp:148
MecanumDriveWheelPositions Interpolate(const MecanumDriveWheelPositions &start, const MecanumDriveWheelPositions &end, double t) const override
Performs interpolation between two values.
Definition MecanumDriveKinematics.hpp:171
MecanumDriveWheelVelocities ToWheelVelocities(const ChassisVelocities &chassisVelocities, const Translation2d ¢erOfRotation) const
Performs inverse kinematics to return the wheel velocities from a desired chassis velocity.
Twist2d ToTwist2d(const MecanumDriveWheelPositions &start, const MecanumDriveWheelPositions &end) const override
Performs forward kinematics to return the resulting Twist2d from the given change in wheel positions.
Twist2d ToTwist2d(const MecanumDriveWheelPositions &wheelDeltas) const
Performs forward kinematics to return the resulting Twist2d from the given wheel position deltas.
ChassisVelocities ToChassisVelocities(const MecanumDriveWheelVelocities &wheelVelocities) const override
Performs forward kinematics to return the resulting chassis state from the given wheel velocities.
ChassisAccelerations ToChassisAccelerations(const MecanumDriveWheelAccelerations &wheelAccelerations) const override
Performs forward kinematics to return the resulting chassis accelerations from the wheel acceleration...
MecanumDriveWheelAccelerations ToWheelAccelerations(const ChassisAccelerations &chassisAccelerations, const Translation2d ¢erOfRotation) const
MecanumDriveWheelAccelerations ToWheelAccelerations(const ChassisAccelerations &chassisAccelerations) const override
Performs inverse kinematics to return the wheel accelerations from a desired chassis acceleration.
Definition MecanumDriveKinematics.hpp:184
MecanumDriveKinematics(Translation2d frontLeftWheel, Translation2d frontRightWheel, Translation2d rearLeftWheel, Translation2d rearRightWheel)
Constructs a mecanum drive kinematics object.
Definition MecanumDriveKinematics.hpp:62
MecanumDriveKinematics(const MecanumDriveKinematics &)=default
const Translation2d & GetRearLeft() const
Returns the rear-left wheel translation.
Definition MecanumDriveKinematics.hpp:162
const Translation2d & GetFrontRight() const
Returns the front-right wheel translation.
Definition MecanumDriveKinematics.hpp:155
Represents a translation in 2D space.
Definition Translation2d.hpp:30
Definition LinearSystem.hpp:20
Eigen::Matrix< double, Rows, Cols, Options, MaxRows, MaxCols > Matrixd
Definition EigenCore.hpp:21
Represents robot chassis accelerations.
Definition ChassisAccelerations.hpp:21
Represents robot chassis velocities.
Definition ChassisVelocities.hpp:26
Represents the wheel accelerations for a mecanum drive drivetrain.
Definition MecanumDriveWheelAccelerations.hpp:14
Represents the wheel positions for a mecanum drive drivetrain.
Definition MecanumDriveWheelPositions.hpp:15
Represents the wheel velocities for a mecanum drive drivetrain.
Definition MecanumDriveWheelVelocities.hpp:18
A change in distance along a 2D arc since the last pose update.
Definition Twist2d.hpp:23