Java Gazebo

The java gazebo project is essentially an implementation of gazebo transport in java, and is used by the java simulation WPILib to connect to the gazebo plugins. this was originally written by Alex Henning in 2014 when the FRCSim project was started. it was based off of the PyGazebo project, which is an implementation us gazebo transport in python.

Note: it would be cool to see the python FRC teams us PyGazebo to implement FRCSim for Python.

the first thing you should know is that it’s not great. originally it was hard coded to only work on local host. Now, it does support connecting to a remote master. It is full of hacks and should probably be ironed out fully.

Notes for using it

if you need to connect to a remote master (such as if you have gazebo running in a linux vm), you may do so by setting two environment variables.

These are intended to behave the same as ROS_MASTER_URI and ROS_IP. info on those can be found here. GAZEBO_MASTER_URI should be set to the URI where gazebo, or the gzserver process, is running. GAZEBO_IP should be set to the IP address of the machine you are trying to run a Java Gazebo program from. Java wpilib programs and SimDS are both java gazebo programs. Here’s how to go about doing that, but make sure to change the example addressed to your specific addresses.

Note: unless you know better, use 11345 as the port for the master URI.

//windows
$> set GAZEBO_MASTER_URI=172.23.1.30:11345
$>set GAZEBO_IP=172.23.1.53

//linux or mac
$>export GAZEBO_MASTER_URI=172.23.1.30:12345
$>export GAZEBO_IP=172.23.1.53

These environment variables are read by the java gazebo code, and if they are wrong your programs will not work.