Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Gazebo headless over ssh

Hello guys,

Here my systems: Clients (Ubuntu16.04 or WIN10 with putty and Xming ) Server : Ubuntu 16.04 I have following problem: I want to run my simulation on pc with remote. I have to run a lot of runs for a lot of image data...

I have a launch file and world file on Server and i want to start is remotely. I made a question couple days before there i used no x11 forwarding. I got an answer to use x11 forwarding . I done this but i got into another issues...

When i start gazebo headless with launch file :

roslaunch newTurtlebot.launch

I get the following :

SUMMARY
========

PARAMETERS
 * /bumper2pointcloud/pointcloud_radius: 0.24
 * /cmd_vel_mux/yaml_cfg_file: /opt/ros/kinetic/...
 * /depthimage_to_laserscan/output_frame_id: /camera_depth_frame
 * /depthimage_to_laserscan/range_min: 0.45
 * /depthimage_to_laserscan/scan_height: 10
 * /robot_description: <?xml version="1....
 * /robot_state_publisher/publish_frequency: 30.0
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /use_sim_time: True

NODES
  /
    bumper2pointcloud (nodelet/nodelet)
    cmd_vel_mux (nodelet/nodelet)
    depthimage_to_laserscan (depthimage_to_laserscan/depthimage_to_laserscan)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    laserscan_nodelet_manager (nodelet/nodelet)
    mobile_base_nodelet_manager (nodelet/nodelet)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    spawn_turtlebot_model (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311

process[gazebo-1]: started with pid [1040]
process[gazebo_gui-2]: started with pid [1047]
process[spawn_turtlebot_model-3]: started with pid [1055]
process[mobile_base_nodelet_manager-4]: started with pid [1059]
process[cmd_vel_mux-5]: started with pid [1060]
process[bumper2pointcloud-6]: started with pid [1061]
process[robot_state_publisher-7]: started with pid [1062]
process[laserscan_nodelet_manager-8]: started with pid [1076]
process[depthimage_to_laserscan-9]: started with pid [1083]
[ INFO] [1544617958.670005692]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1544617958.670604047]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
debug3: receive packet: type 90
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from 127.0.0.1 44754
debug2: fd 8 setting TCP_NODELAY
debug2: fd 8 setting O_NONBLOCK
debug3: fd 8 is O_NONBLOCK
debug1: channel 1: new [x11]
debug1: confirm x11
debug3: send packet: type 91
[gazebo-1] process has died [pid 1040, exit code 255, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -e ode /home/usr/turtlebot_project/Tworld1.world __name:=gazebo __log:=/home/usr/.ros/log/082a1574-fe06-11e8-b44c-d8cb8a119b1a/gazebo-1.log].
log file: /home/sc2/.ros/log/082a1574-fe06-11e8-b44c-d8cb8a119b1a/gazebo-1*.log
[mobile_base_nodelet_manager-4] process has finished cleanly
log file: /home/sc2/.ros/log/082a1574-fe06-11e8-b44c-d8cb8a119b1a/mobile_base_nodelet_manager-4*.log
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  143 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  19
  Current serial number in output stream:  19
terminate called after throwing an instance of 'boost::exception_detail::clone_i             mpl<boost::exception_detail::error_info_injector<boost::lock_error> >'
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
debug3: receive packet: type 96
debug2: channel 1: rcvd eof
debug2: channel 1: output open -> drain
debug2: channel 1: obuf empty
debug2: channel 1: close_write
debug2: channel 1: output drain -> closed
debug1: channel 1: FORCE input drain
debug2: channel 1: ibuf empty
debug2: channel 1: send eof
debug3: send packet: type 96
debug2: channel 1: input drain -> closed
debug2: channel 1: send close
debug3: send packet: type 97
debug3: channel 1: will not send data after close
Aborted (core dumped)
debug3: channel 1: will not send data after close
debug3: receive packet: type 97
debug2: channel 1: rcvd close
debug3: channel 1: will not send data after close
debug2: channel 1: is dead
debug2: channel 1: garbage collecting
debug1: channel 1: free: x11, nchannels 2
debug3: channel 1: status: The following connections are open:
  #0 client-session (t4 r0 i0/0 o0/0 fd 5/6 cc -1)
  #1 x11 (t4 r3 i3/0 o3/0 fd 8/8 cc -1)

[gazebo_gui-2] process has died [pid 1047, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzclient __name:=gazebo_gui __log:=/home/usr/.ros/log/082a1574-fe06-11e8-b44c-d8cb8a119b1a/gazebo_gui-2.log].
log file: /home/usr/.ros/log/082a1574-fe06-11e8-b44c-d8cb8a119b1a/gazebo_gui-2*. log
debug2: client_check_window_change: changed

I also have tried:

roslaunch-deps -v newTurtlebot.launch

