Class MecanumDrive

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class MecanumDrive : public fang::chassis::HolonomicSubsystem

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

Subclassed by fang::chassis::UltraMk2MecanumDrive

Public Types

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

Public Functions

MecanumDrive(Drivers &drivers, std::unique_ptr<IQuadDrive> quadDrive, std::unique_ptr<Imu> imu, const Config &config)
Parameters:
  • quad – drive- QuadDrive to be owned by Mecanum subsystem

  • imu – - imu attached to the chassis

  • config – - see config

void 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

void 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.

virtual void initialize() override
void update() override
virtual void refresh() override

Called regularly

virtual void refreshSafeDisconnect() override

Kills functionality upon loss of remote input

struct ChassisDimensionConfig

Public Members

Meters wheelRadius
Meters verticalWheelDistance
Meters horizontalWheelDistance
struct Config

Rotation Ramp Speed - how many RPM/s Translation Ramp Speed - how how many m/s/s mecanumLogicConfig - see FieldMecanumLogic powerLimiterConfig - see PowerLimiter

Public Members

FieldMecanumLogic::Config mecanumLogicConfig