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

#include <abstract_field_mecanum_logic.hpp>

Public Types

using AbstractQuadDriveData = AbstractQuadSpeeds
 

Public Member Functions

void setMotion (const AbstractVelocity2D &translation, double rotationalOffset)
 
void setTotalMotion (const AbstractVelocity2D &translation, double rotationOffset, const Radians &robotAngle)
 
void setRobotAngle (const Radians &robotAngle)
 
void setTranslation (const AbstractVelocity2D &translation)
 
void setRotationOffset (double rotationalOffset)
 
Radians getRobotAngle () const
 
AbstractVelocity2D getTranslation () const
 
double getRotationOffset () const
 
AbstractQuadDriveData getWheelSpeeds () const
 

Detailed Description

This is called Field Mecanum Logic because the frame of refernce is relative to the field Translation is the percentage of the maximum speed Positive rotation is counterclockwise it a percentage of the maximum speed that will be applied to offset left and right sides to produce a rotation (i.e. if the max speed is 100 f/s, then 0.5 will mean that the difference between the overall motion of the left and right sides of the drive will be by 50 f/s. A positive value will mean the robot will rotate counterclockwise.)

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.

Member Typedef Documentation

◆ AbstractQuadDriveData

Member Function Documentation

◆ getRobotAngle()

Radians fang::chassis::AbstractFieldMecanumLogic::getRobotAngle ( ) const

◆ getRotationOffset()

double fang::chassis::AbstractFieldMecanumLogic::getRotationOffset ( ) const

◆ getTranslation()

AbstractVelocity2D fang::chassis::AbstractFieldMecanumLogic::getTranslation ( ) const

◆ getWheelSpeeds()

AbstractQuadSpeeds fang::chassis::AbstractFieldMecanumLogic::getWheelSpeeds ( ) const

◆ setMotion()

void fang::chassis::AbstractFieldMecanumLogic::setMotion ( const AbstractVelocity2D translation,
double  rotationalOffset 
)

◆ setRobotAngle()

void fang::chassis::AbstractFieldMecanumLogic::setRobotAngle ( const Radians robotAngle)

If the robot is facing forward at the field, that is 0 degrees. If the robot is facing left from the forward field direction, that is +90 degrees If the robot is racing right from the forward field direction that is -90 degrees

◆ setRotationOffset()

void fang::chassis::AbstractFieldMecanumLogic::setRotationOffset ( double  rotationalOffset)

◆ setTotalMotion()

void fang::chassis::AbstractFieldMecanumLogic::setTotalMotion ( const AbstractVelocity2D translation,
double  rotationOffset,
const Radians robotAngle 
)

◆ setTranslation()

void fang::chassis::AbstractFieldMecanumLogic::setTranslation ( const AbstractVelocity2D translation)

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