i got something like:

The launch file is runnable if i run it directly on the server without any remote connection. But i need remote connection.

processing launch newTurtlebot.launch
processing included launch /opt/ros/kinetic/share/gazebo_ros/launch/empty_world.launch
processing included launch /opt/ros/kinetic/share/turtlebot_gazebo/launch/includes/kobuki.launch.xml
processing included launch /opt/ros/kinetic/share/turtlebot_bringup/launch/includes/kobuki/bumper2pc.launch.xml
ERROR: cannot determine package for [None]
robot_state_publisher [robot_state_publisher/robot_state_publisher]
nodelet [nodelet/nodelet]
depthimage_to_laserscan [depthimage_to_laserscan/depthimage_to_laserscan]
ERROR: cannot determine package for [None]
nodelet [nodelet/nodelet]
turtlebot_bringup [/opt/ros/kinetic/share/turtlebot_bringup/launch/includes/kobuki/bumper2pc.launch.xml]
gazebo_ros [gazebo_ros/spawn_model]
nodelet [nodelet/nodelet]
turtlebot_gazebo [/opt/ros/kinetic/share/turtlebot_gazebo/launch/includes/kobuki.launch.xml]
gazebo_ros [gazebo_ros/gzserver]
gazebo_ros [gazebo_ros/gzclient]
gazebo_ros [/opt/ros/kinetic/share/gazebo_ros/launch/empty_world.launch]
--------------------------------------------------------------------------------
depthimage_to_laserscan robot_state_publisher turtlebot_gazebo nodelet gazebo_ros turtlebot_bringup

So times gazebo started up correctly but all camera plugins did not worked... but most of the time i ended up with the errors above..

Gazebo headless over ssh

Hello guys,

Here my systems: Clients (Ubuntu16.04 or WIN10 with putty and Xming ) Server : Ubuntu 16.04 I have following problem: I want to run my simulation on pc with remote. I have to run a lot of runs for a lot of image data...

I have a launch file and world file on Server and i want to start is remotely. I made a question couple days before there i used no x11 forwarding. I got an answer to use x11 forwarding . I done this but i got into another issues...

When i start gazebo headless with launch file :

roslaunch newTurtlebot.launch

I get the following :

SUMMARY
========

PARAMETERS
 * /bumper2pointcloud/pointcloud_radius: 0.24
 * /cmd_vel_mux/yaml_cfg_file: /opt/ros/kinetic/...
 * /depthimage_to_laserscan/output_frame_id: /camera_depth_frame
 * /depthimage_to_laserscan/range_min: 0.45
 * /depthimage_to_laserscan/scan_height: 10
 * /robot_description: <?xml version="1....
 * /robot_state_publisher/publish_frequency: 30.0
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /use_sim_time: True

NODES
  /
    bumper2pointcloud (nodelet/nodelet)
    cmd_vel_mux (nodelet/nodelet)
    depthimage_to_laserscan (depthimage_to_laserscan/depthimage_to_laserscan)
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    laserscan_nodelet_manager (nodelet/nodelet)
    mobile_base_nodelet_manager (nodelet/nodelet)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    spawn_turtlebot_model (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311

process[gazebo-1]: started with pid [1040]
process[gazebo_gui-2]: started with pid [1047]
process[spawn_turtlebot_model-3]: started with pid [1055]
process[mobile_base_nodelet_manager-4]: started with pid [1059]
process[cmd_vel_mux-5]: started with pid [1060]
process[bumper2pointcloud-6]: started with pid [1061]
process[robot_state_publisher-7]: started with pid [1062]
process[laserscan_nodelet_manager-8]: started with pid [1076]
process[depthimage_to_laserscan-9]: started with pid [1083]
[ INFO] [1544617958.670005692]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1544617958.670604047]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
debug3: receive packet: type 90
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from 127.0.0.1 44754
debug2: fd 8 setting TCP_NODELAY
debug2: fd 8 setting O_NONBLOCK
debug3: fd 8 is O_NONBLOCK
debug1: channel 1: new [x11]
debug1: confirm x11
debug3: send packet: type 91
[gazebo-1] process has died [pid 1040, exit code 255, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -e ode /home/usr/turtlebot_project/Tworld1.world __name:=gazebo __log:=/home/usr/.ros/log/082a1574-fe06-11e8-b44c-d8cb8a119b1a/gazebo-1.log].
log file: /home/sc2/.ros/log/082a1574-fe06-11e8-b44c-d8cb8a119b1a/gazebo-1*.log
[mobile_base_nodelet_manager-4] process has finished cleanly
log file: /home/sc2/.ros/log/082a1574-fe06-11e8-b44c-d8cb8a119b1a/mobile_base_nodelet_manager-4*.log
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  143 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  19
  Current serial number in output stream:  19
