Valkyrie 2026
Loading...
Searching...
No Matches
valor::differential::Differential Class Reference
Inheritance diagram for valor::differential::Differential:
valor::BaseSubsystem valor::Loggable

Public Member Functions

 Differential (std::vector< std::unique_ptr< BaseController > > leftMotors, std::vector< std::unique_ptr< BaseController > > rightMotors, std::unique_ptr< gyro::Gyro > gyro, units::meter_t trackWidth, units::meter_t wheelDiameter)
FrameWrapper< FieldFrame, frc::Pose2d > GetPose () const
FrameWrapper< FieldFrame, frc::Pose2d > GetRawPose () const
FrameWrapper< FieldFrame, frc::ChassisSpeeds > GetFieldRelativeSpeeds () const
FrameWrapper< RobotFrame, frc::ChassisSpeeds > GetRobotRelativeSpeeds () const
frc::DifferentialDriveWheelPositions GetWheelPositions () const
frc::DifferentialDriveWheelSpeeds GetWheelSpeeds () const
void ApplyRequest (requests::ApplyChassisSpeeds request)
void ApplyRequest (requests::ApplyWheelSpeeds request)
void ResetOdometry (frc::Pose2d pose)
Public Member Functions inherited from valor::BaseSubsystem
 BaseSubsystem (std::string name)
 Construct a new Valor Subsystem object.
virtual void AnalyzeDashboard ()
 Synchronize dashboard data (both read and write).
virtual void AssessInputs ()
 Read controller logic and set subsystem state.
virtual void AssignOutputs ()
 Read subsystem state and send motor commands.
virtual void Reset ()
 Reset all subsystem state.
void SetGamepads (valor::Gamepad *_operatorGamepad, valor::Gamepad *_driverGamepad)
Public Member Functions inherited from valor::Loggable
 Loggable (std::string_view name)
 Construct a Loggable that registers a top-level table name.
 Loggable (std::shared_ptr< nt::NetworkTable > table)
 Construct a Loggable that uses an existing NetworkTable.
 Loggable ()
 Default construct an uninitialized Loggable.
void LogChild (std::string_view name, Loggable *child)
 Register a child Loggable under a named subtree.
void LogChild (std::string_view name, wpi::Sendable *child)
 Register a child Sendable under a named subtree.
void SetPeriodicLevel (LogLevel level)
 Set the logging level for LoggablePeriodic.
template<typename T>
WriteLog (std::string_view field, const T &data, LogLevel level=LogLevel::Normal)
 Publish a value to NetworkTables under the given field.
template<typename T>
ReadLog (std::string_view field, const T &defaultValue={})
 Read a value from NetworkTables for the given field.
template<>
decltype(Loggable::subscribers) ::iterator addSubscriber (std::string_view field, const std::vector< bool > &defaultValue)
template<>
void WriteLogImpl (nt::Publisher *pub, const std::vector< bool > &data)
template<>
std::vector< bool > ReadLogImpl (nt::Subscriber *sub)

Protected Member Functions

void StartOdomThread (units::hertz_t freq)
virtual void UpdateOdometry ()
Protected Member Functions inherited from valor::Loggable
virtual void OnLoggingStart ()
 Hook invoked when logging is started for this object.
virtual void LoggablePeriodic ()
 Periodic callback for logging updates.

Protected Attributes

std::vector< std::unique_ptr< BaseController > > leftMotors
std::vector< std::unique_ptr< BaseController > > rightMotors
std::unique_ptr< gyro::Gyrogyro
util::Locked< frc::DifferentialDrivePoseEstimator > estimator
Protected Attributes inherited from valor::BaseSubsystem
valor::GamepadoperatorGamepad
valor::GamepaddriverGamepad

Additional Inherited Members

Static Public Member Functions inherited from valor::Loggable
static units::millisecond_t GetLoggingTime ()
static constexpr LoggableGetRoot ()

Member Data Documentation

◆ estimator

util::Locked<frc::DifferentialDrivePoseEstimator> valor::differential::Differential::estimator
protected
Initial value:
{kinematics, gyro->GetRotation().ToRotation2d(), GetWheelPositions().left,
GetWheelPositions().right, frc::Pose2d{}}

The documentation for this class was generated from the following file: