Migrating a repository to ROS2 (Humble) - norlab-ulaval/Norlab_wiki GitHub Wiki

Before the migration

Before starting the migration of a repository to ROS 2, if you have the repository cloned on your computer, make sure that the version you have does not contain any local change and is up to date. If you don't have the repository cloned on your computer already, you can go ahead and clone it and jump directly to the next section of this tutorial.

It is possible to see if your local copy of the repository has been changed by running the following command in a terminal at the root of the repository:

git status

If you have no local change, the output should look something like this:

git reset --hard

Finally, make sure that you are on the master branch and pull the latest changes using the following commands:

git checkout master
git pull

Migration

Before starting the migration of your repository, you need to create a new branch using the following command:

git checkout -b humble

You are now ready to migrate your repository to ROS 2! You can have a look at libpointmatcher_ros, norlab_icp_mapper_ros and marmotte_mapping to see how the migration of these pacakges was done.

Once you are done migrating your repository, add the files that need to be committed and commit them using the following commands:

git add <first_file_to_add>
git add <second_file_to_add>
...
git add <last_file_to_add>
git commit -m "Migrated to Humble."

You can then push your newly created branch to Github using the following command:

git push -u origin humble

After the migration

Once everything is pushed, using a web browser, go to your repository page on Github.com. First, you will need to rename the master branch to melodic. To do so, go to the "Settings" tab of your repository (top right of the page)

How to migrate nodes

Here are some resources that give an overview of some things to consider while migrating a node :

Here are some nodes that were migrated successfully from melodic (ROS1) to humble (ROS2):