I try to develop a project with ROS2. At the moment I am struggling with a project structure. My goal is in a way similar to the TurtleBot3 simulation.
I want to create a ready to use simulated test environment with ROS2 and Gazebo within a single package in order to be as much 'stand-alone' and tidy as it gets. I found there is something along these lines in ROS1 if I read Package Organization For a ROS Stack correctly.
Unfortunately, I am new to ROS or ROS2 for that matter, so I am unaware how to realize my goal or if it is even possible.
My Idea was to structure the package as follows:
ros2_ws/src/
-my_symulation_environment/
--recource
--test
--setup.py
--setup.cfg
--package.xml
--my_sim_environment
---_ _ init _ _.py
---my_sim_bringup
---turtlebot3_gazebo
---turtlebot3_msgs
---turtlebot3_description
---turtlebot3_navigation
---turtlebot3_slam
---turtlebot3_teleop
---my_sim_mycode
The reason is, I don't want this package to mingle with other packages in the src directory to avoid confusion and eventual side effects. This is because I want to borrow and append on code from the Turtlebot3 simulation but keeping the original as is (robot model, world, nav2, slam). However I have read ROS2 colcon build not getting subfolders and compared with the package organization mentioned before, it is not possible to build nested packages.
Could you recommend a way for organizing ROS2 projects in a tidy and obvious manner? Is there a way to not have all packages side by side on the src directory level, but integrated in their superior package?
Because the Turtlebot3 simulation provides a structure more or less similar to the suggested package organization in ROS1 I gave it a closer look, but to be honest, I am not able to grasp all of the concepts they are using.
Your help and suggestions are much appreciated.
Originally posted by NotARobot on ROS Answers with karma: 109 on 2021-02-18
Post score: 1