ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to manage multiple projects in single wrokspace?

asked 2022-01-19 13:14:39 -0600

jay-b gravatar image

Hello,

How to manage multiple projects in a single catkin workspace?? Like if I have a project named project_1 then some packages in it and then another project named project_2 then some packages in it. Like tree given below.

catkin_ws/
  src/
    CMakeLists.txt
    project_1
      package_1/
        CMakeLists.txt
        package.xml
        ...
      package_n/
        CMakeLists.txt
        package.xml
    project_2
      package_1/
        CMakeLists.txt
        package.xml
        ...
      package_n/
        CMakeLists.txt
        package.xml
  build/
  devel/
  logs/

If we can make a structure like this, then how to build this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-01-20 00:44:40 -0600

aarsh_t gravatar image

updated 2022-01-20 00:48:08 -0600

I like to use catkin tools to manage multiple packages in one workspace. To install catkin tools run, sudo apt-get install ros-$ROS_DISTRO-catkin python-catkin-tools

Quick example is, you can build specific package in your catkin_ws using catkin build <package-name> and you can clean the workspace with catkin clean to clean the workspace before building other package. It doesn't matter in which sub folder the package is inside the src/. You can also use Tab key for auto-completion of package name.

You can refer this for more information.

edit flag offensive delete link more

Comments

I also use catkin tools to manage multiple packages in my workspace. But my situation was like I have some packages in src/ folder, then build them after that I tried to put them in a subfolder inside the src/. That's an error right. So I got it like make a subfolder inside src/, and then create package inside that subfolder, after then build. So thanks.

jay-b gravatar image jay-b  ( 2022-01-20 12:16:46 -0600 )edit

You can not have same package name twice in one workspace. You can create another workspace if you are doing this to keep backup of the code.

aarsh_t gravatar image aarsh_t  ( 2022-01-20 23:26:43 -0600 )edit

Yes, you are right.

jay-b gravatar image jay-b  ( 2022-01-22 00:48:32 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-01-19 13:14:39 -0600

Seen: 388 times

Last updated: Jan 20 '22