WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
DCMotorStruct.hpp
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
10
11template <>
12struct WPILIB_DLLEXPORT wpi::util::Struct<wpi::math::DCMotor> {
13 static constexpr std::string_view GetTypeName() { return "DCMotor"; }
14 static constexpr size_t GetSize() { return 40; }
15 static constexpr std::string_view GetSchema() {
16 return "double nominal_voltage;double stall_torque;double "
17 "stall_current;double "
18 "free_current;double free_speed";
19 }
20
21 static wpi::math::DCMotor Unpack(std::span<const uint8_t> data);
22 static void Pack(std::span<uint8_t> data, const wpi::math::DCMotor& value);
23};
24
#define WPILIB_DLLEXPORT
Definition SymbolExports.hpp:36
Holds the constants for a DC motor.
Definition DCMotor.hpp:19
Specifies that a type is capable of raw struct serialization and deserialization.
Definition Struct.hpp:69
Definition CvSource.hpp:15
static constexpr std::string_view GetSchema()
Definition DCMotorStruct.hpp:15
static void Pack(std::span< uint8_t > data, const wpi::math::DCMotor &value)
static wpi::math::DCMotor Unpack(std::span< const uint8_t > data)
static constexpr size_t GetSize()
Definition DCMotorStruct.hpp:14
static constexpr std::string_view GetTypeName()
Definition DCMotorStruct.hpp:13
Struct serialization template.
Definition Struct.hpp:39