]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robofsm: MoveHelper - make some parameters const personal/silhape2/boost
authorPetr Silhavik <silhavik.p@gmail.com>
Sat, 13 Apr 2013 17:57:12 +0000 (19:57 +0200)
committerPetr Silhavik <silhavik.p@gmail.com>
Sat, 13 Apr 2013 17:57:12 +0000 (19:57 +0200)
src/robofsm/movehelper.cc
src/robofsm/movehelper.h

index 38a655dccf00099216a9d54b5ae33e298ecc1f3d..3a3b4b5dea6d31d4a32b3a00cc4d082d2bc8ab8d 100644 (file)
@@ -56,7 +56,7 @@ TrajectoryConstraints trajectoryConstraintsDefault = {
  * @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);
@@ -173,7 +173,7 @@ void MoveHelper::send_speed(double left, double right) {
  * @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;
@@ -192,7 +192,7 @@ void MoveHelper::goto_notrans(double x, double y, move_target_heading heading, T
  * @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);
index 7695309f56da5124a7ec796bee0ceba12ce3cdf8..14ba5a6f913a2f61066680353494a271b74029e9 100644 (file)
@@ -52,12 +52,11 @@ class MoveHelper
 {
        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);
@@ -69,15 +68,15 @@ public:
                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);