ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Meaning of the move_base simple_attractor parameter?

asked 2012-07-10 13:46:41 -0600

Pi Robot gravatar image

Hello,

I am running the latest Electric Debian install on an Ubuntu 11.10 machine. I've spent several days tinkering with move_base parameters to get a simulated TurtleBot (physics off) to move to the four corners of a 1 meter square in an otherwise blank world/map (no obstacles). I wanted the simulated robot to hit the corners as closely as possible (xy_goal_tolerance: 0.05, yaw_goal_tolerance: 0.2), but the robot kept spinning in place when it was just a few centimeters from the goal.

Then I discovered the (undocumented?) simple_attractor parameter when playing around with dynamic_reconfigure and when I click this checkbox suddenly my problems go away and the robot makes it to the goal locations without spinning. So it would be nice to know what does this magic parameter mean?

Thanks!
patrick

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2012-07-10 22:26:28 -0600

KruseT gravatar image

To translate the code that cagatay posted in his answer:

The trajectory_planner generates plenty of trajectories, and chooses one to follow. Without simple_attractor, it tries to choose a trajecotry which both advances the robot to the goal AND also stays on the global path. With simple_attractor, the robot just moves towards the goal, discarding the global path. As long as you move in circles without obstacles you would not notice.

So it is a setting that was introduced for debugging only, and should not be used.

Also note that you are using the trajectory_planner_ros, and if you have a choice you should rather configure move_base to use the dwa_planner_ros. The code base is a cleanup of trajectory_planner_ros, and future development will continue to improve the dwa code, not the trajecotry_planner_ros code.

edit flag offensive delete link more
2

answered 2012-07-10 14:22:07 -0600

cagatay gravatar image

updated 2012-07-10 14:34:51 -0600

I checked the sources and found this

//do we want to follow blindly
     if (simple_attractor_) {
        goal_dist = (x_i - global_plan_[global_plan_.size() -1].pose.position.x) * 
         (x_i - global_plan_[global_plan_.size() -1].pose.position.x) + 
          (y_i - global_plan_[global_plan_.size() -1].pose.position.y) * 
         (y_i - global_plan_[global_plan_.size() -1].pose.position.y);
       } else {

       bool update_path_and_goal_distances = true;

        // with heading scoring, we take into account heading diff, and also only score
       // path and goal distance for one point of the trajectory
       if (heading_scoring_) {
         if (time >= heading_scoring_timestep_ && time < heading_scoring_timestep_ + dt) {
            heading_diff = headingDiff(cell_x, cell_y, x_i, y_i, theta_i);
          } else {
           update_path_and_goal_distances = false;
       }
     }

source address:

this

hope this may help

edit flag offensive delete link more

Comments

Thanks @cagatay for the pointer to the code. I checked off the answer from @KruseT since it explains what the parameter is for.

Pi Robot gravatar image Pi Robot  ( 2012-07-11 03:27:53 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2012-07-10 13:46:41 -0600

Seen: 849 times

Last updated: Jul 10 '12