Skip to content

Workshop 1 ‐ Introduction

gcielniak edited this page Sep 20, 2024 · 12 revisions

The goal of this session is to make you familiar with the LIMO robot platform which will be used throughout all remaining practical sessions and is a key component of the assessment. This includes the robot's components and functionality, tools for remote operation, software development and simulation. You have already used the robot in your first year, but since then, our setup has changed and we hope it is much easier to use. Even, if the concepts covered here seem to be straightforward please go through all the tasks and treat them as a refresher session.

1 Development Environment

The repository is a good starting point for your code development in this module. It contains a basic setup enabling easy integration with either real or simulated robots through ROS2 and containerisation. It provides a preconfigured Development Container with ROS2 installed and a VNC-based light desktop enabling interaction through the browser with the dockerised OS. Most of the instructions in this repository are only tested in the computing labs but you should be able to replicate this setup on your computer at home and continue development from any place.

  1. First, switch the lab computer on and select an operating system. We recommend Ubuntu Linux-based Pop!_OS but Windows is also fine. The containerisation is realised through Docker, and for code development and interaction with the robots, we will use Visual Studio Code (VSC). Both Docker and VSC are already installed in the labs and available through the taskbar/dock. On Windows machines, you may need to start the Docker Desktop manually. Open VSC.

  2. Clone the repository to your local computer: from Explorer, click on Clone Repository and provide the URL https://github.com/LCAS/ROB2002. Then select the repository destination folder (e.g. Documents) and if prompted, open the repository in VSC and approve the trust option. The local folder structure should be the same as the GitHub repository.

  3. Re-open the repository in the container. The first time it happens, this will take some time (minutes), but eventually, the build script will open automatically the browser window with the lite desktop (no-VNC). Click on "Connect" and enter the password vscode when prompted.

Now you are ready to work with a real robot or start the simulation.

2 Basic operations on a real robot

  1. Setup up the real LIMO robot by following points 1,3 and 4 of the following instructions.

  2. Inspect the robot's nodes and topics by using the ros2 node and ros2 topic commands (in a new terminal). 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.

  3. 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/src/limo_ros2/src/limo_description/rviz/model_sensors_real.rviz which uses a pre-defined configuration file, and you should see the interface with a robot model and its sensor data displayed in the remote desktop. 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).

  4. Teleoperation. Leave the RVIZ 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. Have fun, but pay attention to other robots and your human fellows, though!

  5. 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.

  6. Using your knowledge of the topic publishing, issue a series of commands that will drive the robot:

    • in a circle with a radius of 1 m;
    • in a 2 m square.

    Use as few commands as possible.

3 Simulator

  1. To start the simulator, open the terminal and execute the following commands:
    ros2 launch limo_gazebosim limo_gazebo_diff.launch.py
    
  2. Inspect the simulated robot and its sensors by running rviz2 in another terminal window with the following config file src/limo_gazebosim/rviz/urdf.rviz.
    rviz2 -d /opt/ros/lcas/src/limo_ros2/src/limo_gazebosim/rviz/urdf.rviz
    
  3. Repeat the tasks from Section 3 which used the real robot but this time in the simulated environment.

4 Additional tasks

  1. Try out different wheel configurations as described in Section 1.7 of the manual.
  2. Learn more about the nodes and topics. Whilst these concepts will be covered later in the course, this will give you a first glimpse into various ROS functionality associated with LIMO.
  3. Learn how to create a simple ROS2 publisher node and modify the example such that it sends a single /cmd_vel command to control LIMO from the script.
  4. Explore other built-in functionalities on the real robot by following the manual (e.g. localisation, mapping or vision).