Run Gazebo headless on AWS and render locally with the gzclient

asked 2019-02-26 16:11:39 -0600

mehdi gravatar image

updated 2019-02-26 16:16:59 -0600

I installed gazebo on an AWS instance to run faster simulations. However, I am struggling with my setup. For doing a small test, I start an empty world on the AWS server

roslaunch gazebo_ros empty_world.launch headless:=true gui:=false

Then on my laptop I run:

ssh -L 11345:localhost:11345 ubuntu@aws_ip

this basically tunnels my localhost:11345 to the localhost:11345 of the aws computer. I then run

gzclient --verbose

on my laptop. The client starts, displays an empty gazebo window then dies.

Gazebo multi-robot simulator, version 9.0.0
Copyright (C) 2012 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: 192.168.1.228
[Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call


[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/user_camera/pose, deleting message. This warning is printed only once.
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
Aborted (core dumped)

There is one minute or so between the first warning and the second one. What is the problem here? Was gazebo never meant to be run this way (with remote servers at least) Does the gzclient and the gzserver share so much data that it is not practical to do it through internet? I checked with nethogs and gzclient barely pulls 40 KB/sec (way less than my internet bandwidth)

1679 mehdi    gzclient                wlp4s0      5.115      39.034 KB/sec

If so, what would be an alternative? I don't consider VNC to be an alternative as it probably will be quite laggy too

I am using Ubuntu 18.04 with ROS Melodic and Gazebo 9

edit retag flag offensive close merge delete

Comments

Just a comment. I've tried to use Gzweb to do something similar. You run the Gzweb server on your simulation machine and connect to the IP:port from your client. I was able to get it running - couldn't render models correctly but I think I didn't set up the environmental variables properly. Might be worth looking into.

josephcoombe gravatar imagejosephcoombe ( 2019-03-01 18:35:26 -0600 )edit
1

That is what I ended up doing, works really nice :D

mehdi gravatar imagemehdi ( 2019-03-02 05:10:17 -0600 )edit

I've done this but using VPN as shown here https://www.youtube.com/watch?v=ecMlx.... It's another way if you want to try.

arifrahman gravatar imagearifrahman ( 2019-06-19 22:41:10 -0600 )edit