[wpimath] Remove WheelPositions interface/concept (#6771)

This commit is contained in:
Christopher Mahoney
2024-07-16 15:39:24 -04:00
committed by GitHub
parent 7d64d4e24c
commit 6c0429c263
10 changed files with 8 additions and 67 deletions

View File

@@ -19,7 +19,6 @@
#include "frc/interpolation/TimeInterpolatableBuffer.h"
#include "frc/kinematics/Kinematics.h"
#include "frc/kinematics/Odometry.h"
#include "frc/kinematics/WheelPositions.h"
#include "units/time.h"
#include "wpimath/MathShared.h"

View File

@@ -91,8 +91,7 @@ class WPILIB_DLLEXPORT DifferentialDriveKinematics
DifferentialDriveWheelPositions Interpolate(
const DifferentialDriveWheelPositions& start,
const DifferentialDriveWheelPositions& end, double t) const override {
return {wpi::Lerp(start.left, end.left, t),
wpi::Lerp(start.right, end.right, t)};
return start.Interpolate(end, t);
}
/// Differential drive trackwidth.

View File

@@ -169,10 +169,7 @@ class WPILIB_DLLEXPORT MecanumDriveKinematics
MecanumDriveWheelPositions Interpolate(
const MecanumDriveWheelPositions& start,
const MecanumDriveWheelPositions& end, double t) const override {
return {wpi::Lerp(start.frontLeft, end.frontLeft, t),
wpi::Lerp(start.frontRight, end.frontRight, t),
wpi::Lerp(start.rearLeft, end.rearLeft, t),
wpi::Lerp(start.rearRight, end.rearRight, t)};
return start.Interpolate(end, t);
}
private:

View File

@@ -10,7 +10,6 @@
#include "frc/geometry/Rotation2d.h"
#include "frc/geometry/Translation2d.h"
#include "frc/kinematics/Kinematics.h"
#include "frc/kinematics/WheelPositions.h"
namespace frc {
/**

View File

@@ -1,15 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include <concepts>
namespace frc {
template <typename T>
concept WheelPositions =
std::copy_constructible<T> && requires(T a, T b, double t) {
{ a.Interpolate(b, t) } -> std::convertible_to<T>;
};
} // namespace frc