Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
languages: add ROS guide #132
Conversation
|
Created the repo @kyrofa https://github.com/snapcraft-docs/ros-talker-listener |
| +title: Robot Operating System (ROS) | ||
| +--- | ||
| + | ||
| +Snapcraft builds on top of the `catkin` tool, familiar to any ROS developer, to create snaps for people to install on Linux. |
sergiusens
Oct 5, 2017
Collaborator
this needs some rewording I think, "builds on top of" would be better said as "leverages" I believe.
And "to create snaps for people to install on Linux" has a strange vibe to it, maybe that is just me
sergiusens
Oct 5, 2017
Collaborator
ok, no change here then, but @evandandrea don't you find this strange after reading?
kyrofa
Oct 5, 2017
Collaborator
@evandandrea speaks the Queen's English these days, who are we to question?
evandandrea
Oct 9, 2017
Collaborator
What we were trying to convey with "builds on top of" is that you will continue to work with the tools you're already familiar with. Snapcraft is a light extension on these to produce auto-updating builds for Linux.
If we think this is poorly captured in "builds on top of", that's fine. Let's change it as part of this PR here and in the other language guides. As a general rule, we can and should refine the language used in the guides, making sure to update all of them at once.
sergiusens
Oct 9, 2017
Collaborator
that does make sense, reading it today it does convey that message.
| + | ||
| +## What problems do snaps solve for ROS applications? | ||
| + | ||
| +ROS itself is distributed via the OSRF's own Debian archive, along with many community-supported tools. It's possible to get one's own application into their archive as well, but it requires that the application is open-source. One is also left with the question of how to update ROS and one's own application on a robotic platform that has already been shipped. With snapcraft it's just one command to bundle a specific ROS version along with one's own application into a snap that works anywhere and can be automatically updated. |
| + | ||
| +Here are some snap advantages that will benefit many ROS projects: | ||
| + | ||
| + * Bundle all the runtime requirements, including the exact version of ROS, system libraries, etc. |
sergiusens
Oct 5, 2017
Collaborator
not sure how welcome this is, but you could potentially have many ROS runtimes in different snaps.
Thanks @sergiusens! All set. |
| + | ||
| +The Catkin plugin will bundle `roscore` in the snap. It will also use `rosdep` to determine the dependencies of the `catkin-packages` provided, download them from the ROS archive, and unpack them into the snap. Finally, it will build the `catkin-packages` specified. | ||
| + | ||
| +**Important note:** Most ROS developers run out of the `devel` space. As a result, it's easy to forget the importance of good install rules. The Catkin packages you're building must have good install rules, or Snapcraft won't know which components to place into the snap. Make sure you install binaries, libraries, launch files, etc. |
sergiusens
Oct 5, 2017
Collaborator
you could introduce the install scripting stanza to move things over manually though as a poor mans install target.
kyrofa
Oct 5, 2017
Collaborator
Good idea. Several of the guides have an "Extending and overriding behaviour" section where they discuss such things. I just added one here.
kyrofa
added some commits
Oct 5, 2017
| + catkin-packages: [roscpp_tutorials] | ||
| + install: | | ||
| + mkdir -p "$SNAPCRAFT_PART_INSTALL/opt/ros/kinetic/share/roscpp_tutorials/launch" | ||
| + cp roscpp_tutorials/launch/talker_listener.launch "$SNAPCRAFT_PART_INSTALL/opt/ros/kinetic/share/roscpp_tutorials/launch/" |
evandandrea
requested changes
Oct 9, 2017
I think this is mostly there. Just two small issues.
| + | ||
| +The Catkin plugin will bundle `roscore` in the snap. It will also use `rosdep` to determine the dependencies of the `catkin-packages` provided, download them from the ROS archive, and unpack them into the snap. Finally, it will build the `catkin-packages` specified. | ||
| + | ||
| +**Important note:** Most ROS developers run out of the `devel` space. As a result, it's easy to forget the importance of good install rules. The Catkin packages you're building must have good install rules, or Snapcraft won't know which components to place into the snap. Make sure you install binaries, libraries, launch files, etc. |
kyrofa
Oct 9, 2017
Collaborator
Install rules that install every component of the package necessary to run. It's fairly common to be missing some or all with ROS packages.
| + | ||
| +You can [extend the behaviour](/build-snaps/scriptlets) of any part in your `snapcraft.yaml` with shell commands. These can be run after pulling the source code but before building by using the `prepare` keyword. The build process can be overridden entirely using the `build` keyword and shell commands. The `install` keyword is used to run shell commands after building your code, useful for making post build modifications such as relocating build assets. | ||
| + | ||
| +For example, while the ros_tutorials have proper install rules, say you were creating a snap of an upstream ROS application that didn't, and you wanted a launch file out of it. You could make use of the `install` keyword as a poor man's install rule: |
evandandrea
Oct 9, 2017
Collaborator
I would find a more positive way of describing this use of the install keyword.
kyrofa
Oct 9, 2017
Collaborator
I can't think of a more relevant and positive example for ROS. I can remove this section.
evandandrea
Oct 10, 2017
Collaborator
Sorry, let me rephrase. I think the example is fine, but I wouldn’t call it a “poor man’s rule.”
|
I’m |
Your review is still "requesting changes." Mind taking a look when you have a sec? |
|
(Thanks for the quick turnaround on reviews, by the way. I know you guys have a lot going on.) |
evandandrea
merged commit 47eb092
into
canonical-docs:master
Oct 10, 2017
|
Thanks for this. |
kyrofa commentedOct 4, 2017
•
Edited 1 time
-
kyrofa
Oct 5, 2017
My take of the user-story-driven docs for ROS developers.