Ask Your Question

Revision history [back]

Yes, you have to publish the initial pose once (without that, the robot could be literally anywhere, like 1,000,000 km away from the map origin). Even if you don't have a very good idea where the robot is, it's usually somewhere on the map you provided to amcl (otherwise amcl is useless anyway). The "initial pose" is actually an initial gaussian distribution, and you can set a very high covariance in the initial pose message to make the particles spread to a wide area of the map, which of course makes AMCL's job much harder. In that sense, "global localization problem" translates to "somewhere on the map".

The answer by @dornhege that you linked to means that

  1. you shouldn't publish the initial pose all the time (otherwise it would reset AMCL all the time), but only once, in the beginning
  2. ...except when the robot becomes delocalized (i.e. none of the amcl particles is near where the robot actually is).

Perhaps it would be nice if instead of requiring an initial gaussian distribution, AMCL would randomly spread particles all over the free areas of the map, but the ROS implementation doesn't do that.

Yes, you have to publish the initial pose once (without that, the robot could be literally anywhere, like 1,000,000 km away from the map origin). Even if you don't have a very good idea where the robot is, it's usually somewhere on the map you provided to amcl (otherwise amcl is useless anyway). The "initial pose" is actually an initial gaussian distribution, and you can set a very high covariance in the initial pose message to make the particles spread to a wide area of the map, which of course makes AMCL's job much harder. In that sense, "global localization problem" translates to "somewhere on the map".

The answer by @dornhege that you linked to means that

  1. you shouldn't publish the initial pose all the time (otherwise it would reset AMCL all the time), but only once, in the beginning
  2. ...except when the robot becomes delocalized (i.e. none of the amcl particles is near where the robot actually is).

Perhaps it would be nice if instead of requiring an initial gaussian distribution, AMCL would randomly spread particles all over the free areas of the map, but the ROS implementation doesn't do that.

One more thing: instead of publishing a message to the initialpose topic, you can also set some parameters to achieve the same effect. The initialpose topic is there so that you can reset the pose while amcl is running (for example using RViz).

Yes, you have to publish the initial pose once (without that, the robot could be literally anywhere, like 1,000,000 km away from the map origin). Even if you don't have a very good idea where the robot is, it's usually somewhere on the map you provided to amcl (otherwise amcl is useless anyway). The "initial pose" is actually an initial gaussian distribution, and you can set a very high covariance in the initial pose message to make the particles spread to a wide area of the map, which of course makes AMCL's job much harder. In that sense, "global localization problem" translates to "somewhere on the map".

The answer by @dornhege that you linked to means that

  1. you shouldn't publish the initial pose all the time (otherwise it would reset AMCL all the time), but only once, in the beginning
  2. ...except when the robot becomes delocalized (i.e. none of the amcl particles is near where the robot actually is).

Perhaps ~~Perhaps it would be nice if instead of requiring an initial gaussian distribution, AMCL would randomly spread particles all over the free areas of the map, but the ROS implementation doesn't do that.that.~~ see my comment below

One more thing: instead of publishing a message to the initialpose topic, you can also set some parameters to achieve the same effect. The initialpose topic is there so that you can reset the pose while amcl is running (for example using RViz).

Edit: You don't have to publish an initial pose, you can simply call the global_localization service.


Original answer:

Yes, you have to publish the initial pose once (without that, the robot could be literally anywhere, like 1,000,000 km away from the map origin). Even if you don't have a very good idea where the robot is, it's usually somewhere on the map you provided to amcl (otherwise amcl is useless anyway). The "initial pose" is actually an initial gaussian distribution, and you can set a very high covariance in the initial pose message to make the particles spread to a wide area of the map, which of course makes AMCL's job much harder. In that sense, "global localization problem" translates to "somewhere on the map".

The answer by @dornhege that you linked to means that

  1. you shouldn't publish the initial pose all the time (otherwise it would reset AMCL all the time), but only once, in the beginning
  2. ...except when the robot becomes delocalized (i.e. none of the amcl particles is near where the robot actually is).

~~Perhaps Perhaps it would be nice if instead of requiring an initial gaussian distribution, AMCL would randomly spread particles all over the free areas of the map, but the ROS implementation doesn't do that.~~ see my comment belowthat.

One more thing: instead of publishing a message to the initialpose topic, you can also set some parameters to achieve the same effect. The initialpose topic is there so that you can reset the pose while amcl is running (for example using RViz).