2024-07-29 07:55:44 -07:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
2025-11-07 19:56:21 -05:00
|
|
|
#include "../../StructTestBase.hpp"
|
|
|
|
|
#include "wpi/math/controller/DifferentialDriveFeedforward.hpp"
|
2024-07-29 07:55:44 -07:00
|
|
|
|
2025-11-07 20:00:05 -05:00
|
|
|
using namespace wpi::math;
|
2024-07-29 07:55:44 -07:00
|
|
|
|
|
|
|
|
struct DifferentialDriveFeedforwardStructTestData {
|
|
|
|
|
using Type = DifferentialDriveFeedforward;
|
|
|
|
|
|
|
|
|
|
inline static const Type kTestData{
|
|
|
|
|
decltype(1_V / 1_mps){0.174}, decltype(1_V / 1_mps_sq){0.229},
|
|
|
|
|
decltype(1_V / 1_mps){4.4}, decltype(1_V / 1_mps_sq){4.5}};
|
|
|
|
|
|
|
|
|
|
static void CheckEq(const Type& testData, const Type& data) {
|
2026-04-25 14:32:08 -04:00
|
|
|
EXPECT_EQ(testData.kVLinear.value(), data.kVLinear.value());
|
|
|
|
|
EXPECT_EQ(testData.kALinear.value(), data.kALinear.value());
|
|
|
|
|
EXPECT_EQ(testData.kVAngular.value(), data.kVAngular.value());
|
|
|
|
|
EXPECT_EQ(testData.kAAngular.value(), data.kAAngular.value());
|
2024-07-29 07:55:44 -07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
INSTANTIATE_TYPED_TEST_SUITE_P(DifferentialDriveFeedforward, StructTest,
|
|
|
|
|
DifferentialDriveFeedforwardStructTestData);
|