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)
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)

Static Public Attributes

static constexpr int NUM_WHEELS = 4

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::unique_ptr< gyro::Gyrogyro
Wheels wheels
util::Locked< frc::MecanumDrivePoseEstimator > 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::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