I’ve been working for some days in trying to make a snap of my ROS Indigo workspace, which apart from the packages for running the real robot, contains the necessary for launching a simulation in Gazebo. In this snap I just selected the necessary packages for running the simulation.
However, after the first tests I had realised that it wasn’t going to be as easy as I expected, so finally I decided to just focus in trying to make Gazebo working first. Basically I wanted to be able to execute roslaunch gazebo_ros empty_world.launch --screen
from my snap.
Here is my snapcraft.yaml:
name: mobile-base-snap
version: '0.1'
summary: Trying to snap the complete workspace.
description: That's all.
grade: stable
confinement: devmode
apps:
system:
command: roslaunch mobile_base_snap mobile_base_snap.launch --screen
plugs: [network, network-bind, home, x11, opengl]
gazebo:
command: roslaunch gazebo_ros empty_world.launch --screen
plugs: [network, network-bind, home, x11, opengl]
parts:
simulation:
plugin: catkin
rosdistro: indigo
catkin-packages: [mobile_base_snap, mobile_base_description, mobile_base_simulator]
install:
sed --in-place "s:setup_path=.*:setup_path=/snap/mobile-base-snap/current/usr/share/gazebo:g" "$SNAPCRAFT_PART_INSTALL/opt/ros/indigo/lib/gazebo_ros/debug";
sed --in-place "s:setup_path=.*:setup_path=/snap/mobile-base-snap/current/usr/share/gazebo:g" "$SNAPCRAFT_PART_INSTALL/opt/ros/indigo/lib/gazebo_ros/gazebo";
sed --in-place "s:setup_path=.*:setup_path=/snap/mobile-base-snap/current/usr/share/gazebo:g" "$SNAPCRAFT_PART_INSTALL/opt/ros/indigo/lib/gazebo_ros/gzclient";
sed --in-place "s:setup_path=.*:setup_path=/snap/mobile-base-snap/current/usr/share/gazebo:g" "$SNAPCRAFT_PART_INSTALL/opt/ros/indigo/lib/gazebo_ros/gzserver";
sed --in-place "s:setup_path=.*:setup_path=/snap/mobile-base-snap/current/usr/share/gazebo:g" "$SNAPCRAFT_PART_INSTALL/opt/ros/indigo/lib/gazebo_ros/perf";
You must have realised about the sed
commands at the install
section. This was made in order to solve this bug (probably in an incorrect way, please, correct me if so!).
Well, after being able to “solve it” in a more than doubtful way, now I’m getting this one when running the snap:
$ snap run mobile-base-snap.gazebo
... logging to /home/mbeneto/snap/mobile-base-snap/x1/ros/log/922a9c0a-af27-11e7-8b36-d8cb8a37dac2/roslaunch-utxera-32604.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://utxera:41526/
SUMMARY
========
PARAMETERS
* /rosdistro: indigo
* /rosversion: 1.11.21
* /use_sim_time: True
NODES
/
gazebo (gazebo_ros/gzserver)
gazebo_gui (gazebo_ros/gzclient)
auto-starting new master
process[master]: started with pid [32677]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to 922a9c0a-af27-11e7-8b36-d8cb8a37dac2
process[rosout-1]: started with pid [32690]
started core service [/rosout]
process[gazebo-2]: started with pid [32693]
process[gazebo_gui-3]: started with pid [32696]
Error opening log file: "/home/mbeneto/snap/mobile-base-snap/x1/.gazebo/gzserver.log"
Gazebo multi-robot simulator, version 2.2.3
Copyright (C) 2012-2014 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
Gazebo multi-robot simulator, version 2.2.3
Copyright (C) 2012-2014 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
Msg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 10.100.128.76
[ INFO] [1507797016.449831934]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1507797016.450176981]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
Msg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 10.100.128.76
X Error: BadValue
Request Major code 154 (GLX)
Request Minor code 3 ()
Value 0x0
Error Serial #26
Current Serial #27
gzserver: /usr/include/boost/thread/pthread/recursive_mutex.hpp:101: boost::recursive_mutex::~recursive_mutex(): Assertion `!pthread_mutex_destroy(&m)' failed.
Aborted (core dumped)
[gazebo-2] process has died [pid 32693, exit code 134, cmd /snap/mobile-base-snap/x1/opt/ros/indigo/lib/gazebo_ros/gzserver -e ode worlds/empty.world __name:=gazebo __log:=/home/mbeneto/snap/mobile-base-snap/x1/ros/log/922a9c0a-af27-11e7-8b36-d8cb8a37dac2/gazebo-2.log].
log file: /home/mbeneto/snap/mobile-base-snap/x1/ros/log/922a9c0a-af27-11e7-8b36-d8cb8a37dac2/gazebo-2*.log
I’m running out of ideas and taking into account that this is my first snap experience I’m pretty lost. Any hint or tip?