u/OkQuality9914

▲ 13 r/ROS

Question/Discussion: How to structure a ROS2 Project

Good day everyone,

I’ve got a rather complex question about how to structure my (our) ROS2 workspace. I am a member of a student research group focusing on autonomous driving. We are using ROS2 and are just starting out. The goal is to create a sustainable infrastructure for our code that is intuitive to use for future generations as well. Our team is in a bit of a clinch about what structure to use. I will list all proposed ideas in the following and would like to ask you (seasoned devs) for an opinion.

Some additional context: We work with multiple model cars (scale 1:10 / 1:8) that are different in construction. So, some of our code will be tailored towards a specific car (for example, steering/odometry) and some code will be generic (for example, navigation logic on maps). To keep our code portable, we heavily use Docker and run basically everything we can in containers. In addition to cars in real life, we work with a Gazebo simulation as well, which configs etc. have to live somewhere as well.

Option 1 – A single repo

EVERYTHING lands in a single repo. Car-specific and generic code alike. The simulation lands in there as well. We design a sophisticated structure.

Option 2 – (n+2) repos

n is the number of cars, +1 for a generic repo, +1 for the simulation. Each car gets a repo with its specific code; the simulation configs get a repo. The specific repos include the generic repo via git submodules or a .repos file.

Option 3 – One repo per ROS package

Very modular, self-explanatory. We create multiple repos; each package gets its own. To combine them, we create a meta-repo per car that includes required code via git submodules or .repos files.

The final question: Should we use git submodules or .repos files?

What are your thoughts about this?

reddit.com
u/OkQuality9914 — 2 days ago