Chassis class.
More...
#include <chassis.hpp>
|
| | Chassis (Drivetrain_t drivetrain, ChassisController_t lateralSettings, ChassisController_t angularSettings, OdomSensors_t sensors) |
| | Construct a new Chassis. More...
|
| |
| void | calibrate () |
| | Calibrate the chassis sensors. More...
|
| |
| void | setPose (double x, double y, double theta, bool radians=false) |
| | Set the pose of the chassis. More...
|
| |
| void | setPose (Pose pose, bool radians=false) |
| | Set the pose of the chassis. More...
|
| |
| Pose | getPose (bool radians=false) |
| | Get the pose of the chassis. More...
|
| |
| void | turnTo (float x, float y, int timeout, bool reversed=false, float maxSpeed=127, bool log=false) |
| | Turn the chassis so it is facing the target point. More...
|
| |
| void | moveTo (float x, float y, int timeout, float maxSpeed=200, bool log=false) |
| | Move the chassis towards the target point. More...
|
| |
| void | follow (const char *filePath, int timeout, float lookahead, bool reverse=false, float maxSpeed=127, bool log=false) |
| | Move the chassis along a path. More...
|
| |
◆ Chassis()
Construct a new Chassis.
- Parameters
-
| drivetrain | drivetrain to be used for the chassis |
| lateralSettings | settings for the lateral controller |
| angularSettings | settings for the angular controller |
| sensors | sensors to be used for odometry |
◆ calibrate()
| void lemlib::Chassis::calibrate |
( |
| ) |
|
Calibrate the chassis sensors.
◆ follow()
| void lemlib::Chassis::follow |
( |
const char * |
filePath, |
|
|
int |
timeout, |
|
|
float |
lookahead, |
|
|
bool |
reverse = false, |
|
|
float |
maxSpeed = 127, |
|
|
bool |
log = false |
|
) |
| |
Move the chassis along a path.
- Parameters
-
| filePath | file path to the path. No need to preface it with /usd/ |
| timeout | the maximum time the robot can spend moving |
| lookahead | the lookahead distance. Units in inches. Larger values will make the robot move faster but will follow the path less accurately |
| reverse | whether the robot should follow the path in reverse. false by default |
| maxSpeed | the maximum speed the robot can move at |
| log | whether the chassis should log the path on a log file. false by default. |
◆ getPose()
| Pose lemlib::Chassis::getPose |
( |
bool |
radians = false | ) |
|
Get the pose of the chassis.
- Parameters
-
| radians | whether theta should be in radians (true) or degrees (false). false by default |
- Returns
- Pose
◆ moveTo()
| void lemlib::Chassis::moveTo |
( |
float |
x, |
|
|
float |
y, |
|
|
int |
timeout, |
|
|
float |
maxSpeed = 200, |
|
|
bool |
log = false |
|
) |
| |
Move the chassis towards the target point.
The PID logging ids are "angularPID" and "lateralPID"
- Parameters
-
| x | x location |
| y | y location |
| timeout | longest time the robot can spend moving |
| maxSpeed | the maximum speed the robot can move at |
| log | whether the chassis should log the turnTo function. false by default |
◆ setPose() [1/2]
| void lemlib::Chassis::setPose |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
theta, |
|
|
bool |
radians = false |
|
) |
| |
Set the pose of the chassis.
- Parameters
-
| x | new x value |
| y | new y value |
| theta | new theta value |
| radians | true if theta is in radians, false if not. False by default |
◆ setPose() [2/2]
| void lemlib::Chassis::setPose |
( |
Pose |
pose, |
|
|
bool |
radians = false |
|
) |
| |
Set the pose of the chassis.
- Parameters
-
| pose | the new pose |
| radians | whether pose theta is in radians (true) or not (false). false by default |
◆ turnTo()
| void lemlib::Chassis::turnTo |
( |
float |
x, |
|
|
float |
y, |
|
|
int |
timeout, |
|
|
bool |
reversed = false, |
|
|
float |
maxSpeed = 127, |
|
|
bool |
log = false |
|
) |
| |
Turn the chassis so it is facing the target point.
The PID logging id is "angularPID"
- Parameters
-
| x | x location |
| y | y location |
| timeout | longest time the robot can spend moving |
| reversed | whether the robot should turn in the opposite direction. false by default |
| maxSpeed | the maximum speed the robot can turn at. Default is 200 |
| log | whether the chassis should log the turnTo function. false by default |
The documentation for this class was generated from the following file: