Software Architecture for Robotics (ROS2)

A collection of five academic projects focused on mastering the Robot Operating System (ROS2) framework, from fundamental concepts to advanced applications in manipulation and navigation.

Project Overview

This series of five labs for the "Software Architecture for Robotics" course provided a comprehensive, hands-on introduction to developing robust robotic systems using ROS2. The projects progressed from core concepts like package management and node communication to complex tasks involving a 7-DOF Baxter robot arm and the powerful Navigation2 stack. The primary languages used were C++ and Python.


Lab 1: Packages, Launch Files & Remapping

Goal: To master the fundamental building blocks of a ROS2 application. This lab focused on creating packages, writing nodes, and using launch files to manage complex applications.
Implementation: The main task was to create a `move_joint` package with a C++ node that could publish commands to a single joint of the Baxter robot. The key challenge was to then write a Python launch file that could run this node with arguments, allowing it to control *any* joint without changing the C++ code. This involved using namespaces and topic remapping to avoid conflicts when launching multiple instances of the same node.

Lab 2: The "Mirror Arm" Node

Goal: To create a C++ node that makes the Baxter robot's left arm mirror the movements of its right arm in real-time.
Implementation: This required writing a node that subscribes to the `/robot/joint_states` topic to get the current positions of all joints. Inside the node's callback, the positions for the right arm's joints were extracted. Then, applying a simple transformation (e.g., negating some values for symmetrical movement), the corresponding joint commands for the left arm were calculated and published to the appropriate command topic. This project was a practical exercise in managing publisher/subscriber logic and understanding robot kinematics.

Lab 3: The "Puppet Arm" Node

Goal: To implement a more advanced control scheme where the left arm maintains a constant 3D transform relative to the right arm (puppeteering).
Implementation: This was significantly more complex than the mirror node. Instead of just copying joint angles, this node had to:

  1. Use the TF2 library to look up the current 3D transform (position and orientation) of the right gripper in the robot's base frame.
  2. Calculate the desired 3D transform for the left gripper based on the puppeteering offset.
  3. Call an Inverse Kinematics (IK) service provided by Baxter to convert this desired 3D Cartesian pose for the left gripper into the required 7 joint angles.
  4. Publish these joint angles as a command to the left arm.
This project demonstrated skills in using TF2 for coordinate transformations and interacting with ROS2 services.

Lab 4: The Navigation Stack (Nav2)

Goal: To configure and launch the complete ROS2 Navigation Stack (Nav2) for a mobile robot (BB-8) in a known environment.
Implementation: This lab focused on system integration and configuration. The task involved writing a master launch file that could spawn multiple robots and correctly launch all the necessary Nav2 components for one of them, including:

  • Map Server: To load a pre-made map of the environment.
  • AMCL (Adaptive Monte Carlo Localization): To localize the robot on the map using laser scan data.
  • Planner and Controller Servers: To compute a global path to a goal and a local trajectory to follow that path while avoiding obstacles.
The challenge was to use namespaces and remapping to ensure that a multi-robot simulation could run without topic or frame collisions.

Lab 5: Gazebo and Robot Descriptions (URDF)

Goal: To understand how robots are modeled for simulation by creating a robot description file (URDF) and launching it in the Gazebo dynamic simulator.
Implementation: This project involved learning the URDF (Unified Robot Description Format) syntax, which uses XML to define a robot's physical properties. The main tasks were to define the robot's `links` (its physical parts) and `joints` (which connect the links), including their visual and inertial properties. The final step was to create a launch file that starts the Gazebo simulator and spawns the custom-built robot model into the simulated world.

Project Information

Type: Academic Course Projects

Course: Software Architecture for Robotics

Technologies Used

  • ROS2 (Foxy/Galactic/Humble)
  • C++
  • Python
  • Gazebo Simulator
  • URDF / Xacro
  • Navigation2 Stack
  • TF2 (Transform Library)
  • Launch Files
  • CMake