Turtlebot2 Setup

This is to document how I setup and ran the turtlebot2 with ROS Melodic (18.04). I was still using ROS1 but I will include ROS2 but it will be the same as the github that I have found. In ROS Melodic, for multi-agent communication to work we need the Multi-Master Fkie package so we have have multiple master nodes and for ROS messages to be sent between them. Since there isn’t an availiable LiDaR sensor, we can use depthimage_to_laser package to convert our depth image taken by the realsense and also astra camera that we have to 2D Map. The cameras were last calibrated in September 2025 and should try to calibrate it once a year to maintain accuracy when using SLAM.

PLEASE HAVE FETCH ROBOT CONNECTED THROUGH ETHERNET IF BASE IS NOT NEEDED AS IT LOSES CONNECTION IF IT IS ON WIFI IF NOT ACTIVELY USED DURING DEVELOPMENT

Preliminaries

Before we start, make sure that all the workstations and robots have their own static IPs. If static IP is not implemented, please implement it using a separate router. Don’t use a school’s static IP as it provides unstable Connection. If you are running multi-robot setup on ROS1, please use run the command: export ROBOT_NAME.

Installing Packages

This is the main GitHub packages link you need: https://github.com/gaunthan/Turtlebot2-On-Melodic

This is the astra camera packages if you are using the astra camera: https://github.com/orbbec/ros_astra_camera

This is the realsense camera package installation tutorial if you have a realsense camera:https://github.com/IntelRealSense/realsense-ros/wiki/SLAM-with-D435i and this tutorial was used to get it working https://intel.github.io/robot_devkit_doc/pages/rs_slam.html.

Common Problems

It is pretty common for the robot to not turn 90 degrees when you code it to turn 90 degrees. Make sure that the robot is calibrated and there is a turtlebot2 calibration package for the odometry and gyro. This helps but since our robots are extremely old, the calibration often times doesn’t correct it by much or even work. I circumvented this by manually calibrating the wheels each day in software by changing the wheel separation and radius numbers. I also changed the speed if needed.

Running the Turtlebots with Multi Master Fkie

Maybe Confusing Commands:

Bash
export ROS_MASTER_URI=http://<other_robot_name_or_ip>:11311

This should put in the IP of the other robot so when you run scripts, it runs on the robot with the run script.

Bash
export ROS_IP=http://robot_A:11311

This would be the current IP of the laptop.

  1. Run the minimal launch file:

    Bash
    roslaunch turtlebot_bringup minimal.launch
  2. Discover the master:

    Bash
    rosrun master_discovery_fkie master_discovery _mcast_group:=226.0.0.0
  3. Sync the master:

    Bash
    rosrun master_sync_fkie master_sync

    Now you should see both the workstation computer and the TurtleBot's ROS masters. If not, check your connections again and make sure the IP addresses are correct.

    If you don't see a message called "Odom Recieved!", ensure you are using the correct camera. It should be the Astra camera.

    Bash
    export TURTLEBOT_3D_SENSOR=astra
  4. Launch the Astra camera:

    Bash
    roslaunch astra_camera astra.launch
  5. Start the navigation demo:

    Bash
    roslaunch turtlebot_navigation amcl_demo.launch map_file:=[PATH TO MAP (should be a yaml)]

    For example, on turtlebot02:

    Bash
    roslaunch turtlebot_navigation amcl_demo.launch map_file:=/home/turtlebot02/2_21_two_human_map.yaml
  6. Go back to your workstation.

  7. Launch RViz with the correct ROS Master URI and hostname:

    Bash
    export ROS_MASTER_URI=http://192.168.1.123:11311
    export ROS_HOSTNAME=10.110.177.60
  8. Launch the final test file. Example (This should be your main script):

    Bash
    roslaunch warehouse_domain test_move_2h_id0.launch