ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Godot game engine as ROS node

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

yurumi gravatar image

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

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 image VictorLamoine  ( 2018-08-01 03:00:37 -0600 )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 image yurumi  ( 2018-08-02 16:45:59 -0600 )edit

https://github.com/ymd-stella/godot_r... is a ros godot node, I'll try it out and update later.

lucasw gravatar image lucasw  ( 2020-05-04 11:07:59 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
2

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

lucasw gravatar image

updated 2020-07-03 12:53:42 -0600

godot_ros_pcviz is a good starting point- it can be easily modified to subscribe to something other than a point cloud or publish out of the _process callback.

https://github.com/lucasw/godot_ros_p... has my changes forked from https://github.com/ymd-stella/godot_r... - possibly the original author will merge my PRs and their repo could be the primary place to go.

Don't use the docker build method instructions in the readme, just clone the repo into your catkin workspace with the right branch and do a git submodule update --init --recursive then build normally with catkin, then import the project from devel/lib/godot_ros_pcviz/project.godot into godot.

The camera has no controlers, so if you publish a point cloud in you'll just see it from the one angle (I'll likely add a camera controller similar to the one in the godot 3D window next).


Old answer:

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 image yurumi  ( 2018-08-02 16:39:24 -0600 )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 image lucasw  ( 2018-08-02 18:01:00 -0600 )edit
2

answered 2022-04-11 18:57:01 -0600

flynneva gravatar image

Late to the party but I built a ROS 2 + Godot package called godot_ros if you want to check that out. I am planning on upgrading it to use the new GDExtensions API for integrating C++ libraries with Godot 4.0 once it is more stable.

edit flag offensive delete link more

Comments

Nice work! I have a somewhat working prototype for Godot as GDExtension. Maybe we should join forces?

yurumi gravatar image yurumi  ( 2022-04-17 16:51:06 -0600 )edit

Question Tools

3 followers

Stats

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

Seen: 2,226 times

Last updated: Apr 11 '22