AuroraRoboticsLab / GodotRobot

Simple early proof of concept C++ robot simulation using Godot.
The Unlicense
3 stars 0 forks source link

GodotRobot

Simple early proof of concept C++ robot simulation using Godot 4.3's GDExtension interface.

How to Host a Server

To host the demo from a Linux server, run (at minimum) the following command:

./Demo_GodotRobot.x86_64 --headless --host --address=YourLocalIPAddress

Here are the flags available for use:

Build Process

To build this, start by downloading the Godot 4.3 engine for your machine.

You also need Blender 3, at least version 3.0 (Blender 4+ does not seem to work). Attach the Blender install path to Godot in Godot Engine -> Editor -> Settings -> FileSystem -> Import -> Blender 3 Path. I set mine to "/usr/bin", the default on Ubuntu.

You'll also need build tools:

sudo apt-get install scons build-essential g++

Check out MiningRobot first:

git clone https://github.com/AuroraRoboticsLab/MiningRobot
cd MiningRobot

Inside the MiningRobot/ folder, check out this repo:

git clone https://github.com/AuroraRoboticsLab/GodotRobot
cd GodotRobot

Now prep the correct version of the godot-cpp GDExtension interface library inside GodotRobot:

git clone -b 4.3 https://github.com/godotengine/godot-cpp
cd godot-cpp
git checkout 4.3
cd ..

Build godot-cpp (the GDExtension interface) and this extension by issuing this from inside GodotRobot/:

scons

(Or you can specify a "platform=linux" or "platform=windows" string.)

Building will take a few minutes the first time, as it builds the whole godot-cpp interface, but it will be very fast after that.

Finally, you can try out the example project by running

Godot-v4.3-stable.exe demo/project.godot

The standard edit loop is:

Terrain Nodes

The terrain nodes let you represent static or dynamic terrains. They can be nested in other Node3Ds or offset around, but should not be scaled.

TerrainStatic256 stores a 256x256 heightmap, normally loaded from an EXR float height image scaled to -10000 meters (black) to +10000 meters (white).

TerrainSim stores a dynamic mineable 256x256 heightmap. It inherits from TerrainStatic256.

Debug Clues

When you start the Godot engine, you'll get errors like this if your version of godot-cpp doesn't match your engine version:

ERROR: Attempt to get non-existent interface function: object_has_script_method.

This is caused by godot-cpp being 4.3, but engine being 4.2. Check out the right version and rebuild godot-cpp.

ERROR: Cannot load a GDExtension built for Godot 4.3.0 using an older version of Godot (4.2.2).

This is caused by compiling for 4.3, but engine being 4.2. Upgrade your engine.