ethz-asl / maplab

A Modular and Multi-Modal Mapping Framework
https://maplab.asl.ethz.ch
Apache License 2.0
2.6k stars 721 forks source link

Integrate ROVIOLI Localization mode with ROS Navigation Stack #233

Open gerrysuomi opened 4 years ago

gerrysuomi commented 4 years ago

I'm a newbie to maplab and I will try to elaborate my problem as detailed as possible. What I'd like to do is to integrate ROVIOLI with localization mode enabled into ROS Navigation Stack (for example, to replace the AMCL localization system). I followed the ROS Navigation tutorials (http://wiki.ros.org/navigation/Tutorials/RobotSetup) to setup the navigation stack. A global map is created with maplab in VIO mode. Then my navigation application is launched without any error. But when I try to set the initial pose of the robot in rviz with the button '2D Pose Estimate', it seems that this does not take any effect, the robot keeps staying at the same location. I checked that the topic/initialpose is published from rviz and there is data published when '2D Pose Estimate' button is clicked. But there is no subscriber of this topic in my current setup. I find out from aforementioned ROS Navigation tutorials that if AMCL is used as localization system, it is the subscriber of topic /initialpose. However, it seems that /initialpose is unique for AMCL. So I'd like to ask how to set the initial pose of robot in my navigation setup if ROVIOLI localization is used. Or more generally, how can ROVIOLI localization be integrated with ROS Navigation? I'm really puzzled by this problem and any help is highly appreciated. Thanks in advance.

Best regards, Gerry

mfehr commented 4 years ago

Hi @gerrysuomi There is no such subscriber at the moment.

But conceptually, if you do run ROVIOLI in localization mode, it will do global localization, so it should not need an initial guess, assuming it has the chance to successfully localize, i.e. the robot has somewhat a similar viewpoint like when he did the localization map. Until it localizes ROVIOLI will output simply the odometry estimate, which starts at the origin. Have a look at the two topics that are published, I think they are something like T_G_B/I (localized) and T_M_B/I (odom).

Now, if you want to initialize the odometry pose manually somehow, you need to add a subscriber yourself. I see two ways to implement it: