Ask Your Question
2

Godot game engine as ROS node

asked 2018-07-30 15:56:16 -0500

yurumi gravatar image

updated 2018-07-30 17:16:13 -0500

jayess gravatar image

Hi all,

Godot is a very nice open source game engine. I thought about making a Godot program a ROS node. It could be used as 2D/3D physics engine and for visualization โ€“ plus a lot of logic can be easily implemented.

Although the native programming language (GDScript) is python-like, it is probably necessary to implement a new client library. Alternatively there is a mechanism called GDNative (see this slightly outdated article) with which you can use shared libraries in your Godot program.

What do you think? Is it possible with reasonable effort? What would be the way to go?

Cheers, Thomas

edit retag flag offensive close merge delete

Comments

There are C++ bindings in Godot: http://docs.godotengine.org/en/3.0/de... (not sure this is the right documentation page)

VictorLamoine gravatar imageVictorLamoine ( 2018-08-01 03:00:37 -0500 )edit

You are right, this seems to be a feasible way. Godot is super easy to compile (in contrast to gazebo, at least on arch) โ€“ maybe it's just convincing scons to build ROS stuff...

yurumi gravatar imageyurumi ( 2018-08-02 16:45:59 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-07-31 12:55:03 -0500

lucasw gravatar image

Every good 3D engine deserves a ros node, it is a lot of effort but it is usually easy to start small and add features gradually. I'd like to try it out if you get it working.

If Godot isn't available as a Ubuntu deb install it will likely cut down the potential number of users.

A simple node that can instantiate objects within the godot program via a ros service call is a good starting point. If the objects are physically simulated then add tf output: query the engine for the current position of the object then update a tf frame (with the frame id specified in the spawning service call).

For visualization supporting all or most of the features of the Marker type is very useful, so a Marker can be published in ros and appears in the godot rendering approximately like it does in rviz (but with whatever extra graphical flair godot adds).

From there it's nice to be able to have the engine render to texture and then publish the texture as a ros image. Field-of-view and position of the camera ought to be able to be controlled via CameraInfo and tf frames inputs, and any number of cameras can be supported.

urdf-to-godot translation would be good to have later.

The scripting language would eventually need the ability to subscribe and publish on topics for at least the basic std_msgs types. This sounds harder than any of the above, but perhaps for can be done in a crude/hard-coded/hacky way initially and made more generic and capable later.

edit flag offensive delete link more

Comments

Thanks for the comment. I had a look at the roscpp/rospy/ros* client library sources and it seems that it would be quite a lot of effort to reimplement it in GDScript. The suggestion of @VictorLamoine (see comment above) seems to be very sensible (using the C++ bindings of Godot).

yurumi gravatar imageyurumi ( 2018-08-02 16:39:24 -0500 )edit

https://godotengine.org/article/beta-... indicates python-godot integration already exists as well. I downloaded the prebuilt godot for Linux and it was neat the way it ran and downloaded an example (though slowly) and ran it, so it isn't that big of a hurdle for users.

lucasw gravatar imagelucasw ( 2018-08-02 18:01:00 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2018-07-30 15:56:16 -0500

Seen: 316 times

Last updated: Jul 31 '18