(Murilo’s) ROS2 Tutorial

Note

If you’re looking for the official documentation, this is NOT it. For the official ROS documentation, refer to this link.

Hint

You can download this tutorial as a PDF 📀.

📖 About this tutorial

ROS2 Humble tutorials by Murilo M. Marinho, focusing on Ubuntu 22.04 x64 LTS and the programming practices of successful state-of-the-art robotics implementations such as the SmartArmStack and the AISciencePlatform.

🤟 Using this tutorial

This is a tutorial that supposes that the user will follow it linearly. Some readers can skip the Preamble if they are somewhat already comfortable in Python and Ubuntu. Otherwise, all steps can be considered as dependent on the prior ones, starting from ROS2 Setup.

🔍 Quick overview

  1. Preamble: Ubuntu Basics

    A few tips on Ubuntu/terminal usage.

  2. Preamble: Python Basics

    A quick memory refresher for the Python stuff we’ll use in ROS2.

  3. ROS2 Setup (⭐start here⭐)

    Installing ROS2 and setting up its environment for use.

  4. ROS2 Python Package/Build Basics

    Creating our first ROS2 package with ament_python and building it with colcon.

  5. ROS2 Python Node Basics

    Creating a rclpy Node and figuring out what all that means.

  6. ROS2 Python Library Basics

    Create a Python library and importing/using it in another ament_python package.

  7. ROS2 Python Interface Basics

    Making ROS2 messages, services, publishers, subscribers, service servers, and service clients.

  8. ROS2 Parameter/Launch Basics

    Making configurable ROS2 Nodes using parameters and launch files.

Warnings

Warning

If you’re using macOS or Windows, this is NOT the guide for you. There might be a lot of overlap, but none of the code shown here has been tested on those operating systems.

Warning

This project is under active development and is currently a draft.

Disclaimers

By reading and/or using this tutorial in total or in part, you agree to these terms.

Disclaimer

All advice, comments, and terrible memes in this tutorial are my own and not endorsed by anyone or anything else mentioned herein. It’s not even endorsed by me.

Disclaimer

THIS TUTORIAL AND RELATED SOFTWARE ARE PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND/OR TUTORIAL, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.