languages: add ROS guide #132

Merged
merged 5 commits into from Oct 10, 2017

Conversation

Projects
None yet
3 participants
Collaborator

kyrofa commented Oct 4, 2017

My take of the user-story-driven docs for ROS developers.

languages: add ROS guide
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
+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

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

@kyrofa

kyrofa Oct 5, 2017

Collaborator

This is just part of the template.

@sergiusens

sergiusens Oct 5, 2017

Collaborator

ok, no change here then, but @evandandrea don't you find this strange after reading?

@kyrofa

kyrofa Oct 5, 2017

Collaborator

@evandandrea speaks the Queen's English these days, who are we to question? 😉

@evandandrea

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

sergiusens Oct 9, 2017

Collaborator

that does make sense, reading it today it does convey that message.

build-snaps/ros.md
+
+## 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.
@sergiusens

sergiusens Oct 5, 2017

Collaborator

too much use of "one's own" in here.

@kyrofa

kyrofa Oct 5, 2017

Collaborator

Rephrased to be more personable.

build-snaps/ros.md
+
+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

sergiusens Oct 5, 2017

Collaborator

not sure how welcome this is, but you could potentially have many ROS runtimes in different snaps.

@kyrofa

kyrofa Oct 5, 2017

Collaborator

Yeah, too advanced for this, I think.

Collaborator

kyrofa commented Oct 5, 2017

build-snaps/ros.md
+
+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

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

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

ros: make language more personable
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
ros: add "extending behavior" section
Discuss using scriptlets as a poor man's install rule.

Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
build-snaps/ros.md
+ 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/"
@sergiusens

sergiusens Oct 5, 2017

Collaborator

only the launch file?

@kyrofa

kyrofa Oct 5, 2017

Collaborator

Made the example more theoretical to avoid confusion.

Clarify install scriptlet usage
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>

I think this is mostly there. Just two small issues.

build-snaps/ros.md
+
+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.
@evandandrea

evandandrea Oct 9, 2017

Collaborator

What are "good install rules"?

@kyrofa

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.

@evandandrea

evandandrea Oct 10, 2017

Collaborator

Cool. As long as good is unambiguous, I’m +1

@kyrofa

kyrofa Oct 10, 2017

Collaborator

I added a clarification.

build-snaps/ros.md
+
+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

evandandrea Oct 9, 2017

Collaborator

I would find a more positive way of describing this use of the install keyword.

@kyrofa

kyrofa Oct 9, 2017

Collaborator

I can't think of a more relevant and positive example for ROS. I can remove this section.

@evandandrea

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.”

@kyrofa

kyrofa Oct 10, 2017

Collaborator

Ah, I see. Okay, done.

Collaborator

evandandrea commented Oct 10, 2017

I’m 👍

Define "good install rule"
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
Collaborator

kyrofa commented Oct 10, 2017

I’m 👍

Your review is still "requesting changes." Mind taking a look when you have a sec?

Collaborator

kyrofa commented Oct 10, 2017

(Thanks for the quick turnaround on reviews, by the way. I know you guys have a lot going on.)

@evandandrea evandandrea merged commit 47eb092 into canonical-docs:master Oct 10, 2017

Collaborator

evandandrea commented Oct 10, 2017

Thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment