WPILibC++ 2027.0.0-alpha-5
Loading...
Searching...
No Matches
ExpansionHubVelocityConstants.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
8
9namespace wpi {
11
12/** This class contains feedback and feedforward constants for an ExpansionHub
13 * motor. */
15 public:
16 /**
17 * Sets the PID Controller gain parameters.
18 *
19 * Set the proportional, integral, and differential coefficients.
20 *
21 * @param p The proportional coefficient.
22 * @param i The integral coefficient.
23 * @param d The derivative coefficient.
24 * @return This object, for method chaining.
25 */
26 ExpansionHubVelocityConstants& SetPID(double p, double i, double d);
27
28 /**
29 * Sets the feed forward gains to the specified values.
30 *
31 * The units should be radians for angular systems and meters for linear
32 * systems.
33 *
34 * The motor control period is 10ms
35 *
36 * @param s The static gain in volts.
37 * @param v The velocity gain in volts per unit per second.
38 * @param a The acceleration gain in volts per unit per second squared.
39 * @return This object, for method chaining.
40 */
41 ExpansionHubVelocityConstants& SetFF(double s, double v, double a);
42
45 delete;
46
49 default;
50
51 friend class ExpansionHubMotor;
52
53 private:
54 ExpansionHubVelocityConstants(int hubNumber, int motorNumber);
55
56 wpi::nt::DoublePublisher m_pPublisher;
57 wpi::nt::DoublePublisher m_iPublisher;
58 wpi::nt::DoublePublisher m_dPublisher;
59
60 wpi::nt::DoublePublisher m_sPublisher;
61 wpi::nt::DoublePublisher m_vPublisher;
62 wpi::nt::DoublePublisher m_aPublisher;
63};
64} // namespace wpi
This class controls a specific motor and encoder hooked up to an ExpansionHub.
Definition ExpansionHubMotor.hpp:20
ExpansionHubVelocityConstants & SetPID(double p, double i, double d)
Sets the PID Controller gain parameters.
ExpansionHubVelocityConstants & SetFF(double s, double v, double a)
Sets the feed forward gains to the specified values.
ExpansionHubVelocityConstants & operator=(ExpansionHubVelocityConstants &)=delete
ExpansionHubVelocityConstants & operator=(ExpansionHubVelocityConstants &&)=default
ExpansionHubVelocityConstants(ExpansionHubVelocityConstants &)=delete
ExpansionHubVelocityConstants(ExpansionHubVelocityConstants &&)=default
friend class ExpansionHubMotor
Definition ExpansionHubVelocityConstants.hpp:51
NetworkTables Double publisher.
Definition DoubleTopic.hpp:126
T * p
Definition format.h:758
Definition CvSource.hpp:15