Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Gazebo crashes on simulating gpu_ray

My situation is the following: I have a working robot model with a head_hokuyo_sensor as laser range finder. When using this model on my default setup, everything works fine. When using the model on a virtual machine, Gazebo crashes when the range readings are requested.

At first I thought Gazebo crashed any time when launched in the virtual machine. This is not true. It only crashes when the range readings are requested, either by visualization (as was default in my first try), or by ROS rviz. This is the output when the model is launched and the data is requested by rviz:

$ roslaunch p3dx_gazebo gazebo.launch 
... logging to /home/gazebo/.ros/log/0c658438-357b-11e3-952c-080027a2ea94/roslaunch-gazebo-VirtualBox-10513.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://gazebo-VirtualBox:44541/

SUMMARY
========

PARAMETERS
 * /robot_description
 * /rosdistro
 * /rosversion
 * /use_sim_time

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    urdf_spawner (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[gazebo-1]: started with pid [10534]
process[gazebo_gui-2]: started with pid [10539]
process[urdf_spawner-3]: started with pid [10546]
Gazebo multi-robot simulator, version 1.9.1
Copyright (C) 2013 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

Gazebo multi-robot simulator, version 1.9.1
Copyright (C) 2013 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

Msg Waiting for master.spawn_model script started
[ INFO] [1381829287.748584629]: Finished loading Gazebo ROS API Plugin.
[1;[ INFO] [1381829287.754626059]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
32mMsg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 10.0.2.15
OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.
libGL error: failed to load driver: vboxvideo
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
[INFO] [WallTime: 1381829287.963248] [0.000000] Loading model xml from ros parameter
[INFO] [WallTime: 1381829287.969376] [0.000000] Waiting for service /gazebo/spawn_urdf_model
[INFO] [WallTime: 1381829288.279075] [0.000000] Calling service /gazebo/spawn_urdf_model

Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 10.0.2.15
OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.
libGL error: failed to load driver: vboxvideo
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
Error [Param.cc:181] Unable to set value [1,0471975511965976] for key[horizontal_fov]
Error [Param.cc:181] Unable to set value [0,100000001] for key[near]
Warning [parser.cc:356] No <sdf> element in file[data-string]
[INFO] [WallTime: 1381829294.465796] [0.001000] Spawn status: SpawnModel: Successfully spawned model
[ INFO] [1381829294.500488438, 0.001000000]: LoadThread function completed
[ INFO] [1381829294.578569308, 0.001000000]: Loading gazebo_ros_control plugin
[ INFO] [1381829294.583119526, 0.001000000]: Starting gazebo_ros_control plugin in namespace: /p3dx
[ INFO] [1381829294.587561148, 0.001000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server.
[urdf_spawner-3] process has finished cleanly
log file: /home/gazebo/.ros/log/0c658438-357b-11e3-952c-080027a2ea94/urdf_spawner-3*.log
[ INFO] [1381829295.363769657, 0.001000000]: Loaded gazebo_ros_control.
[ INFO] [1381829295.372589215, 0.001000000]: Starting GazeboRosDiffDrive Plugin (ns = //)!
[ INFO] [1381829295.437790648, 0.021000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1381829295.612645974, 0.081000000]: Physics dynamic reconfigure ready.
Segmentation fault (core dumped)
[gazebo-1] process has died [pid 10534, exit code 139, cmd /opt/ros/hydro/lib/gazebo_ros/gzserver /home/gazebo/catkin/src/ua_ros_p3dx/p3dx_gazebo/worlds/p3dx.world __name:=gazebo __log:=/home/gazebo/.ros/log/0c658438-357b-11e3-952c-080027a2ea94/gazebo-1.log].
log file: /home/gazebo/.ros/log/0c658438-357b-11e3-952c-080027a2ea94/gazebo-1*.log

The model can be found here: https://github.com/RafBerkvens/ua_ros_p3dx/blob/master/p3dx_description/urdf/pioneer3dx.xml

Some OpenGL and LibGL errors can be seen during start-up, caused by the virtual machine to have disable 3D acceleration. Turning this on does not resolve the issue, but causes many errors. These errors are in turn resolved by using export LIBGL_ALWAYS_SOFTWARE=1, which can be found in this ROS answer. Of course, this is the same as not using 3D acceleration, resulting in the mentioned error, again.

I can not reproduce this error on my host machine (Ubuntu 13.04 64-bit; guest is Ubuntu 13.04 32-bit). At the host, everything works like it should.

Gazebo crashes on simulating gpu_ray

My situation is the following: I have a working robot model with a head_hokuyo_sensor as laser range finder. When using this model on my default setup, everything works fine. When using the model on a virtual machine, Gazebo crashes when the range readings are requested.

At first I thought Gazebo crashed any time when launched in the virtual machine. This is not true. It only crashes when the range readings are requested, either by visualization (as was default in my first try), or by ROS rviz. This is the output when the model is launched and the data is requested by rviz:

$ roslaunch p3dx_gazebo gazebo.launch 
... logging to /home/gazebo/.ros/log/0c658438-357b-11e3-952c-080027a2ea94/roslaunch-gazebo-VirtualBox-10513.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://gazebo-VirtualBox:44541/

SUMMARY
========

PARAMETERS
 * /robot_description
 * /rosdistro
 * /rosversion
 * /use_sim_time

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    urdf_spawner (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[gazebo-1]: started with pid [10534]
process[gazebo_gui-2]: started with pid [10539]
process[urdf_spawner-3]: started with pid [10546]
Gazebo multi-robot simulator, version 1.9.1
Copyright (C) 2013 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

Gazebo multi-robot simulator, version 1.9.1
Copyright (C) 2013 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

Msg Waiting for master.spawn_model script started
[ INFO] [1381829287.748584629]: Finished loading Gazebo ROS API Plugin.
[1;[ INFO] [1381829287.754626059]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
32mMsg Waiting for master
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 10.0.2.15
OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.
libGL error: failed to load driver: vboxvideo
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
[INFO] [WallTime: 1381829287.963248] [0.000000] Loading model xml from ros parameter
[INFO] [WallTime: 1381829287.969376] [0.000000] Waiting for service /gazebo/spawn_urdf_model
[INFO] [WallTime: 1381829288.279075] [0.000000] Calling service /gazebo/spawn_urdf_model

Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 10.0.2.15
OpenGL Warning: Failed to connect to host. Make sure 3D acceleration is enabled for this VM.
libGL error: failed to load driver: vboxvideo
libGL error: Try again with LIBGL_DEBUG=verbose for more details.
Error [Param.cc:181] Unable to set value [1,0471975511965976] for key[horizontal_fov]
Error [Param.cc:181] Unable to set value [0,100000001] for key[near]
Warning [parser.cc:356] No <sdf> element in file[data-string]
[INFO] [WallTime: 1381829294.465796] [0.001000] Spawn status: SpawnModel: Successfully spawned model
[ INFO] [1381829294.500488438, 0.001000000]: LoadThread function completed
[ INFO] [1381829294.578569308, 0.001000000]: Loading gazebo_ros_control plugin
[ INFO] [1381829294.583119526, 0.001000000]: Starting gazebo_ros_control plugin in namespace: /p3dx
[ INFO] [1381829294.587561148, 0.001000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [/robot_description] on the ROS param server.
[urdf_spawner-3] process has finished cleanly
log file: /home/gazebo/.ros/log/0c658438-357b-11e3-952c-080027a2ea94/urdf_spawner-3*.log
[ INFO] [1381829295.363769657, 0.001000000]: Loaded gazebo_ros_control.
[ INFO] [1381829295.372589215, 0.001000000]: Starting GazeboRosDiffDrive Plugin (ns = //)!
[ INFO] [1381829295.437790648, 0.021000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1381829295.612645974, 0.081000000]: Physics dynamic reconfigure ready.
Segmentation fault (core dumped)
[gazebo-1] process has died [pid 10534, exit code 139, cmd /opt/ros/hydro/lib/gazebo_ros/gzserver /home/gazebo/catkin/src/ua_ros_p3dx/p3dx_gazebo/worlds/p3dx.world __name:=gazebo __log:=/home/gazebo/.ros/log/0c658438-357b-11e3-952c-080027a2ea94/gazebo-1.log].
log file: /home/gazebo/.ros/log/0c658438-357b-11e3-952c-080027a2ea94/gazebo-1*.log

The model can be found here: https://github.com/RafBerkvens/ua_ros_p3dx/blob/master/p3dx_description/urdf/pioneer3dx.xml

Some OpenGL and LibGL errors can be seen during start-up, caused by the virtual machine to have disable 3D acceleration. Turning this on does not resolve the issue, but causes many errors. These errors are in turn resolved by using export LIBGL_ALWAYS_SOFTWARE=1, which can be found in this ROS answer. Of course, this is the same as not using 3D acceleration, resulting in the mentioned error, again.

I can not reproduce this error on my host machine (Ubuntu 13.04 64-bit; guest is Ubuntu 13.04 32-bit). At the host, everything works like it should.

I have been able to collect this backtrace:

Program received signal SIGSEGV, Segmentation fault.
0xb62ae708 in Ogre::Technique::getPass(unsigned short) ()
   from /usr/lib/i386-linux-gnu/libOgreMain.so.1.7.4
(gdb) backtrace 
#0  0xb62ae708 in Ogre::Technique::getPass(unsigned short) ()
   from /usr/lib/i386-linux-gnu/libOgreMain.so.1.7.4
#1  0xb70090f1 in gazebo::rendering::GpuLaser::UpdateRenderTarget(Ogre::RenderTarget*, Ogre::Material*, Ogre::Camera*, bool) ()
   from /usr/lib/libgazebo_rendering.so.1
#2  0xb7009813 in gazebo::rendering::GpuLaser::RenderImpl() ()
   from /usr/lib/libgazebo_rendering.so.1
#3  0xb6fdbc1f in gazebo::rendering::Camera::Render() ()
   from /usr/lib/libgazebo_rendering.so.1
#4  0xb7bd97e2 in gazebo::sensors::GpuRaySensor::UpdateImpl(bool) ()
   from /usr/lib/libgazebo_sensors.so.1
#5  0xb7bf0c40 in gazebo::sensors::Sensor::Update(bool) ()
   from /usr/lib/libgazebo_sensors.so.1
#6  0xb7bf6bd4 in gazebo::sensors::SensorManager::SensorContainer::Update(bool)
    () from /usr/lib/libgazebo_sensors.so.1
#7  0xb7bf723c in gazebo::sensors::SensorManager::ImageSensorContainer::Update(bool) () from /usr/lib/libgazebo_sensors.so.1
#8  0xb7bf7dec in gazebo::sensors::SensorManager::Update(bool) ()
   from /usr/lib/libgazebo_sensors.so.1
#9  0xb7bef390 in gazebo::sensors::run_once(bool) ()
   from /usr/lib/libgazebo_sensors.so.1
#10 0x0806f651 in gazebo::Server::Run() ()
#11 0x0806ada0 in main ()