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

Revision history [back]

you can pass the initial position as arguments when launching your node. the parameters are these:

~initial_pose_x (double, default: 0.0 meters)
Initial pose mean (x), used to initialize filter with Gaussian distribution.
~initial_pose_y (double, default: 0.0 meters)
Initial pose mean (y), used to initialize filter with Gaussian distribution.
~initial_pose_a (double, default: 0.0 radians)
Initial pose mean (yaw), used to initialize filter with Gaussian distribution.
~initial_cov_xx (double, default: 0.5*0.5 meters)
Initial pose covariance (x*x), used to initialize filter with Gaussian distribution.
~initial_cov_yy (double, default: 0.5*0.5 meters)
Initial pose covariance (y*y), used to initialize filter with Gaussian distribution.
~initial_cov_aa (double, default: (π/12)*(π/12) radian)
Initial pose covariance (yaw*yaw), used to initialize filter with Gaussian distribution.

you can pass the initial position as arguments when launching your node. the parameters are node, as initial_pose_x these:and initial_pose_y.

EDIT: if you want AMCL to "guess" on its own the initial position, you can set the parameters ~initial_pose_x (double, default: 0.0 meters) Initial pose mean (x), used update_min_d and update_min_a to initialize negative values. By doing so, the filter with Gaussian distribution. ~initial_pose_y (double, default: 0.0 meters) Initial pose mean (y), used will update at the frequency of your /scan topic, without the need to initialize move. (bear in mind that this will greatly increase your cpu usage).

However, there is no guarantee the filter with Gaussian distribution. ~initial_pose_a (double, default: 0.0 radians) Initial pose mean (yaw), used will converge to initialize filter with Gaussian distribution. ~initial_cov_xx (double, default: 0.5*0.5 meters) Initial pose covariance (x*x), used the correct solution instead of converging to initialize filter with Gaussian distribution. ~initial_cov_yy (double, default: 0.5*0.5 meters) Initial pose covariance (y*y), used to initialize filter with Gaussian distribution. ~initial_cov_aa (double, default: (π/12)*(π/12) radian) Initial pose covariance (yaw*yaw), used to initialize filter with Gaussian distribution.

a local minima. Taking you comment about the 4 rooms, if they all look very alike, there is no way AMCL can know in which one you are.

you can pass the initial position as arguments when launching your node, as initial_pose_x and initial_pose_y.

EDIT: if you want AMCL to "guess" on its own the initial position, you can set the parameters update_min_d and update_min_a to negative values. By doing so, the filter will update at the frequency of your /scan topic, without the need to move. (bear in mind that this will greatly increase your cpu usage).

However, there is no guarantee the filter will converge to the correct solution instead of converging to a local minima. Taking you comment about the 4 rooms, if they all look very alike, there is no way AMCL can know in which one you are.

EDIT2: it is wise to also use the /global_localization service, as told by @augusto-luis-ballardini , as it will spread your filter particles throughout the map, instead of concentrating them in the initial position loaded by AMCL.