#include <bot.h>
|
| | Bot () |
| |
| void | execute () |
| | Begins issuing instructions to the robot. More...
|
| |
| State | get_state () |
| |
| void | move_x (float distance, float velocity) |
| | Adds an instruction to move in the x direction. More...
|
| |
| void | move_y (float distance, float velocity) |
| | Adds an instruction to move in the y direction. More...
|
| |
| void | move (Eigen::Vector2f position, Eigen::Vector2f velocity) |
| | Adds an instruction to move. More...
|
| |
| void | smooth_move (Eigen::Vector2f position, float velocity, float omega=1 *pi/3) |
| | Adds an instruction to move. More...
|
| |
| void | spline_move () |
| |
| void | rotate (float theta, float omega) |
| | Adds an instruction to rotate in place. More...
|
| |
| void | set_led (std::vector< Eigen::Vector3i > lights) |
| | Messes with the lights on the robot, which the manual explicitly says not to do. More...
|
| |
| void | set_pyr (Eigen::Vector3d pitch, Eigen::Vector3d yaw, Eigen::Vector3d roll) |
| | Sets pitch/yaw/roll of bot's body. More...
|
| |
| void | set_height (float h, float v) |
| | Sets height of bot's body from the ground. More...
|
| |
◆ Bot()
◆ estimate_pose()
| Pose Bot::estimate_pose |
( |
Pose |
prev, |
|
|
a1::HighState |
state |
|
) |
| |
|
private |
Guesses current position.
◆ execute()
Begins issuing instructions to the robot.
Initializes the UDP threads and the control loop, then forces main thread to wait. Only call when all instructions have been specified.
◆ get_state()
- Returns
- state of the robot represented as a State.
◆ move()
| void Bot::move |
( |
Eigen::Vector2f |
position, |
|
|
Eigen::Vector2f |
velocity |
|
) |
| |
Adds an instruction to move.
- Parameters
-
| position | Position to walk to in meters relative to robot. |
| velocity | Velocity of robot while walking. -0.4 to 0.4 m/s. |
◆ move_x()
| void Bot::move_x |
( |
float |
distance, |
|
|
float |
velocity |
|
) |
| |
Adds an instruction to move in the x direction.
- Parameters
-
| distance | Relative distance (in meters) to walk along x axis. |
| velocity | Velocity of robot while walking. -0.7 to 1 m/s. |
◆ move_y()
| void Bot::move_y |
( |
float |
distance, |
|
|
float |
velocity |
|
) |
| |
Adds an instruction to move in the y direction.
- Parameters
-
| distance | Relative distance (in meters) to strafe along y axis. |
| velocity | Velocity of robot while walking. -0.4 to 0.4 m/s. |
◆ RobotControl()
| void Bot::RobotControl |
( |
| ) |
|
|
private |
Executes each instruction.
Ran repeatedly in a thread at runtime.
- See also
- Bot::execute()
◆ rotate()
| void Bot::rotate |
( |
float |
theta, |
|
|
float |
omega |
|
) |
| |
Adds an instruction to rotate in place.
- Parameters
-
| theta | Angle to rotate (in rad). |
| omega | Angular velocity (in rad/s). -2pi/3 to 2pi/3 rad/s. |
◆ set_height()
| void Bot::set_height |
( |
float |
h, |
|
|
float |
v |
|
) |
| |
Sets height of bot's body from the ground.
Pretty useless for now.
◆ set_led()
| void Bot::set_led |
( |
std::vector< Eigen::Vector3i > |
lights | ) |
|
Messes with the lights on the robot, which the manual explicitly says not to do.
You probably shouldn't run this.
- Parameters
-
| lights | RGB values for each light. |
◆ set_pyr()
| void Bot::set_pyr |
( |
Eigen::Vector3d |
pitch, |
|
|
Eigen::Vector3d |
yaw, |
|
|
Eigen::Vector3d |
roll |
|
) |
| |
Sets pitch/yaw/roll of bot's body.
Pretty useless for now.
◆ smooth_move()
| void Bot::smooth_move |
( |
Eigen::Vector2f |
position, |
|
|
float |
velocity, |
|
|
float |
omega = 1*pi/3 |
|
) |
| |
Adds an instruction to move.
Rotates first, does no strafing.
- Parameters
-
| position | Position to walk to in meters relative to robot. |
| velocity | Velocity of robot while walking. -0.4 to 0.4 m/s. |
| omega | Magnitude of angular velocity (in rad/s). 0 to 2pi/3 rad/s. |
- See also
- Bot::move()
◆ spline_move()
| void Bot::spline_move |
( |
| ) |
|
◆ UDPRecv()
Updates internal UDP struct.
Ran repeatedly in a thread at runtime.
- See also
- Bot::execute()
◆ UDPSend()
Sends contents of internal UDP struct.
Ran repeatedly in a thread at runtime.
- See also
- Bot::execute()
◆ validate_cmd()
| bool Bot::validate_cmd |
( |
a1::HighCmd |
cmd | ) |
|
|
private |
Ensures a HighCmd is safe to run.
◆ cmd
| a1::HighCmd Bot::cmd = {0} |
|
private |
Command to issue to robot's UDP server.
◆ dt
Timestep for threads. Allowed range: 0.001~0.01.
◆ executing
| bool Bot::executing = false |
|
private |
Whether or not an instruction is in progress.
◆ index
Index of current instruction to execute.
◆ initial_pose
◆ instructions
◆ motiontime
Amount of time that has passed.
◆ safe
Specifies operation mode?
◆ state
| a1::HighState Bot::state = {0} |
|
private |
State recieved from robot's UDP server.
◆ udp
UDP struct that stores payloads to send/recv.
The documentation for this class was generated from the following files: