How to organize ros2 packages

asked 2021-01-10 07:55:35 -0600

robopo gravatar image

Hi there,

I have a question regarding how to organize a larger ros2 project. Do you have any experiences or advises? There are many ways how to approach it and I'm trying to find the suitable solution with less manual inputs as possible. Avoid copying and pasting build it automatically.

I have a robot rover. It's simple, two motors and camera and it's of course ros2 driven. I have my workspace with all the packages and they are in one repository. I can build them on my desktop with also on the raspberry on the rover. I run specific node on raspberry and specific nodes on desktop.

Now I build second rover with ultrasound distance sensor. I'd like to reuse the nodes for the motors from the first rover. And optionally I'd like to use this ultrasound sensor as an optional module for the first rover.

And here comes the question. How I should organize my workspaces (repositories, packages, etc.)?

First option is to put everything in one workspace and one repository, build every thing and use just specific nodes on specific targets. But one can see that this is not the proper solution especially when more packages(nodes) are added.

So I'd like to separate the software for those two rovers, link the software for motors and for the first rover make an optional argument for the sensor.

Is there a way how to create workspaces and link the packages across? Should I put everything in separate repositories? (ultimate solution) Is there a way that I can build packages in different virtualenvs? Or do I need to use an external tool (CI/CD-like tools) that builds my workspace and then continue as usual? Is there a way to select packages, build them and deploy them to selected target?

(Like select motor driver from this workspace/repo and sensor from another wrokspace/repo, build and deploy to specific path (could be ssh connection).)

edit retag flag offensive close merge delete