Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.
This repository was archived by the owner on Feb 27, 2025. It is now read-only.

Migrate to ROS 2 #350

@ShaanGondalia

Description

@ShaanGondalia

Background

ROS is no longer receiving updates and noetic will reach EOL by 2025. We need to migrate our stack to ROS 2 eventually to make sure we have access to the latest tools and versions of our dependencies. We should follow the migration guides as a baseline for updating our code-base.

There are a few ROS 2 features that complicate the migration process:

  • Using ament and colcon for builds instead of catkin. For our purposes, this involves replacing all CMakeLists.txt with a setup.py script.
  • ROS 2 does not use roscore to create a master node, instead it uses DDS to set up peer-to-peer communication. We need to scope out how this will work across multiple machines (onboard and landside). This tutorial is probably a good starting point.
  • The ROS API is now rclpy instead of rospy. The framework for creating nodes changed a bit, so we'll have to modify every script in our code base.

Before we start making efforts to complete the migration, we should conduct a thorough analysis of our ROS dependencies to determine their equivalent packages in ROS 2. Once we've confirmed support or have viable alternatives for all packages, we can start efforts to migrate the rest of our code base. We'll surely run into more hiccups along the way, but for now the following tasks should be a good roadmap for the migration.

Testing

See #387

Important Notes

The general process for migrating a package to ROS2 is:

  • Switch build system to ament, replacing CMakeLists.txt with setup.py and modifying file structure.
  • Switch client library from rospy to rclpy
  • Update pub/sub syntax
  • Rewrite launch files in python
  • Update README.md

Tasks

  • Create current ROS dependency list with ROS 2 equivalents
  • Build proof-of-concept to verify cross-machine functionality
    • Update setup_network.sh to remove ROS master and replace with domain id
    • Test onboard/land-side connection on local machine
    • Test onboard/land-side connection from robot to local machine
  • Migrate all "easy" packages (landside first, then onboard)
    • landside
      • joystick
      • camera_view
      • simulation
    • onboard
      • acoustics
      • avt_camera
      • cv
      • data_pub
      • execute
      • robosub_description
      • sensor_fusion
      • static_transforms
      • system_utils
  • Migrate all "hard" packages (controls, offboard_comms, task planning, gui?)
    • Dereference pid package in controls, rewriting PID logic
    • Rewrite current state of task planning to use executive-smach or some other tool
    • Implement micro-ros in place of rosserial, which involves swapping hardware (See Swap to Nano RP2040 Connect #375)
    • Once everything is updated, we can migrate gui.
  • Update build.sh to use colcon instead of catkin
  • Update docker images with ROS 2 dependencies (base image and packages)
    • Update pytorch installation version and jetson-pytorch image? Not sure if cv is using pytorch anymore.
  • Update Github CI (particularly launch file testing and building)
  • Test each package on Cthulhu. See Execute ROS2 migration testing plan #387
  • Make a ROS2 knowledge transfer video documenting how the code-base changed how the new system works
  • Update main README and tutorial documentation.

Metadata

Metadata

Assignees

Labels

controlsRelated to robot controlelectricalRelated to broader electrical system (e.g. Arduino files)systemsRelated to building and automation (docker/github)task planningRelated to task planning

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions