7#include <frc/DriverStation.h>
8#include <frc/TimedRobot.h>
9#include <frc2/command/SubsystemBase.h>
10#include <networktables/NetworkTable.h>
11#include <networktables/NetworkTableEntry.h>
12#include <networktables/NetworkTableInstance.h>
13#include <wpi/sendable/Sendable.h>
14#include <wpi/sendable/SendableBuilder.h>
15#include <wpi/sendable/SendableHelper.h>
18#include "valkyrie/Gamepad.h"
19#include "valkyrie/Loggable.h"
20#include "valkyrie/util/Profiler.h"
64 frc2::CommandScheduler::GetInstance().RegisterSubsystem(
this);
151 operatorGamepad = _operatorGamepad;
152 driverGamepad = _driverGamepad;
162 if (frc::DriverStation::IsTeleopEnabled())
164 units::millisecond_t assessInputsTime = profiler.Get();
167 units::millisecond_t analyzeDashboardTime = profiler.Get() - assessInputsTime;
169 if (frc::DriverStation::IsEnabled())
171 units::millisecond_t assignOutputsTime = profiler.Get() - analyzeDashboardTime;
172 if (util::Profiler::IsEnabled()) {
173 WriteLog(
"Profiler/Cycle Time", units::millisecond_t{profiler.Get()});
174 WriteLog(
"Profiler/Assign Outputs Time", assignOutputsTime);
175 WriteLog(
"Profiler/Assess Inputs Time", assessInputsTime);
176 WriteLog(
"Profiler/Analyze Dashboard Time", analyzeDashboardTime);
Abstract class that all Valor subsystem's should implement.
Definition BaseSubsystem.h:52
virtual void reset()
Reset all subsystem state.
Definition BaseSubsystem.h:148
BaseSubsystem(std::string name)
Construct a new Valor Subsystem object.
Definition BaseSubsystem.h:63
virtual void analyzeDashboard()
Synchronize dashboard data (both read and write)
Definition BaseSubsystem.h:84
virtual void assignOutputs()
Read subsystem state and send motor commands.
Definition BaseSubsystem.h:135
virtual void assessInputs()
Read controller logic and set subsystem state.
Definition BaseSubsystem.h:107
Wrapper class for XBox gamepads.
Definition Gamepad.h:20
Base helper for publishing and subscribing values to NetworkTables.
Definition Loggable.h:204
T WriteLog(std::string_view field, const T &data)
Publish a value to NetworkTables under the given field.
Definition Loggable.h:313