Skip to content

Commit 99b3d98

Browse files
authored
Update snapcraft.yaml and install instructions (#58)
1 parent 0220dd6 commit 99b3d98

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

snap/snapcraft.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ description: |
7171
7272
$ snap set micro-ros-agent device="device path"
7373
74+
If connecting the micro-ROS Agent using an IP based connection mode,
75+
that is, `udp4`, `udp6`, `tcp4` or `tcp6`, care must be taken to
76+
connect first the `micro-ros-agent-shm-netplug` plug.
77+
This is due to the fact that ROS 2 Foxy is using Fast-DDS as the
78+
default DDS middleware, and Fast-DDS comes with *shared memory transport*.
79+
Thus, this plugin must be enabled, in order to gain access to the
80+
`/dev/shm` folder from the snap image, prior to running it:
81+
82+
$ sudo snap connect micro-ros-agent:micro-ros-agent-shm-netplug
83+
7484
When using the snap with a serial device, some steps need to be taken
7585
in order to establish a successful connection:
7686
@@ -116,13 +126,16 @@ parts:
116126
plugin: colcon
117127
source: .
118128
override-build: |
129+
set +u
119130
git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git -b $ROS_DISTRO
120131
git clone https://github.com/eProsima/Micro-CDR.git -b $ROS_DISTRO
121132
git clone https://github.com/micro-ROS/micro_ros_msgs.git -b $ROS_DISTRO
122133
git clone https://github.com/micro-ROS/rosidl_typesupport_microxrcedds.git -b $ROS_DISTRO
123134
git clone https://github.com/micro-ROS/rmw-microxrcedds.git -b $ROS_DISTRO
135+
git clone https://github.com/micro-ROS/micro-ROS-Agent.git -b $ROS_DISTRO
124136
. /opt/ros/$ROS_DISTRO/setup.sh
125-
colcon build --merge-install --install-base $SNAPCRAFT_PRIME --cmake-args '-DUAGENT_BUILD_EXECUTABLE=OFF' --packages-up-to micro_ros_agent
137+
colcon build --merge-install --install-base $SNAPCRAFT_PRIME --cmake-args "-DUAGENT_BUILD_EXECUTABLE=OFF -DUAGENT_USE_SYSTEM_FASTDDS=ON" --packages-up-to micro_ros_agent
138+
set -u
126139
build-packages: [make, gcc, g++]
127140
stage-packages: [ros-foxy-ros2launch]
128141

@@ -132,17 +145,24 @@ parts:
132145
organize:
133146
'*': usr/bin/
134147

148+
plugs:
149+
micro-ros-agent-shm-netplug:
150+
interface: system-files
151+
allow-auto-connection: true
152+
write:
153+
- /dev/shm
154+
135155
apps:
136156
micro-ros-agent:
137157
command: lib/micro_ros_agent/micro_ros_agent
138158
environment:
139159
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/lib"
140-
plugs: [network, network-bind, serial-port]
160+
plugs: [network, network-bind, serial-port, micro-ros-agent-shm-netplug]
141161
extensions: [ros2-foxy]
142162

143163
daemon:
144164
command: usr/bin/micro-ros-agent-daemon
145165
environment:
146166
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/lib"
147167
daemon: simple
148-
plugs: [network, network-bind, serial-port]
168+
plugs: [network, network-bind, serial-port, micro-ros-agent-shm-netplug]

0 commit comments

Comments
 (0)