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

Catkin plugin: Add support for ROS tools. #152

Merged
merged 1 commit into from Dec 7, 2015

Conversation

kyrofa
Copy link
Contributor

@kyrofa kyrofa commented Dec 4, 2015

The current Catkin plugin distributes only the built version of a ROS package that would typically go into the devel workspace, but that version doesn't include non-source, non-binary files, such as .launch files. This PR changes the plugin to actually install ROS packages, thereby including any non-source, non-binary files specified by the developer.

This PR also updates the wrapper environment to correctly setup the ROS environment, which allows for the use of typical ROS tools within the snapcraft.yaml, such as roslaunch, rosrun, etc., and updates the ROS examples to make use of them.

Finally, this PR also increases the test coverage of the Catkin plugin twofold.

LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

💯

plugin = catkin.CatkinPlugin('test-part', self.properties)

with mock.patch.object(builtins, 'open',
mock.mock_open(read_data=package_xml)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you remove this mock by writting the xml file to the sourcedir?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed I could, but I feel like actually hitting the filesystem when I don't need to feels a bit brittle and slow.

Copy link
Contributor

Choose a reason for hiding this comment

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

In unit tests, I prefer to access the filesystem in temp directories instead of mocking that part.
But your test is correct, if you prefer it this way, I'm ok with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't feel strongly about this. I'll update it :) .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@sergiusens
Copy link
Collaborator

I like this very much. One followup question is; do we need the ros plugin at all? I always found it redundant as maybe the core can be pulled in through some logic here.

@kyrofa
Copy link
Contributor Author

kyrofa commented Dec 4, 2015

@sergiusens I was wondering that myself. Let me experiment, this PR may have enabled the removal of it.

@kyrofa
Copy link
Contributor Author

kyrofa commented Dec 4, 2015

Alright I believe I've resolved all the concerns for this one. I will continue to increase test coverage throughout subsequent PRs, and will remove the roscore plugin once the blocking bug has been resolved.

@come-maiz
Copy link
Contributor

The example fails to build with:
Error: parts catkin-tutorials and roscore have the following file paths in common which have different contents:

usr/bin/xml2-config

@kyrofa
Copy link
Contributor Author

kyrofa commented Dec 5, 2015

@ElOpio oh interesting, I didn't consider the interplay between plugins! I will add that to my manual test procedure. xml2-config isn't a required file, so I have temporarily added the removal of it back to the catkin plugin until we can remove roscore.

The current Catkin plugin distributes only the built version of
a ROS package that would typically go into the devel workspace,
but that version doesn't include non-source, non-binary files,
such as .launch files. This commit changes the plugin to actually
install ROS packages, thereby including any non-source, non-binary
files specified by the developer.

This commit also updates the wrapper environment to correctly
setup the ROS environment, which allows for the use of typical
ROS tools within the snapcraft.yaml, such as roslaunch, rosrun,
etc., and updates the ROS examples to make use of them.

This commit also increases the test coverage of the Catkin plugin
twofold.

Signed-off-by: Kyle Fazzari <kyle@canonical.com>
@sergiusens
Copy link
Collaborator

@ElOpio and @kyrofa fwiw, plugins aren't supposed to solve all the conflicts in the world, that is to some extent part of the part author's responsibility. That does no rule out plugins themselves should try to deliver the cleanest environment possible, but not in detriment of its functionality.

In the example of xml-config, if I as an author ever create another part that also ships xml-config I would need to solve if somehow, luckily, that is somewhat what the stage, snap and organize keywords are for.

@sergiusens
Copy link
Collaborator

I'm 👍 on this branch btw 😉

@come-maiz
Copy link
Contributor

Me too. Merging.

come-maiz added a commit that referenced this pull request Dec 7, 2015
Catkin plugin: Add support for ROS tools.
@come-maiz come-maiz merged commit fc51421 into canonical:master Dec 7, 2015
@kyrofa kyrofa deleted the catkin_support_roslaunch branch December 7, 2015 15:44
kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017
Catkin plugin: Add support for ROS tools.
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.

None yet

4 participants