#include <robot.h>
#include <trgenconstr.h>
#include <math.h>
#include <stdbool.h>
Classes | |
struct | move_target_heading |
struct | move_target |
Defines | |
#define | TURN(heading) __target_heading(TOP_TURN_SHORTEST, (heading), 0) |
#define | TURN_CW(heading) __target_heading(TOP_TURN_CW, (heading), 0) |
#define | TURN_CCW(heading) __target_heading(TOP_TURN_CCW, (heading), 0) |
#define | NO_TURN() __target_heading(TOP_DONT_TURN, 0, 0) |
#define | ARRIVE_FROM(heading, dist) __target_heading(TOP_ARRIVE_FROM, (heading), (dist)) |
#define | robot_set_est_pos_trans(x, y, phi) robot_set_est_pos_notrans(__trans_x(x), __trans_y(y), __trans_ang(phi)) |
#define | robot_trajectory_add_point_trans(x, y) robot_trajectory_add_point_notrans(__trans_x(x), __trans_y(y)) |
#define | robot_trajectory_add_final_point_trans(x, y, heading) robot_trajectory_add_final_point_notrans(__trans_x(x), __trans_y(y), __trans_heading(heading)) |
#define | robot_goto_trans(x, y, heading, tc) robot_goto_notrans(__trans_x(x), __trans_y(y), __trans_heading(heading), tc) |
#define | robot_moveto_trans(x, y, heading, tc) robot_goto_notrans(__trans_x(x), __trans_y(y), __trans_heading(heading), tc) |
#define | robot_move_by_trans(distance, heading, tc) robot_move_by(distance, __trans_heading(heading), tc) |
Enumerations | |
enum | move_target_op { TOP_DONT_TURN, TOP_TURN_CW, TOP_TURN_CCW, TOP_TURN_SHORTEST, TOP_ARRIVE_FROM } |
Functions | |
bool | get_arrive_from_point (double target_x_m, double target_y_m, struct move_target_heading heading, double *point_x_m, double *point_y_m) |
void | robot_set_est_pos_notrans (double x, double y, double phi) |
Sets actual position of the robot and with respoect to color of the team. | |
void | robot_send_speed (double left, double right) |
void | robot_trajectory_new (struct TrajectoryConstraints *tc) |
Initializes new trajectory object for adding points. | |
void | robot_trajectory_new_backward (struct TrajectoryConstraints *tc) |
void | robot_trajectory_add_point_notrans (double x_m, double y_m) |
Adds point in absolute coordinates to previously initialized trajectory object. | |
void | robot_trajectory_add_final_point_notrans (double x_m, double y_m, struct move_target_heading heading) |
Adds final point to trajectory objects and starts robot movement. | |
void | robot_stop () |
Stop robot immediately. | |
void | robot_goto_notrans (double x, double y, struct move_target_heading heading, struct TrajectoryConstraints *tc) |
Go to a point using path planning to avoid apriori known obstacles. | |
void | robot_moveto_notrans (double x, double y, struct move_target_heading heading, struct TrajectoryConstraints *tc) |
Move to a point using straight line trajectory. | |
void | robot_move_by (double distance, struct move_target_heading heading, struct TrajectoryConstraints *tc) |
Move robot forward or backward. | |
Variables | |
struct TrajectoryConstraints | trajectoryConstraintsDefault |
bool | init_ekf_flag |
#define ARRIVE_FROM | ( | heading, | ||
dist | ||||
) | __target_heading(TOP_ARRIVE_FROM, (heading), (dist)) |
#define NO_TURN | ( | ) | __target_heading(TOP_DONT_TURN, 0, 0) |
#define robot_goto_trans | ( | x, | ||
y, | ||||
heading, | ||||
tc | ||||
) | robot_goto_notrans(__trans_x(x), __trans_y(y), __trans_heading(heading), tc) |
#define robot_move_by_trans | ( | distance, | ||
heading, | ||||
tc | ||||
) | robot_move_by(distance, __trans_heading(heading), tc) |
#define robot_moveto_trans | ( | x, | ||
y, | ||||
heading, | ||||
tc | ||||
) | robot_goto_notrans(__trans_x(x), __trans_y(y), __trans_heading(heading), tc) |
#define robot_set_est_pos_trans | ( | x, | ||
y, | ||||
phi | ||||
) | robot_set_est_pos_notrans(__trans_x(x), __trans_y(y), __trans_ang(phi)) |
#define robot_trajectory_add_final_point_trans | ( | x, | ||
y, | ||||
heading | ||||
) | robot_trajectory_add_final_point_notrans(__trans_x(x), __trans_y(y), __trans_heading(heading)) |
#define robot_trajectory_add_point_trans | ( | x, | ||
y | ||||
) | robot_trajectory_add_point_notrans(__trans_x(x), __trans_y(y)) |
#define TURN | ( | heading | ) | __target_heading(TOP_TURN_SHORTEST, (heading), 0) |
#define TURN_CCW | ( | heading | ) | __target_heading(TOP_TURN_CCW, (heading), 0) |
#define TURN_CW | ( | heading | ) | __target_heading(TOP_TURN_CW, (heading), 0) |
enum move_target_op |
bool get_arrive_from_point | ( | double | target_x_m, | |
double | target_y_m, | |||
struct move_target_heading | heading, | |||
double * | point_x_m, | |||
double * | point_y_m | |||
) |
void robot_goto_notrans | ( | double | x, | |
double | y, | |||
struct move_target_heading | heading, | |||
struct TrajectoryConstraints * | tc | |||
) |
Go to a point using path planning to avoid apriori known obstacles.
Go to a point using path planning to avoid apriori known obstacles.
Use path panner to find the trajectory. This function is intended to be called from main FSM.
x | X coordinate in meters. | |
y | Y coordinate in meters. | |
heading | Desired heading of the robot at goal point. |
void robot_move_by | ( | double | distance, | |
struct move_target_heading | heading, | |||
struct TrajectoryConstraints * | tc | |||
) |
Move robot forward or backward.
distance | Distance in meters ( >0 forward, <0 backward) | |
heading | Final heading | |
tc | Trajectory constrains |
void robot_moveto_notrans | ( | double | x, | |
double | y, | |||
struct move_target_heading | heading, | |||
struct TrajectoryConstraints * | tc | |||
) |
Move to a point using straight line trajectory.
If ARIVE_FROM is set, then the trajectory will be composed two lines.... TODO
void robot_send_speed | ( | double | left, | |
double | right | |||
) |
void robot_set_est_pos_notrans | ( | double | x, | |
double | y, | |||
double | phi | |||
) |
Sets actual position of the robot and with respoect to color of the team.
Should be used for setting initial position of the robot.
void robot_stop | ( | ) |
Stop robot immediately.
void robot_trajectory_add_final_point_notrans | ( | double | x_m, | |
double | y_m, | |||
struct move_target_heading | heading | |||
) |
Adds final point to trajectory objects and starts robot movement.
x_m | X coordinate in meters. | |
y_m | Y coordinate in meters. | |
heading | Desired heading (in degrees) of the robot in this point. NAN means don't care. Positive number or zero means turn counter-clockwise, negative number means turn clockwise. Example: DEG2RAD(90) means turn up counter-clockwise and DEG2RAD(-270) means turn up clockwise. |
void robot_trajectory_add_point_notrans | ( | double | x_m, | |
double | y_m | |||
) |
Adds point in absolute coordinates to previously initialized trajectory object.
x_m | X coordinate in meters. | |
y_m | Y coordinate in meters. |
void robot_trajectory_new | ( | struct TrajectoryConstraints * | tc | ) |
Initializes new trajectory object for adding points.
Path planner will not be used.
tc | Constrains for the trajectory. |
void robot_trajectory_new_backward | ( | struct TrajectoryConstraints * | tc | ) |
bool init_ekf_flag |