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

How do I include ros1 and ros2 packages in the same workspace?

asked 2022-01-19 00:35:12 -0500

lexi gravatar image

My team uses a monorepo that contains all our ros nodes for our robots. We'd like to begin migrating some of our nodes to ros2 and use the ros1 bridge in a hybrid ros1/ros2 system so that we don't have to port all nodes all at once. Most tutorials I've found suggest keeping your ros1 nodes and ros2 nodes in separate workspaces, but that's not ideal because we use a monorepo that we clone into our ros workspace. And moving these into another repo would lose our git history.

How can we have ros1 and ros2 packages in the same repo?

edit retag flag offensive close merge delete

Comments

1

may you can consider restructuring the repo and inside the repo you can create 2 sub folders named ros1/ and ros2/ and both to be build separately in their own folders. But mixing both the versions of ros is not possible as far as my knowledge.

aarsh_t gravatar image aarsh_t  ( 2022-01-19 00:41:36 -0500 )edit

Okay, I think we are going to manage this within our docker container by mounting different packages into different locations in the container.

lexi gravatar image lexi  ( 2022-01-19 17:32:10 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2022-01-19 17:34:07 -0500

lexi gravatar image

The solution we found was to use docker. This way we can have different packages mounted into different workspaces in the docker container. I imagine something similar could be done with symlinks on the native system. Like just creating an install script that creates 2 workspaces and then just creates symlinks in the appropriate workspaces for the appropriate packages (symlinks to ros1 packages in the ros1 workspace, and symlinks to ros2 packages in the ros2 workspace).

edit flag offensive delete link more
1

answered 2022-01-19 05:26:59 -0500

ljaniec gravatar image

updated 2022-01-19 05:39:54 -0500

You could try to work withrospy2 package to convert your ROS1 Python packages to ROS2 faster (repo).

Otherwise @aarsh_t's comment (one repo, two subfolders for ROS1 and ROS2 packages) is the best option right now AFAIK too.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2022-01-19 00:35:12 -0500

Seen: 289 times

Last updated: Jan 19 '22