* @param tc Constrains for the trajectory.
* @param backward Backward trajectory, implicit value false.
*/
-MoveHelper& MoveHelper::trajectory_new(TrajectoryConstraints* tc, bool backward) {
+MoveHelper& MoveHelper::trajectory_new(const TrajectoryConstraints* tc, bool backward) {
if (!tc) tc = &trajectoryConstraintsDefault;
if (t) delete t;
t = new Trajectory(*tc, backward);
* @param heading Desired heading of the robot at goal point.
* @param planning Use planning or not.
*/
-void MoveHelper::goto_notrans(double x, double y, move_target_heading heading, TrajectoryConstraints* tc, bool planning) {
+void MoveHelper::goto_notrans(double x, double y, move_target_heading heading, const TrajectoryConstraints* tc, bool planning) {
move_target *target = new move_target();
target->x = x;
target->y = y;
* @param heading Final heading
* @param tc Trajectory constrains
*/
-void MoveHelper::move_by(double distance, move_target_heading heading, TrajectoryConstraints* tc) {
+void MoveHelper::move_by(double distance, move_target_heading heading, const TrajectoryConstraints* tc) {
double x, y, phi;
robot.get_est_pos(x, y, phi);
{
struct Trajectory *t;
final_heading fh;
- move_target_heading mh;
move_target_heading trans_heading(move_target_heading h);
public:
/* Low-level trajectory handling */
- MoveHelper& trajectory_new(TrajectoryConstraints *tc, bool backward = false);
- MoveHelper& trajectory_new_backward(TrajectoryConstraints *tc) {
+ MoveHelper& trajectory_new(const TrajectoryConstraints *tc, bool backward = false);
+ MoveHelper& trajectory_new_backward(const TrajectoryConstraints *tc) {
return trajectory_new(tc, true);
}
MoveHelper& add_point_notrans(double x_m, double y_m);
add_final_point_notrans(trans_x(x), trans_y(y), trans_heading(heading));
}
void send_speed(double left, double right);
- void goto_notrans(double x, double y, move_target_heading heading, TrajectoryConstraints *tc, bool planning = true);
- void goto_trans(double x, double y, move_target_heading heading, TrajectoryConstraints *tc) {
+ void goto_notrans(double x, double y, move_target_heading heading, const TrajectoryConstraints *tc, bool planning = true);
+ void goto_trans(double x, double y, move_target_heading heading, const TrajectoryConstraints *tc) {
goto_notrans(trans_x(x), trans_y(y), trans_heading(heading), tc, true);
}
- void moveto_trans(double x, double y, move_target_heading heading, TrajectoryConstraints *tc) {
+ void moveto_trans(double x, double y, move_target_heading heading, const TrajectoryConstraints *tc) {
goto_notrans(trans_x(x), trans_y(y), trans_heading(heading), tc, false);
}
- void move_by(double distance, move_target_heading heading, TrajectoryConstraints *tc);
- void move_by_trans(double distance, move_target_heading heading, TrajectoryConstraints *tc) {
+ void move_by(double distance, move_target_heading heading, const TrajectoryConstraints *tc);
+ void move_by_trans(double distance, move_target_heading heading, const TrajectoryConstraints *tc) {
move_by(distance, trans_heading(heading), tc);
}
bool get_arrive_from_point(double target_x_m, double target_y_m, move_target_heading heading, double &point_x_m, double &point_y_m);