Lectures
Lecture: Course Administration
This lecture describes the logistics of the course including what material we will use for learning, pedagogical approach (lecture style, exercises, assignements), grading scale, etc.
Slides (pdf)
Lecture: ROS2 Concept Overview, Installation, and Development Environment Setup
This lecture provides a survey of primary concepts of ROS2 middleware and support libraries. It also indicates what concepts we will emphasize in our lectures, assignments, and projects.
Slides (pdf)
Resources
- Technical overview of ROS2 “Robot Operating System 2: Design, Architecture, and Uses In The Wild” by Steve Macenski, Tully Foote, Brian Gerkey, Chris Lalancette, William Woodall.
Homework
This homework is necessary for setting up your ROS2 environemnt and making sure that you are ready to do in-class exercises in the next lecture.
-
Installation: see the tools page
-
Tutorial Exercise (Renard): Start Your First ROS2 Node (running talker/listener demo nodes, running turtlesim)
- Objectives
- ROS2 installed
- Know how to run a node (cheat sheet)
- Know how to launch
rqt_graph
to visualize the dynamic topology of a system (cheat sheet)
- Objectives
-
Tutorial Exercise (Renard): Create and Set Up a ROS2 Workspace
-
Notes
- make sure to add the colcon autocomplete mechanism to your
.bashrc
file
- make sure to add the colcon autocomplete mechanism to your
-
Resources
-
Objectives
- Know how to create a ROS2 workspace (cheat sheet)
- Understand the basic structure of a ROS2 workspace
-
-
Tutorial Exercise (Renard): Create a ROS2 Python Package (note: the video also installs visual studio code)
Notes
-
note the correction of the version for setuptools
-
Resources
-
Objectives
- Know how to create a ROS2 Python package (cheat sheet)
- Know the basic structure and files in a ROS2 Python package
-
Lecture: Coding ROS2 Nodes, Using ROS2 Timers and Topics, Computation Graphs (rqt_graph)
This lecture provides an introduction to coding ROS2 nodes, timers, and topics (we will focus on Python – you will need to study C++ on your own).
These are the most basic aspects of ROS2 computation. We provide templates for node code and use these to discuss the required code elements for a node, timers, topic publishers and subscribers. We discuss the most basic aspect of activating application code in a node: timers and associated call-backs functions. ROS2 tools associated with nodes are discussed including CLI facilities for listing active nodes. Then we use the templates to code a simple publisher and subscriber for a topic.
Lecture Materials
There are no slides from this lecture. Everything is based off of live coding via templates and workflow cheat sheets listed below. Below is the activity script for the lecture and the completed workspace from the activity (private repo).
Resources
- Python node template
- Python node workflow (cheat sheet)
- (Renard) Create a ROS2 Node with Python and OOP
- (Renard) What is a ROS2 topic?
- (Renard) Write a ROS2 publisher with Python
- (Renard) Write a ROS2 subscriber with Python
Objectives
- Know how to create a ROS2 Python node from scratch
- Know how to create a timer and an associated call-back
- Understand the basics of ROS2 topic, and know how to create a simple topic publisher and subscriber in Python
- Know how to use CLI tools
ros2 node list
andros2 node info <nodeName>
(cheat sheet)
Homework
- Optional: (Renard) Create a Closed Loop System with a Publisher and a Subscriber
- Note: to code the exercises in homework you need to have watched and carried out the exercises in the “Write a ROS2 publisher” and “Write a ROS2 subscriber” videos above.
Lecture: Node Parameters Basics
This lecture provides an overview and examples of how to use ROS2 node parameters. Node parameters provide a convenient way to configure properties of your nodes at run/launch time and even dynamically(!).
Lecture Materials
Preparation
The following material is useful to go through before class.
Resources
- (Renard - text) rclpy params tutorial: Get and Set ROS2 Parameters with Python
Lecture: Launch File Basics
This lecture provides an overview and examples of how to use ROS2 launch file. Launch files provide a way to run (launch) a collection of ROS2 nodes (e.g., all the nodes in a system) with one command.
Lecture Materials
Below is the activity script for the lecture (private repo).
Resources
- ROS2 Documentation/Tutorial - Launch Files
- (Renard) Create a Launch File with Python
- (Renard) Create a Launch File with XML
- (Renard) Including a Launch File in Another Launch File
- (Wood) Using Events in a Launch File to launch nodes in a particular order
Lecture: Interfaces
This lecture describes the purpose and gives examples of ROS2 interfaces - type signatures for ROS2 messages (topics), services, and actions. It provides links to documentation indicating how interface base types are mapped to Python and C++ types. Also covered are directions for how to find pre-defined ROS2 interface types as well as how to define your own.
Lecture Materials
Resources
- ROS2 Documentation - Interfaces
- ROS2 GitHub Repo for Common Interfaces
- (Renard video) Create a Custom Interface (for message and server)
- ROS2 Documentation - Creating Custom Interfaces
Lecture: Services
This lecture describes the purpose and gives examples of ROS2 services – request/response interactions between a service provider and a service client. It illustrates how to code a simple service and client in Python.
Lecture Materials
Resources
- (Renard text + video) Using the ROS2 service CLI tool
- (Renard video)Write a ROS2 Service Client with Python - covers writing Python service clients for turtlesim, writing your own service and client
- ROS2 Documentation - Writing a Simple Python Service and Client – note: the approach illustrated in this documentation doesn’t deal with threading and call-back issues in a general way. It’s best to follow the suggestions in the Renard video above, which is the approach adopted in our lecture.
- ROS2 Documentation - Writing a Simply C++ Service and Client – note: similar comment as above. The threading/callback approach is not general enough.
Lecture: Modeling: TF, URDF, and RVIZ Overview
Robots include physical components (wheels, bodies, arms, etc.), and part of programming a robot is to (1) keep track of where these part are (and how they are oriented) relative to each other and to their environment and (2) to make them move relative to each other and to their environment. The ROS2 Transform framework (TF2) provides support for activities. This lecture provides an overview of TF2, including its purpose, and main use cases. It describes the purpose of a unified robotics description format (URDF) file which is used to specify physical aspects of a robot in terms of basic components, connections between components (joints), and possible joint movements. It illustrates the use of the RVIZ framework to visualize the physical definition of a robot and its transforms.
Lecture Materials
Resources
- Very good video overview of the concept of frames and transforms Articulated Robotics - The ROS Transform System (TF)
- Articulated Robotics – Deep background on coordinate transformations
- ROS2 Documentation - TF2 Overview
Lecture: Modeling: URDF Basics
This lecture is an in-class exercise that involves building a basic URDF file for a simple robot. Concepts covered include defining links (with box and cylinder geometries), defining joints (with fixed, revolute, continuous, and prismatic joint types), issues regarding positioning of links and joint transforms.
Lecture Materials
Resources
Activities are based on the following source
- (Eduard Renard - video) Create a URDF with ROS2 (1 HR Crash Course)
For a good written overview (supported by some videos), see the Articulated Robotics URDF/XACRO overview.
- Describing robots with URDF The URDF developed in this activity is very similar to the one needed in the Articulated Robotics Articubot project
- (Articulated Robotics) - written oveview of differential drive robots, URDF Design
- (Articulated Robotics) Creating a rough 3D model of our robot with URDF
Documentation for the XML elements of a URDF can be found at the links below. These are actually from the ROS1 documentation, but URDF format is the same in ROS2 as in ROS1.
Lecture: Modeling: XACRO Basics
xacro is macro framework for XML. Although it can be used for any type of XML file, it is primarily used in the ROS ecosystem for URDF files. xacro can enable better “software engineering” of your URDF files by introducing named constants (as associated expression evaluation), macros for commonly used URDF elements, and decomposing your URDF content into multiple files (enabling a more modular organization of your URDF source material and easier reuse of URDF definitions across projects).
This lecture is an in-class exercise that introduces basic aspects of xacro. We first review how to set up a launch file for (a) loading a URDF into the robot state publisher node and (b) launching accompanying joint state publisher gui and rviz nodes. This type of setup is often used in the early prototype phase of the physical robot design. We cover how to migrate the basic URDF file to a xacro file. Then we review the most common xacro features including named constants (properties), macros for creating parameterized/reusable URDF elements, and decomposing URDF content into multiple xacro files.
Lecture Materials
Acknowledgement
This lecture is based on content from Eduard Renard.
Resources
- ROS xacro wiki
- (Eduard Renard video)ROS2 - Create a Xacro Macro
Lecture: Modeling: Gazebo Overview
Gazebo is a physics simulation framework that is part of the ROS ecosystem, but independent of ROS. By “physics simulation”, we mean that it can simulate physical objects, interactions between objects (collisions, friction), the effect of gravity, etc. In addition, it has a plug-in architecture that enables you to control your robot in a simulation and even operator standardized sensors on your robot such as cameras and lidar in the context of the simulation. Finally, you can define various simulated “worlds” that you can use to evaluate concepts associated with your robot.
This lecture gives an overview of the Gazebo GUI, basic functionality, SDF files, and loading models/worlds into Gazebo.
Lecture Materials
Acknowledgement
This lecture is based on content from the Gazebo Fortress documentation.
Resources
These activities are based on the following sources
- Gazebo Fortress tuturial Understanding the GUI
- Gazebo Fortress tutorial SDF Worlds
- Gazebo Fortress tutorial Understanding SDF files - Building your own robot going through an SDF file for a differential drive robot similar to the Articubot
- ROS2 documentation for bridging ROS2 topics with Gazebo Fortress - Setting up a robot simulation
- Summary of differences between SDF and URDF and converting SDF files to URDF Difference between URDF and SDF and how to convert
Lecture: Modeling: Preparing URDF Specifications for Gazebo
This lecture does a walk-through of artifacts that we need to use basic features of Gazebo. This includes add collision and inertia properties to your URDF file.
Lecture Materials
Resources
For inertia, collision information…
- Articulated Robotics written tutorial – Describing robots with URDF – among other things, describes general concepts associated with inertial, mass, and collision properties.
- Articulated Robotics written tutorial – URDF Design – builds on the general tutorial above to describe how to specify inertia and collision properties for the Articubot.
- Nav2 written tutorial – Setting Up The URDF
For integrating ROS2/URDF with Gazebo Fortress…
These activities are based on the following sources
- Spawning a URDF model
- ROS2 documentation for bridging ROS2 topics with Gazebo Fortress - Setting up a robot simulation
Lecture: Modeling: Gazebo / ROS Integration
A primary aspect of robotics development workflow is integrating portions of a robot’s software with simulation environments in Gazebo that are designed to test/assess the robot’s features and capabilities. Ideally, the development infrastructure is set up so that you can easily switch between simulation and actual implementation. This will involve designing launch files to bring up both ROS aspects and Gazebo aspects.
Unfortunately, ROS and Gazebo aren’t directly compatible – for example, they use different topic names, middleware implementations, etc. ROS2 distributions including libraries for bridging topic-based communication between ROS and Gazebo. This lecture covers basic aspects of these libraries and the bridging concept.
Lecture Materials
Resources
The ros_gz*
packages provide ROS-side nodes and utilities that wrap Gazebo functions and that bridge between ROS and Gazebo.
- Examples/demos that illustrate the
ros_gz
packages. Some of the most applicable for building on our lecture content are..- Robot Description Publisher - Spawns a URDF-based robot description into a Gazebo world, and from Gazebo publish a
robot_description
that flows into RVIZ for a companion visualization. - Joint State Publisher
- Robot Description Publisher - Spawns a URDF-based robot description into a Gazebo world, and from Gazebo publish a
All of these demos are already installed when you have ros_gz*
installed, so you can just run the launch commands provided in the Readme to launch them.
- Project template for integrated ROS / Gazebo development
Lecture: Modeling: Gazebo / Camera as Illustration of Sensor
Realistic simulation of a robot in Gazebo will often rely on the robot sensing aspects of its environment, e.g., to determine how to navigate or otherwise achieve some goal. Gazebo has a basic organizational framework for incorporating different types of sensors. For example, an SDF/URDF file with Gazebo configuration information includes XML blocks for utilizing sensor plug-ins.
In this lecture, we look at how to add a sensor component (a camera) to the diff drive robot from the previous lecture and to simulate the camera’s acquisition of scene information from the Gazebo world using a Gazebo sensor plug-in. We will also see how to communicate information from the simulated camera to the robot implementation using the Gazebo / ROS2 bridging infrastructure.
Lecture Materials
Lecture: ROS2 Control: An Overview of the ROS2 Control Framework
ROS2 Control is a framework for interface ROS2 applications with hardware. It provides framework approaches for APIs that provide hardware interfaces, APIs that provide control logic, and an architecture for flexibly integrating controllers with hardware interfaces.
In this lecture, we provide an overview of the ROS2 Control and illustrate its APIs and architecture with examples from the ROS2 Control libraries.
Lecture Materials