Class FieldMecanumLogic¶
Defined in File field_mecanum_logic.hpp
Class Documentation¶
-
class FieldMecanumLogic¶
Public Types
-
using Config = RobotMecanumLogic::Config¶
Public Functions
-
FieldMecanumLogic(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
-
FieldMecanumLogic(const Meters &horizontalWheelDistance, const Meters &verticalWheelDistance, const Meters &wheelRadius)¶
-
void 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.
-
void setTotalMotion(const Velocity2D &translation, const RPM &rotation, const Radians &robotAngle)¶
-
void 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
-
void setTranslation(const Velocity2D &translation)¶
-
const Velocity2D &getTranslation() const¶
-
using Config = RobotMecanumLogic::Config¶