Initial localization guess in ROS?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Initial localization guess in ROS?

xperroni
I'm using RTAB-Map in ROS to provide a robot with global localization. When running in localization mode, RTAB-Map sometimes fails to localize the robot immediately, requiring it to be manually driven across the environment for a while before it can localize itself. Is there any way to give RTAB-Map a hint of the robot's initial global pose, so it could always be localized (even if not very accurately) from the start?
Reply | Threaded
Open this post in threaded view
|

Re: Initial localization guess in ROS?

matlabbe
Administrator
Hi,

There is no way to do that right now. THe best thing to do is to make sure to finish the run in front of location with a lot of visual features so that it can relocalize on the first frame on start. I opened an issue (https://github.com/introlab/rtabmap_ros/issues/220) to add such information for convenience, when we cannot ensure that the robot will finish in front a location easily recognizable.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Initial localization guess in ROS?

friedrichgerhard
Hi,

I am trying to give an initial guess for the robot position on a given map when I start rtabmap in localization mode (I am working on ROS).

I try that by writing my initial guess as rtabmap::Transform in the field opt_last_localization in the table Admin of the rtabmap.db.

Unfortunately, this does not work. Is this a sensible approach? Is there any other way to give an initial pose so far?

Thank you for your help!
Reply | Threaded
Open this post in threaded view
|

Re: Initial localization guess in ROS?

matlabbe
Administrator
Hi,

The easiest way is to do it with RVIZ's "2D Pose Estimate" button by remapping (Panels->Tool Properties) its topic to /rtabmap/initialpose if rtabmap has been started in rtabmap namespace. The topic name can be found with:
$ rostopic list | grep initialpose

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Initial localization guess in ROS?

friedrichgerhard
Hi,

thanks for the reply, this helps a lot! To set the initial pose automatically from code I publish now a geometry_msgs::PoseWithCovarianceStamped on the topic /rtabmap/initialpose.

Thank you!