Javascript/NodeJS Scripting of Gazebo (python also?)
This might be good for a FAQ: (at least for beginners here like me):
The tutorials list a number of ways JS/NodeJS programs can pub/sub to Gazebo. But it also hints at more API functions that can be reached: e.g Reading SDF model information:
http://gazebosim.org/tutorials?tut=gazebojs_models&cat=gazebo
What things that can normally only be done via C++ plugins can be also be done with JS?
- Events subscription?
- Implement a plugin (e.g. sensor) [probably not, since it needs to be an .so)
- System, World, Object API?
- Grabbing Sensor Rays (multiRays) and exploring intersections with world objects?
Same question for Python.
[I certainly realize the performance will not be the same as a in-process library written in C++, but for some use cases, this functionality will be fine and lead to faster prototyping]
Asked by DoktorG on 2016-06-03 09:04:55 UTC
Answers
The javascript client side library is able to use gazebo transport to send and receive the protobuf messages. So you could subscribe to messages and communicate with a (custom) plugin. You cannot directly use the C++ API's for sytem, world and objects. There should be something running within the simulator to modify the state.
If you would like to use python, take a look at this library: https://github.com/jpieper/pygazebo
Asked by reinzor on 2016-06-13 02:32:39 UTC
Comments