I have a general question. Now, I have the drone and rover in the same world. I have to map the world with both rover and drone. When I map with rover, the drone shows up as an obstacle and when I map the world with drone, the rover shows up as an obstacle. Should I map the world with rover without launching the drone and vice versa. Then, combine both maps together. How should I tackle this problem? This is first part of the problem.
How can I modify the launch file so that I can map the world with both rover and drone in one single rviz. The goal is to cover some area with drone and some area with rover and then integrate the map. Can you give me some hints on this? Thanks.
Should I map the world with rover without launching the drone and vice versa. Then, combine both maps together
I would start like that. Beside the other robot, all dynamic obstacles / people can be in the map if they were there during the mapping. That is a problem in itself, so it is recommended to map in a static environment if possible.
I would recommend to use 2 rviz to monitor the progress of the two robots, assuming they are using their own ros master (that is the easiest way). Set the ROS_MASTER_URI of the robot you want to see before launching rviz.
To have two robots on same ros master, it is possible but slightly more complicated. First, you need to launch all nodes of both robots in their respective robot namespace connected to same ros master. Make sure there are no global topics used, so that all topics will be prefixed by the robot namespace. Next thing is to add a prefix to all TF used, e.g., rover/base_link, drone/base_link. For rtabmap and rtabmap's odometry, you can change the tf name with map_frame_id and odom_frame_id parameters (e.g., rover/map -> rover/odom -> rover/base_link, drone/map -> drone/odom -> drone/base_link). This can be complicated if you are using an URDF, as you would need to add a parameter in URDF to setup the correct tf prefix. Last thing is to connect the 2 tf trees under same root, called "world" for example. You can do it by publishing a static transform between world->robot/map and world->drone/map. In rviz, setting global frame option to "world", you should see the 2 tf trees together.