6#include <frc/DriverStation.h>
7#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>
17#include "valkyrie/Gamepad.h"
18#include "valkyrie/Loggable.h"
19#include "valkyrie/util/Profiler.h"
63 frc2::CommandScheduler::GetInstance().RegisterSubsystem(
this);
150 operatorGamepad = _operatorGamepad;
151 driverGamepad = _driverGamepad;
161 if (frc::DriverStation::IsTeleopEnabled())
163 units::millisecond_t assessInputsTime = profiler.Get();
166 units::millisecond_t analyzeDashboardTime = profiler.Get() - assessInputsTime;
168 if (frc::DriverStation::IsEnabled())
170 units::millisecond_t assignOutputsTime = profiler.Get() - analyzeDashboardTime;
171 if (util::Profiler::IsEnabled()) {
172 WriteLog(
"Profiler/Cycle Time", units::millisecond_t{profiler.Get()});
173 WriteLog(
"Profiler/Assign Outputs Time", assignOutputsTime);
174 WriteLog(
"Profiler/Assess Inputs Time", assessInputsTime);
175 WriteLog(
"Profiler/Analyze Dashboard Time", analyzeDashboardTime);
BaseSubsystem(std::string name)
Construct a new Valor Subsystem object.
Definition BaseSubsystem.h:62
virtual void AnalyzeDashboard()
Synchronize dashboard data (both read and write).
Definition BaseSubsystem.h:83
virtual void AssessInputs()
Read controller logic and set subsystem state.
Definition BaseSubsystem.h:106
virtual void AssignOutputs()
Read subsystem state and send motor commands.
Definition BaseSubsystem.h:134
virtual void Reset()
Reset all subsystem state.
Definition BaseSubsystem.h:147
Enhanced wrapper around frc::XboxController.
Definition Gamepad.h:24
Base helper for publishing and subscribing values to NetworkTables.
Definition Loggable.h:218
T WriteLog(std::string_view field, const T &data, LogLevel level=LogLevel::Normal)
Publish a value to NetworkTables under the given field.
Definition Loggable.h:326
Loggable(std::string_view name)
Construct a Loggable that registers a top-level table name.