Limo Robot Simulation Introduction - LCAS/ROB1001 GitHub Wiki

The goal of this tutorial is to make you familiar with the LIMO robot simulation and ROS2, the simulation is built for ROS2 Humble and only runs on Ubuntu 22.

The nice thing about ROS is that both simulated robots and real robots work in the same way and use the same software packages for the main functions, meaning any code you write for the simulated robots can be used on the real robots.

The simulation runs in a docker container which includes Ubuntu OS, ROS2 and LIMO robot drivers all pre-installed so after initial deployment the simulator can be used straight away and can be run on "any" machine, Windows, Mac and Linux.

Launching the docker enviroment

  1. Start docker: On the lab PC, start up the provided container using the following instructions.
  • Download the docker-compose file.

  • Log into the docker registry.

  • Run the docker file.

  • Open the remote desktop in the browser.

  • Go to https://localhost:6901/ in your browser (Chrome works best). Use username kasm_user with password password to log in.

  • Once you have opened the remote desktop you should have a screen like this.

Remember that all of the following steps should be undertaken in the dockerised environment accessible through the browser window (not in the local PC terminal!).

  1. Start the simulator: In the dockerised environment, open the terminal and execute the following commands:
ros2 launch limo_gazebosim limo_gazebo_diff.launch.py

This launches the limo robot simulation.

  1. Inspection and control: In another terminal window open rviz2 with the following config file src/limo_gazebosim/rviz/urdf.rviz using the command;
rviz2 -d /opt/ros/lcas_addons/src/limo_ros2/src/limo_gazebosim/rviz/urdf.rviz

This opens Rviz2, the robot visulaiser, this shows the robot's sensors output.

Basic operations

  1. Inspect the robot's nodes and topics by using the ros2 node list and ros2 topic list commands (in a new terminal, no need to source this time). When you type the command without any additional arguments, you should see all available options. Display and compare the format of the following topics /odom, /scan, /tf and /camera/color/image_raw. You might want to also refer to the official node and topic tutorials.

  2. Now, let us use the graphical visualiser RVIZ to look at the robot and its sensor topics. Start by typing rviz2 -d /opt/ros/lcas_addons/src/limo_ros2/src/limo_gazebosim/rviz/urdf.rviz which uses a pre-defined configuration file, and you should see the interface with a robot model and its sensor data displayed. To get familiar with the interface, adjust the laser scan visualisation options and see how these affect the output. Try to add new visualisation for sensors not included in the provided configuration (e.g. odometry).

  3. Teleoperation. Leave running. In a new terminal start the keyboard teleoperation node ros2 run teleop_twist_keyboard teleop_twist_keyboard and drive the robot around using the keyboard.

  4. Let's now send some basic robot control commands using ROS topics. The robot's speed can be controlled by the /cmd_vel topic. Use the ros2 topic pub functionality to send a single Twist message (linear and angular velocity command) as in this example:

ros2 topic pub --once /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.5}}"

Now, adjust the linear components of the Twist message and see the resulting trajectory.

  1. Using your knowledge of the topic publishing, issue a series of commands that will drive the robot:
  • in a circle with a radius of 0.5 m;
  • in a 1 m square.

Try using as few commands as possible.