Home | Tutorials | Wiki | Issues
Ask Your Question

Why not gazebo in python?

asked 2017-08-07 02:38:34 -0500

alpha gravatar image

I wonder that why i can't find any wrapper module of gazebo into python(with boost.Python) so that one can

  • import the python module
  • setup the world
  • load sdf or urdf dynamically
  • run the world step by step

tips: I have tried the existed code pygazebo, but it is just a topic client in python, not really a python wrapper of gazebo(including server/physics and so on).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-07 05:22:42 -0500

hamzamerzic gravatar image

updated 2017-08-07 05:24:04 -0500

I actually did this for one my own applications. The way I did it though is not by wrapping a gazebo plugin, since I am not sure if that is even possible, but instead by wrapping a C++ library that is in charge of passing messages directly to Gazebo with the ignition transport library. On the Gazebo end I have a world plugin that handles these messages and forwards the callbacks. The C++ library is wrapped using Boost Python.

It would be interesting to know if there is a way to directly wrap Gazebo code; either a Gazebo plugin or any library able to obtain the world pointer dynamically.

edit flag offensive delete link more



Thank you for your time! expect directly wrap Gazebo code, there are two compromise solution: 1. wrap a message node(as you and pygazebo do) 2. wrap a gazebo stand alone program. both are not general solutions. I did 2 for one of my own applications, but i came up with ImportError when import the module i wrapped (i tried advice in https://stackoverflow.com/questions/11643666/python-importerror-undefined-symbol-for-custom-c-module, but it seems not work), do you have experience about this?

alpha gravatar imagealpha ( 2017-08-07 20:29:28 -0500 )edit

I have solved the ImportError.

alpha gravatar imagealpha ( 2017-08-07 21:26:34 -0500 )edit

I am glad you solved the issue! Could you please post more details here on how you made it work - from the standalone gazebo program, to the python issues that you mentioned. I know a lot of people (including me) will find that useful. Thank you very much! EDIT: I would be particularly interested to see how you managed to get the world pointer from a standalone program, so just a small snippet would be more than helpful! @alpha

hamzamerzic gravatar imagehamzamerzic ( 2017-08-08 08:29:04 -0500 )edit
Login/Signup to Answer

Question Tools



Asked: 2017-08-07 02:38:34 -0500

Seen: 216 times

Last updated: Aug 07 '17