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

#include <robot_mecanum_logic.hpp>

Classes

struct  Config
 

Public Member Functions

 RobotMecanumLogic (const Config &config)
 
 RobotMecanumLogic (const Meters &horizontalWheelDistance, const Meters &verticalWheelDistance, const Meters &wheelRadius)
 
void setMotion (const Velocity2D &translation, const RPM &rotation)
 
void setTranslation (const Velocity2D &translation)
 
void setRotation (const RPM &rotation)
 
const Velocity2DgetTranslation () const
 
RPM getRotation () const
 
QuadRPM getWheelSpeeds () const
 

Constructor & Destructor Documentation

◆ RobotMecanumLogic() [1/2]

fang::chassis::RobotMecanumLogic::RobotMecanumLogic ( const Config config)

Refer to: https://research.ijcaonline.org/volume113/number3/pxc3901586.pdf in equation 24 The horizontalWheelDistance refers to twice as lx The verticalWheelDistance refers to twice as ly The vertical distance is parallel to the forward direction of the robot The horizontal distance is parallel to the sideways direction of the robot

◆ RobotMecanumLogic() [2/2]

fang::chassis::RobotMecanumLogic::RobotMecanumLogic ( const Meters horizontalWheelDistance,
const Meters verticalWheelDistance,
const Meters wheelRadius 
)

Member Function Documentation

◆ getRotation()

RPM fang::chassis::RobotMecanumLogic::getRotation ( ) const

◆ getTranslation()

const Velocity2D & fang::chassis::RobotMecanumLogic::getTranslation ( ) const

◆ getWheelSpeeds()

QuadRPM fang::chassis::RobotMecanumLogic::getWheelSpeeds ( ) const

◆ setMotion()

void fang::chassis::RobotMecanumLogic::setMotion ( const Velocity2D translation,
const RPM rotation 
)

Refer to https://gm0.org/en/latest/docs/software/tutorials/mecanum-drive.html The formula has been adapted so that the positive rotation is counter-clockwise. Although this is does not smoothly translate joystick movements, it is mathematically consistent with the convention that counter-clockwise. That is the main context for MecanumLogic. With the IMU being involved, it is imperative that a single rotational convention is used. And it is recommended that the mathematical ones would be the choice.

◆ setRotation()

void fang::chassis::RobotMecanumLogic::setRotation ( const RPM rotation)

◆ setTranslation()

void fang::chassis::RobotMecanumLogic::setTranslation ( const Velocity2D translation)

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