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

Classes

struct  Wheels

Public Member Functions

 Mecanum (wpi::array< std::pair< std::unique_ptr< BaseController >, frc::Translation2d >, NUM_WHEELS > wheels, std::unique_ptr< gyro::Gyro > gyro, 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::MecanumDriveWheelPositions GetWheelPositions () const
frc::MecanumDriveWheelSpeeds GetWheelSpeeds () const
void ApplyRequest (requests::ApplyChassisSpeeds)
void ApplyRequest (requests::ApplyWheelSpeeds)
void ResetOdometry (frc::Pose2d pose)
void StartOdomThread (units::hertz_t freq)
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
 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.
bool WriteLog (std::string_view field, bool data)
double WriteLog (std::string_view field, double data)
void WriteLog (std::string_view field, const std::vector< double > &data)
template<typename U>
requires units::traits::is_unit_t_v<U>
U WriteLog (std::string_view field, U data)
void WriteLog (std::string_view field, std::string_view data)
template<typename E>
requires std::is_enum_v<E>
void WriteLog (std::string_view field, E data)
template<typename T>
requires wpi::StructSerializable<T> && (!std::is_arithmetic_v<T>)
void WriteLog (std::string_view field, const T &data)
template<typename T>
requires wpi::StructSerializable<T> && (!std::is_arithmetic_v<T>)
void WriteLog (std::string_view field, const std::vector< T > &data)
bool ReadLog (std::string_view field, bool defaultValue)
double ReadLog (std::string_view field, double defaultValue)
template<typename U>
requires units::traits::is_unit_t_v<U>
U ReadLog (std::string_view field, U defaultValue)

Static Public Attributes

static constexpr int NUM_WHEELS = 4

Protected Member Functions

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::unique_ptr< gyro::Gyro > gyro
Wheels wheels
util::Locked< frc::MecanumDrivePoseEstimator > estimator
Protected Attributes inherited from valor::BaseSubsystem
valor::Gamepad * operatorGamepad = nullptr
valor::Gamepad * driverGamepad = nullptr

Additional Inherited Members

Static Public Member Functions inherited from valor::Loggable
static constexpr Loggable & GetRoot ()

Member Data Documentation

◆ estimator

util::Locked<frc::MecanumDrivePoseEstimator> valor::mecanum::Mecanum::estimator
protected
Initial value:
{kinematics, gyro->GetRotation().ToRotation2d(), GetWheelPositions(),
frc::Pose2d{}}

The documentation for this class was generated from the following file:
  • src/main/include/valkyrie/drivetrain/mecanum/Mecanum.h