7#include <condition_variable>
8#include <initializer_list>
16#include "ctre/Phoenix.h"
27 template <
class Callable>
29 return toPhysicalUnitsFunction(1.0).template to<double>();
59 std::initializer_list<ctre::phoenix::motorcontrol::can::BaseTalon*> motors,
71 const std::vector<ctre::phoenix::motorcontrol::can::BaseTalon*>
Allows user to set PID parameters from network tables and update the motor configurations on updates....
Definition nt_motor_pid_tuner.h:48
ClosedLoopSensorConversions m_sensorConversions
Sensor conversion factors used to translate raw sensor readings.
Definition nt_motor_pid_tuner.h:76
argos_lib::NTSubscriber m_updateSubscriber
Subscriber to manage all updates from user inputs through network tables.
Definition nt_motor_pid_tuner.h:70
const std::vector< ctre::phoenix::motorcontrol::can::BaseTalon * > m_pMotors
Motors being configured and monitored.
Definition nt_motor_pid_tuner.h:72
std::mutex m_threadMutex
Lock to aid notifying thread of stop.
Definition nt_motor_pid_tuner.h:78
const unsigned m_pidSlot
PID slot index actively used on motors.
Definition nt_motor_pid_tuner.h:73
std::thread m_statusUpdateThread
Thread monitoring motors.
Definition nt_motor_pid_tuner.h:80
std::shared_ptr< nt::NetworkTable > m_pntTable
Network table containing status and tuning keys.
Definition nt_motor_pid_tuner.h:74
std::condition_variable m_threadStopCv
Used to notify thread to stop at shutdown.
Definition nt_motor_pid_tuner.h:79
~NTMotorPIDTuner()
Destroy the NTMotorPIDTuner object.
Definition nt_motor_pid_tuner.cpp:79
void UpdateClosedLoopMonitoringThread()
Update statuses from all motors.
Definition nt_motor_pid_tuner.cpp:84
Subscribes to Network Tables entry updates and calls a specified callback to use the new value.
Definition nt_subscriber.h:17
Definition swap_controllers_command.h:12
constexpr double GetSensorConversionFactor(Callable toPhysicalUnitsFunction)
Generates a double value to convert raw sensor values to physical units represented as a double.
Definition nt_motor_pid_tuner.h:28
Conversion factors to aid displaying sensor values as meaningful numbers.
Definition nt_motor_pid_tuner.h:35
double velocity
Multiply by this to convert sensor velocity units to physical units.
Definition nt_motor_pid_tuner.h:37
double setpoint
Multiply by this to convert sensor setpoint units to physical units (should be the same as either pos...
Definition nt_motor_pid_tuner.h:38
double position
Multiply by this to convert sensor position units to physical units.
Definition nt_motor_pid_tuner.h:36