Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of single package containing both ros1 and ros2 code #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Levi-Armstrong
Copy link

I came across your example and was interested in seeing if it was possible to contain both ros1 and ros2 into a single package so the package name could be the same in both ros1 and ros2. This PR is not intended to be merged into the master but if you want I can rename this to different package name and keep the original examples to show both ways if you are interested.

<maintainer email="[email protected]">rre</maintainer>
<license>BSD</license>

<buildtool_depend condition="$ROS_VERSION == 1">catkin</buildtool_depend>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this 'condition' attribute currently supported?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +4 to +5
find_package(catkin QUIET)
find_package(ament_cmake QUIET)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that both could be found in situations where both ROS 1 and ROS 2 have been sourced (fi when the ros1bridge is being used).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something you would do when building or only when running things?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am assuming this should not be done when building so I could added a check if both are found it would error.

Copy link

@gavanderhoorn gavanderhoorn Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something you would do when building or only when running things?

Both. For custom messages or services the bridge needs to be rebuilt. That would be something users will want to do I believe in many cases.

I am assuming this should not be done when building so I could added a check if both are found it would error.

If with "this" you are referring to "sourceing both" then it would be done both at runtime and at build time.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the case then will there be package name conflicts between ros1 and ros2 packages with the same name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants