ROS/Gazebo Integration

Discussion in 'Modeling' started by lakehanne, Aug 31, 2016.

  1. Hi,

    Thank you for this great physics engine. I am modeling some soft-robots using ROS's URDF framework.

    I was wondering if MuJoCo ports over easily into gazebo or rViz. If it does, could you please provide the link to the documentation?

    In addition, I had trouble loading the shared object library libmujoco140.so when I tried to run the humanoid robot example. I got

    lex@lex:~/Downloads/mjpro140/bin$ ls
    compile libglewegl.so libglew.so libmujoco140nogl.so mjkey.txt simulate
    derivative libglewosmesa.so libglfw.so.3 libmujoco140.so record test
    lex@lex:~/Downloads/mjpro140/bin$ simulate ../model/humanoid.xml
    simulate: command not found
    lex@lex:~/Downloads/mjpro140/bin$ ./simulate ../model/humanoid.xml
    ./simulate: error while loading shared libraries: libmujoco140.so: cannot open shared object file: No such file or directory
    lex@lex:~/Downloads/mjpro140/bin$ cp libmujoco140​

    The library is in the same folder I am running `./simulate` from but it says it's not available. Would appreciate your help.

    Thank you!
     
    Last edited: Aug 31, 2016
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You need LD_LIBRARY_PATH, or otherwise tell the dynamic linker to look for shared libraries in the directory where libmujoco is.

    Integration with Gazebo and related environments is possible in principle, but hasn't been done. If you want to do it yourself, you have to read the MuJoCo and Gazebo documentation and figure out how to put them together. MuJoCo is an SDK and is designed to be integrated in such environments. An existence proof is MuJoCo HAPTIX which has similar functionality to Gazebo; it is essentially a GUI and socket communication shell around MuJoCo Pro. However Gazebo was designed around ODE which has many differences from MuJoCo, and even though OSRF has been working to provide a cleaner physics abstraction, I don't know how feasible it is for someone other than OSRF to integrate a new physics engine in Gazebo. Maybe you should try and let us know :)

    We actually did some brainstorming with OSRF along these lines a couple of years ago, because DARPA asked us if we can jointly develop a tool that combines MuJoCo physics and Gazebo GUI and communications, for the purposes of the HAPTIX program. We concluded that there are too many technical differences, plus the incompatible business models, and it didn't seem that we could do it within the time and budget limits. So the HAPTIX program provided both simulators to the performer teams, with user-facing socket API that is standardized modulo some simulator-specific extensions. Eventually DARPA decided to use MuJoCo for official evaluation of team performance, but both options are still supported.

    Note also that there is a difference between ROS+URDF and Gazebo. MuJoCo already loads URDF models. It should be straightforward to turn it into a ROS node, in the same way you can turn any other C library into a ROS node. You don't need Gazebo for that.
     
    Kyokushin and lakehanne like this.
  3. Thank you for the information. I will see where this goes.