// 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 "wpi/math/controller/struct/DifferentialDriveFeedforwardStruct.hpp" namespace { constexpr size_t kKvLinearOff = 0; constexpr size_t kKaLinearOff = kKvLinearOff + 8; constexpr size_t kKvAngularOff = kKaLinearOff + 8; constexpr size_t kKaAngularOff = kKvAngularOff + 8; } // namespace frc::DifferentialDriveFeedforward wpi::Struct< frc::DifferentialDriveFeedforward>::Unpack(std::span data) { return { decltype(1_V / 1_mps){wpi::UnpackStruct(data)}, decltype(1_V / 1_mps_sq){wpi::UnpackStruct(data)}, decltype(1_V / 1_mps){wpi::UnpackStruct(data)}, decltype(1_V / 1_mps_sq){wpi::UnpackStruct(data)}}; } void wpi::Struct::Pack( std::span data, const frc::DifferentialDriveFeedforward& value) { wpi::PackStruct(data, value.m_kVLinear.value()); wpi::PackStruct(data, value.m_kALinear.value()); wpi::PackStruct(data, value.m_kVAngular.value()); wpi::PackStruct(data, value.m_kAAngular.value()); }