mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpimath] Remove WheelPositions interface/concept (#6771)
This commit is contained in:
committed by
GitHub
parent
7d64d4e24c
commit
6c0429c263
@@ -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"
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 {
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user