App store advanced topics

App store advanced topics
Erle Robotics
May 21, 2015
Contents
1 Installing an official ROS package
3
2 Compiling a ROS package from source
3
3 Creating an app from a ROS package
4
4 License
5
Getting WIFI in Snappy Ubuntu Core with Erle-Copter
2
May 21, 2015
1
INSTALLING AN OFFICIAL ROS PACKAGE
Login into Erle-Brain and go to the trusty chroot where ROS is installed. Assuming that you’re
connected through the miniUSB terminal (same could be done through WiFi, Ethernet, …):
ssh ubuntu@192 . 1 6 8 . 7 . 2 # p a s s w o r d ” ubuntu ”
( E r l e R o b o t i c s ) ubuntu@localhost : ~ / t r u s t y $
( E r l e R o b o t i c s ) ubuntu@localhost : ~ / t r u s t y $ cd t r u s t y
( E r l e R o b o t i c s ) ubuntu@localhost : ~ / t r u s t y $ sudo . / chroot . sh
root@localhost : /
Our Snappy images include an inner Trusty file system to simplify ROS installation and maintainance (Note: this will soon change into a formal Vivid installation as soon as packages become available). This inner file system allows you to easily install ROS packages using:
root@localhost : /
apt−get i n s t a l l ros−i n d i g o −<ros−package−name>
For example, let’s install the serial ROS package from the build farm:
root@localhost : /
2
apt−get i n s t a l l ros−i n d i g o −s e r i a l
COMPILING A ROS PACKAGE FROM SOURCE
Let’s assume you created a new ROS package (e.g.: ros_erle_takeoff_land) and you’d like to compile it natively. Here’s how you would do it:
Getting WIFI in Snappy Ubuntu Core with Erle-Copter
3
May 21, 2015
# a s s u m i n g you a l r e a d y e n t e r e d t h e t r u s t y c h r o o t
source / opt / r o s / i n d i g o / setup . bash # s e t u p ROS env . v a r i a b l e s
mkdir −p c a t k i n _ w s / s r c
cd c a t k i n _ w s / s r c
catkin_init_workspace
C r e a t i n g s y m l i n k ” / r o o t / c a t k i n _ w s / s r c / CMakeLists . t x t ” p o i n t i n g to ” / opt / r o
g i t c l o n e h t t p s : / / g i t h u b . com / e r l e r o b o t / r o s _ e r l e _ t a k e o f f _ l a n d
Cloning into ’ r o s _ e r l e _ t a k e o f f _ l a n d ’ . . .
remote : Counting o b j e c t s : 12 , done .
remote : T o t a l 12 ( d e l t a 0 ) , reused 0 ( d e l t a 0 ) , pack−reused 12
Unpacking o b j e c t s : 100% ( 1 2 / 1 2 ) , done .
Checking c o n n e c t i v i t y . . . done
Great! now you’re all set to compile the package (whole trace available here):
c a t k i n _ m a k e _ i s o l a t e d −− i n s t a l l # o r ” c a t k i n _ m a k e i n s t a l l ”
Base path : / r o o t / c a t k i n _ w s
Source space : / r o o t / c a t k i n _ w s / s r c
B u i l d space : / r o o t / c a t k i n _ w s / b u i l d _ i s o l a t e d
Devel space : / r o o t / c a t k i n _ w s / d e v e l _ i s o l a t e d
I n s t a l l space : / r o o t / c a t k i n _ w s / i n s t a l l _ i s o l a t e d
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
t r a v e r s i n g 1 packages i n t o p o l o g i c a l order :
~~
− ros_erle_takeoff_land
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The packages or cmake arguments have changed , f o r c i n g cmake i n v o c a t i o n
==> P r o c e s s i n g c a t k i n package :
’ ros_erle_takeoff_land ’
We used a catkin workspace for this example but you could also install the package at /opt/ros/indigo and make it available from the outer file system (Snappy Ubuntu Core).
3
CREATING AN APP FROM A ROS PACKAGE
All right, so now we have a ROS package compiled and you want to ship this package as an app.
How would you do this?:
Getting WIFI in Snappy Ubuntu Core with Erle-Copter
4
May 21, 2015
# Compute t h e d e p e n d e n c i e s
cd ~/ t r u s t y /
sudo . / chroot . sh
source / opt / r o s / i n d i g o / setup . bash # s e t u p ROS env . v a r i a b l e s
cd / r o o t / c a t k i n _ w s
ros2snap r o s _ e r l e _ t a k e o f f _ l a n d
Computing dependencies f o r mavros
Computing dependencies f o r mavros−e x t r a s
After the dependencies have been computed and the snap structure created just create the
app:
e x i t # e x i t from t h e c h r o o t
su # g e t s u p e r u s e r p r i v i l e g e s
cd r o o t / c a t k i n _ w s
# copy t h e p a c k a g e t o a more f r i e n d l y p l a c e
cp −r i n s t a l l _ i s o l a t e d / / home / ubuntu /
e x i t # g e t o u t o f t h e i n n e r c h r o o t t o c r e a t e t h e snap
cd ~
sudo snappy b u i l d i n s t a l l _ i s o l a t e d
A ros2snap_0.1_armhf.snap package should be created.
The same process could be done outside of Erle-Brain using an external chroot in your development machine. Refer to these instructions.
4
LICENSE
Unless specified, this content is licensed under the Creative Commons Attribution-NonComercial-Share Alike 3.0 Unported License. To view
a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite
300, San Francisco, California, 94105, USA.
If you plan on using this material for commercial purposes get in touch with us at [email protected]
Getting WIFI in Snappy Ubuntu Core with Erle-Copter
5