// 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 wpi::math::DifferentialDriveFeedforward wpi::util::Struct::Unpack( std::span data) { return {decltype(1_V / 1_mps){wpi::util::UnpackStruct(data)}, decltype(1_V / 1_mps_sq){ wpi::util::UnpackStruct(data)}, decltype(1_V / 1_mps){wpi::util::UnpackStruct(data)}, decltype(1_V / 1_mps_sq){ wpi::util::UnpackStruct(data)}}; } void wpi::util::Struct::Pack( std::span data, const wpi::math::DifferentialDriveFeedforward& value) { wpi::util::PackStruct(data, value.m_kVLinear.value()); wpi::util::PackStruct(data, value.m_kALinear.value()); wpi::util::PackStruct(data, value.m_kVAngular.value()); wpi::util::PackStruct(data, value.m_kAAngular.value()); }