Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
fang::chassis::MecanumDrive Class Reference

#include <mecanum_drive.hpp>

Inheritance diagram for fang::chassis::MecanumDrive:
Collaboration diagram for fang::chassis::MecanumDrive:

Classes

struct  ChassisDimensionConfig
 
struct  Config
 

Public Types

using Imu = trap::communication::sensors::IImu
 

Public Member Functions

 MecanumDrive (Drivers &drivers, std::unique_ptr< IQuadDrive > quadDrive, std::unique_ptr< Imu > imu, const Config &config)
 
void setTargetTranslation (const physics::Velocity2D &translation) override
 
void setTargetRotation (const RPM &rotation) override
 
void initialize () override
 
void update () override
 
void refresh () override
 
void refreshSafeDisconnect () override
 
- Public Member Functions inherited from fang::chassis::HolonomicSubsystem
 HolonomicSubsystem (Drivers &drivers)
 
virtual ~HolonomicSubsystem ()
 
- Public Member Functions inherited from tap::control::Subsystem
 Subsystem (Drivers *drivers)
 
virtual ~Subsystem ()
 
void registerAndInitialize ()
 
mockable void setDefaultCommand (Command *defaultCommand)
 
mockable CommandgetDefaultCommand () const
 
mockable void setTestCommand (Command *testCommand)
 
mockable CommandgetTestCommand () const
 
virtual const char * getName () const
 
mockable int getGlobalIdentifier () const
 

Additional Inherited Members

- Protected Attributes inherited from tap::control::Subsystem
Driversdrivers
 

Detailed Description

Provides taproot friendly subsystem control functionality for a mecanum drive with dimensional analysis

Member Typedef Documentation

◆ Imu

Constructor & Destructor Documentation

◆ MecanumDrive()

fang::chassis::MecanumDrive::MecanumDrive ( Drivers drivers,
std::unique_ptr< IQuadDrive quadDrive,
std::unique_ptr< Imu imu,
const Config config 
)
Parameters
quaddrive- QuadDrive to be owned by Mecanum subsystem
imu- imu attached to the chassis
config- see config

Member Function Documentation

◆ initialize()

void fang::chassis::MecanumDrive::initialize ( )
overridevirtual

Called once when you add the Subsystem to the commandScheduler stored in the Drivers class.

Implements fang::chassis::HolonomicSubsystem.

Reimplemented in fang::chassis::PierceMecanumDrive.

◆ refresh()

void fang::chassis::MecanumDrive::refresh ( )
overridevirtual

Called regularly

Reimplemented from tap::control::Subsystem.

◆ refreshSafeDisconnect()

void fang::chassis::MecanumDrive::refreshSafeDisconnect ( )
overridevirtual

Kills functionality upon loss of remote input

Reimplemented from tap::control::Subsystem.

◆ setTargetRotation()

void fang::chassis::MecanumDrive::setTargetRotation ( const RPM rotation)
override

Set the angular velocity of the chassis. Counterclockwise is positive. This is due to ensuring consistency within mathematical convention. If you are taking the horizontal joystick position, you will likely need to multiply it by -1.

◆ setTargetTranslation()

void fang::chassis::MecanumDrive::setTargetTranslation ( const physics::Velocity2D translation)
override

This is relative to the field - the axis are basically wherever the robot faces forward at the start of the round

◆ update()

void fang::chassis::MecanumDrive::update ( )
override

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