Interbotix / interbotix_ros_rovers

ROS Packages for Interbotix Rovers
BSD 3-Clause "New" or "Revised" License
31 stars 31 forks source link

[Bug]: Tf has two or more unconnected trees. #57

Closed michelalbonico closed 9 months ago

michelalbonico commented 10 months ago

What happened?

Hi all, I have been trying to run SLAM mapping on a simulated wx250s mobile robot.

However, it keeps reporting unconnected trees for odom and base_link, and therefore, no map is provided.

It seems that linking the odom to base_link in the robot's model should solve the problem. However, I could not manage it.

Robot Model

simulated wx250s robot

Operating System

Ubuntu 22.04

ROS Distro

ROS 2 Humble

Steps To Reproduce

I have installed the necessary Interbotics packages for humble distro from source:

$ git clone -b humble-devel git@github.com:ROBOTIS-GIT/DynamixelSDK.git src/DynamixelSDK
$ git clone -b humble-devel git@github.com:ROBOTIS-GIT/dynamixel-workbench.git src/dynamixel-workbench
$ git clone -b humble git@github.com:Interbotix/interbotix_ros_core.git src/interbotix_ros_core
$ git clone -b ros2 git@github.com:Interbotix/interbotix_xs_driver.git src/interbotix_xs_driver
$ git clone -b humble git@github.com:Interbotix/interbotix_ros_manipulators.git src/interbotix_ros_manipulators
$ git clone -b humble git@github.com:IntelAgir-Research-Group/interbotix_ros_rovers.git src/interbotix_ros_rovers
$ git clone -b humble git@github.com:Interbotix/interbotix_ros_toolboxes.git src/interbotix_ros_toolboxes
$ git clone git@github.com:Slamtec/sllidar_ros2.git src/sllidar_ros2

Other dependency packages have been installed via apt-get.

I run the simulated robot with the following command:

$ ros2 launch interbotix_xslocobot_sim xslocobot_gz_classic.launch.py robot_model:=locobot_wx250s use_lidar:=true use_camera:=true

The simulated world and rviz run smoothly.

However, when I try slam mapping, it does not work properly (does not provide any map):

$ ros2 launch interbotix_xslocobot_nav xslocobot_rtabmap.launch.py robot_model:=locobot_wx250s use_lidar:=true slam_mode:=mapping rtabmap_args:=-d use_sim:=true

Relevant log output

[controller_server-12] [INFO] [1695833553.672870393] [local_costmap.local_costmap]: Timed out waiting for transform from locobot/base_link to locobot/odom to become available, tf error: Could not find a connection between 'locobot/odom' and 'locobot/base_link' because they are not part of the same tree.Tf has two or more unconnected trees.
[controller_server-12] [INFO] [1695833554.172893223] [local_costmap.local_costmap]: Timed out waiting for transform from locobot/base_link to locobot/odom to become available, tf error: Could not find a connection between 'locobot/odom' and 'locobot/base_link' because they are not part of the same tree.Tf has two or more unconnected trees.
[controller_server-12] [INFO] [1695833554.672924179] [local_costmap.local_costmap]: Timed out waiting for transform from locobot/base_link to locobot/odom to become available, tf error: Could not find a connection between 'locobot/odom' and 'locobot/base_link' because they are not part of the same tree.Tf has two or more unconnected trees.

Additional Info

Here is the graph containing the frame trees. frames.pdf.pdf

lukeschmitt-tr commented 10 months ago

Simulated SLAM'ing is not currently supported, though it is something we plan to add in the future.

michelalbonico commented 9 months ago

Hi, I understand. The point is that we are bying a few Locobots for our research, and it is important that we have a simulated environment, such as for Turtlebots.

I will be plaing with this in the next weeks, and probably will come out with some solution.

michelalbonico commented 9 months ago

This was a camera simulation issue. The rtabmap package uses the camera.

It worked with SLAM_toolbox after the following commands:

$ ros2 launch interbotix_xslocobot_sim xslocobot_gz_classic.launch.py robot_model:=locobot_wx250s use_rviz:=true use_lidar:=true use_camera:=false
$ ros2 launch interbotix_xslocobot_nav xslocobot_slam_toolbox.launch.py robot_model:=locobot_wx250s use_lidar:=true use_camera:=false slam_mode:=online_async use_sim:=true