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

#include <abstract_robot_mecanum_logic.hpp>

Public Types

using AbstractVelocity2D = physics::AbstractVelocity2D
 

Public Member Functions

void setMotion (const AbstractVelocity2D &translation, double rotationalOffset)
 
void setTranslation (const AbstractVelocity2D &translation)
 
void setRotationOffset (double rotationalOffset)
 
AbstractVelocity2D getTranslation () const
 
double getRotationOffset () const
 
AbstractQuadSpeeds getWheelSpeeds () const
 

Detailed Description

This is called RobotMecanumLogic because the frame of reference is relative to the robot. It will always strafe relative to the robot and not 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

◆ AbstractVelocity2D

Member Function Documentation

◆ getRotationOffset()

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

◆ getTranslation()

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

◆ getWheelSpeeds()

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

◆ setMotion()

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

◆ setRotationOffset()

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

◆ setTranslation()

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

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