MRMS
Public Member Functions | List of all members
MotorGroupStar Class Reference

#include <mrm-board.h>

Inheritance diagram for MotorGroupStar:
MotorGroup

Public Member Functions

 MotorGroupStar (Robot *robot, MotorBoard *motorBoardFor45Degrees, uint8_t motorNumberFor45Degrees, MotorBoard *motorBoardFor135Degrees, uint8_t motorNumberFor135Degrees, MotorBoard *motorBoardForMinus135Degrees, uint8_t motorNumberForMinus135Degrees, MotorBoard *motorBoardForMinus45Degrees, uint8_t motorNumberForMinus45Degrees)
 
void go (float speed, float angleDegrees=0, float rotation=0, uint8_t speedLimit=127)
 
void goToEliminateErrors (float errorX, float errorY, float headingToMaintain, Mrm_pid *pidXY, Mrm_pid *pidRotation, bool verbose=false)
 
- Public Member Functions inherited from MotorGroup
 MotorGroup (Robot *robot)
 
void stop ()
 

Additional Inherited Members

- Protected Member Functions inherited from MotorGroup
float angleNormalized (float angle)
 
- Protected Attributes inherited from MotorGroup
MotorBoardmotorBoard [MAX_MOTORS_IN_GROUP] = { NULL, NULL, NULL, NULL }
 
uint8_t motorNumber [MAX_MOTORS_IN_GROUP]
 
RobotrobotContainer
 

Detailed Description

Motors' axles for a star - they all point to a central point. Useful for driving soccer robots with omni-wheels.

Constructor & Destructor Documentation

◆ MotorGroupStar()

MotorGroupStar::MotorGroupStar ( Robot robot,
MotorBoard motorBoardFor45Degrees,
uint8_t  motorNumberFor45Degrees,
MotorBoard motorBoardFor135Degrees,
uint8_t  motorNumberFor135Degrees,
MotorBoard motorBoardForMinus135Degrees,
uint8_t  motorNumberForMinus135Degrees,
MotorBoard motorBoardForMinus45Degrees,
uint8_t  motorNumberForMinus45Degrees 
)
Parameters
motorBoardFor45Degrees- motor controller for the motor which axle is inclined 45 degrees clockwise from robot's front.
motorNumberFor45Degrees- Controller's output number.
motorBoardFor13Degrees- motor controller for the motor which axle is inclined 135 degrees clockwise from robot's front.
motorNumberFor135Degrees- Controller's output number.
motorBoardForMinus135Degrees- motor controller for the motor which axle is inclined -135 degrees clockwise from robot's front.
motorNumberForMinus135Degrees- Controller's output number.
motorBoardForMinus45Degrees- motor controller for the motor which axle is inclined -45 degrees clockwise from robot's front.
motorNumberForMinus45Degrees- Controller's output number.

Member Function Documentation

◆ go()

void MotorGroupStar::go ( float  speed,
float  angleDegrees = 0,
float  rotation = 0,
uint8_t  speedLimit = 127 
)

Control of a robot with axles connected in a star formation, like in a RCJ soccer robot with omni wheels. Motor 0 is at 45 degrees, 1 at 135, 2 at -135, 3 at -45.

Parameters
speed- 0 to 100.
angleDegrees- Movement direction in a robot's coordinate system, in degrees. 0 degree is the front of the robot and positive angles are to the right. Values between -180 and 180.
rotation- Rotation speed (around the vertical axis), -100 to 100. Positive numbers turn the robot to the right. It makes sense to use smaller numbers because a value 100 turns on all the motors at maximal speed.
speedLimit- Speed limit, 0 to 127. For example, 80 will limit all the speeds to 80/127%. 0 will turn the motors off.

◆ goToEliminateErrors()

void MotorGroupStar::goToEliminateErrors ( float  errorX,
float  errorY,
float  errorRotation,
Mrm_pid pidXY,
Mrm_pid pidRotation,
bool  verbose = false 
)

Moves the robot in order to elinimate errors (for x and y directions).

Parameters
errorX- X axis error.
errorY- Y axis error.
headingToMaintain- Heading to maintain.
verbose- print details

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