terminate called after throwing an instance of 'boost::exception_detail::clone_i             mpl<boost::exception_detail::error_info_injector<boost::lock_error> >'
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
debug3: receive packet: type 96
debug2: channel 1: rcvd eof
debug2: channel 1: output open -> drain
debug2: channel 1: obuf empty
debug2: channel 1: close_write
debug2: channel 1: output drain -> closed
debug1: channel 1: FORCE input drain
debug2: channel 1: ibuf empty
debug2: channel 1: send eof
debug3: send packet: type 96
debug2: channel 1: input drain -> closed
debug2: channel 1: send close
debug3: send packet: type 97
debug3: channel 1: will not send data after close
Aborted (core dumped)
debug3: channel 1: will not send data after close
debug3: receive packet: type 97
debug2: channel 1: rcvd close
debug3: channel 1: will not send data after close
debug2: channel 1: is dead
debug2: channel 1: garbage collecting
debug1: channel 1: free: x11, nchannels 2
debug3: channel 1: status: The following connections are open:
  #0 client-session (t4 r0 i0/0 o0/0 fd 5/6 cc -1)
  #1 x11 (t4 r3 i3/0 o3/0 fd 8/8 cc -1)

[gazebo_gui-2] process has died [pid 1047, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzclient __name:=gazebo_gui __log:=/home/usr/.ros/log/082a1574-fe06-11e8-b44c-d8cb8a119b1a/gazebo_gui-2.log].
log file: /home/usr/.ros/log/082a1574-fe06-11e8-b44c-d8cb8a119b1a/gazebo_gui-2*. log
debug2: client_check_window_change: changed

I also have tried:

roslaunch-deps -v newTurtlebot.launch

i got something like:

The launch file is runnable if i run it directly on the server without any remote connection. But i need remote connection.

processing launch newTurtlebot.launch
processing included launch /opt/ros/kinetic/share/gazebo_ros/launch/empty_world.launch
processing included launch /opt/ros/kinetic/share/turtlebot_gazebo/launch/includes/kobuki.launch.xml
processing included launch /opt/ros/kinetic/share/turtlebot_bringup/launch/includes/kobuki/bumper2pc.launch.xml
ERROR: cannot determine package for [None]
robot_state_publisher [robot_state_publisher/robot_state_publisher]
nodelet [nodelet/nodelet]
depthimage_to_laserscan [depthimage_to_laserscan/depthimage_to_laserscan]
ERROR: cannot determine package for [None]
nodelet [nodelet/nodelet]
turtlebot_bringup [/opt/ros/kinetic/share/turtlebot_bringup/launch/includes/kobuki/bumper2pc.launch.xml]
gazebo_ros [gazebo_ros/spawn_model]
nodelet [nodelet/nodelet]
turtlebot_gazebo [/opt/ros/kinetic/share/turtlebot_gazebo/launch/includes/kobuki.launch.xml]
gazebo_ros [gazebo_ros/gzserver]
gazebo_ros [gazebo_ros/gzclient]
gazebo_ros [/opt/ros/kinetic/share/gazebo_ros/launch/empty_world.launch]
--------------------------------------------------------------------------------
depthimage_to_laserscan robot_state_publisher turtlebot_gazebo nodelet gazebo_ros turtlebot_bringup

So times gazebo started up correctly but all camera plugins did not worked... but most of the time i ended up with the errors above..

So it looks when gazebo started half (edited):

SUMMARY
========

PARAMETERS
 * /bumper2pointcloud/pointcloud_radius: 0.24
 * /cmd_vel_mux/yaml_cfg_file: /opt/ros/kinetic/...
 * /depthimage_to_laserscan/output_frame_id: /camera_depth_frame
 * /depthimage_to_laserscan/range_min: 0.45
 * /depthimage_to_laserscan/scan_height: 10
 * /robot_description: <?xml version="1....
 * /robot_state_publisher/publish_frequency: 30.0
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /use_sim_time: True

NODES
  /
    bumper2pointcloud (nodelet/nodelet)
    cmd_vel_mux (nodelet/nodelet)
    depthimage_to_laserscan (depthimage_to_laserscan/depthimage_to_laserscan)
    gazebo (gazebo_ros/gzserver)
    laserscan_nodelet_manager (nodelet/nodelet)
    mobile_base_nodelet_manager (nodelet/nodelet)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
    spawn_turtlebot_model (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311

process[gazebo-1]: started with pid [27801]
process[spawn_turtlebot_model-2]: started with pid [27806]
process[mobile_base_nodelet_manager-3]: started with pid [27807]
process[cmd_vel_mux-4]: started with pid [27808]
process[bumper2pointcloud-5]: started with pid [27809]
process[robot_state_publisher-6]: started with pid [27810]
process[laserscan_nodelet_manager-7]: started with pid [27816]
process[depthimage_to_laserscan-8]: started with pid [27829]
[ INFO] [1544626552.053122201]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1544626552.053479761]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
debug3: receive packet: type 90
debug1: client_input_channel_open: ctype x11 rchan 5 win 65536 max 16384
debug1: client_request_x11: request from 127.0.0.1 55732
debug2: fd 10 setting TCP_NODELAY
debug2: fd 10 setting O_NONBLOCK
debug3: fd 10 is O_NONBLOCK
debug1: channel 3: new [x11]
debug1: confirm x11
debug3: send packet: type 91
[cmd_vel_mux-4] process has died [pid 27494, exit code 255, cmd /opt/ros/kinetic/lib/nodelet/nodelet load yocs_cmd_vel_mux/CmdVelMuxNodelet mobile_base_nodelet_manager cmd_vel_mux/output:=mobile_base/commands/velocity __name:=cmd_vel_mux __log:=/home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/cmd_vel_mux-4.log].
log file: /home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/cmd_vel_mux-4*.log
[bumper2pointcloud-5] process has died [pid 27495, exit code 255, cmd /opt/ros/kinetic/lib/nodelet/nodelet load kobuki_bumper2pc/Bumper2PcNodelet mobile_base_nodelet_manager bumper2pointcloud/pointcloud:=mobile_base/sensors/bumper_pointcloud bumper2pointcloud/core_sensors:=mobile_base/sensors/core __name:=bumper2pointcloud __log:=/home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/bumper2pointcloud-5.log].
log file: /home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/bumper2pointcloud-5*.log
[mobile_base_nodelet_manager-3] process has finished cleanly
log file: /home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/mobile_base_nodelet_manager-3*.log
[robot_state_publisher-6] process has finished cleanly
log file: /home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/robot_state_publisher-6*.log
[laserscan_nodelet_manager-7] process has finished cleanly
log file: /home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/laserscan_nodelet_manager-7*.log
[depthimage_to_laserscan-8] process has finished cleanly
log file: /home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/depthimage_to_laserscan-8*.log
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/gazebo_ros/spawn_model", line 313, in <module>
    sm.callSpawnService()
  File "/opt/ros/kinetic/lib/gazebo_ros/spawn_model", line 271, in callSpawnService
    initial_pose, self.reference_frame, self.gazebo_namespace)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/gazebo_ros/gazebo_interface.py", line 28, in spawn_urdf_model_client
    rospy.wait_for_service(gazebo_namespace+'/spawn_urdf_model')
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 159, in wait_for_service
    raise ROSInterruptException("rospy shutdown")
rospy.exceptions.ROSInterruptException: rospy shutdown
[spawn_turtlebot_model-2] process has died [pid 27492, exit code 1, cmd /opt/ros/kinetic/lib/gazebo_ros/spawn_model -unpause -urdf -param robot_description -model mobile_base __name:=spawn_turtlebot_model __log:=/home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/spawn_turtlebot_model-2.log].
log file: /home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/spawn_turtlebot_model-2*.log
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  143 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  19
  Current serial number in output stream:  19
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
debug3: receive packet: type 96
debug2: channel 3: rcvd eof
debug2: channel 3: output open -> drain
debug2: channel 3: obuf empty
debug2: channel 3: close_write
debug2: channel 3: output drain -> closed
debug1: channel 3: FORCE input drain
debug2: channel 3: ibuf empty
debug2: channel 3: send eof
debug3: send packet: type 96
debug2: channel 3: input drain -> closed
debug2: channel 3: send close
debug3: send packet: type 97
debug3: channel 3: will not send data after close
debug3: channel 3: will not send data after close
Aborted (core dumped)
debug3: channel 3: will not send data after close
debug3: receive packet: type 97
debug2: channel 3: rcvd close
debug3: channel 3: will not send data after close
debug2: channel 3: is dead
debug2: channel 3: garbage collecting
debug1: channel 3: free: x11, nchannels 5
debug3: channel 3: status: The following connections are open:
  #0 client-session (t4 r0 i0/0 o0/0 fd 5/6 cc -1)
  #1 x11 (t4 r3 i0/0 o0/0 fd 8/8 cc -1)
  #2 x11 (t4 r4 i0/0 o0/0 fd 9/9 cc -1)
  #3 x11 (t4 r5 i3/0 o3/0 fd 10/10 cc -1)
  #4 x11 (t4 r6 i0/0 o0/0 fd 11/11 cc -1)

[gazebo-1] process has died [pid 27801, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -e ode /home/usr/turtlebot_project/Tworld1.world __name:=gazebo __log:=/home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/gazebo-1.log].
log file: /home/usr/.ros/log/95e628a0-fe1d-11e8-b44c-d8cb8a119b1a/gazebo-1*.log