How flynneva/godot_ros works
Project type and purpose
• This is a C++ GDExtension plugin (“godot_ros”) whose purpose is to bridge the Godot game engine and ROS 2. It hooks into Godot’s MainLoop/SceneTree lifecycle, initializes a ROS 2 context, and lets Godot nodes act as ROS 2 nodes with publishers/subscribers and data‐type conversions.
File structure
• Top level
• SConstruct – build script for compiling the extension
• requirements.txt – Python deps (used by CI or build tooling)
• .github/workflows/build_test.yml – CI build/test pipeline
• /godot_ros
• node.hpp, scene_tree.hpp, register_types.hpp – C++ headers defining the extension’s core classes and registration hooks
• image.tpp, string.tpp, etc. – template implementations for converting Godot types to ROS messages
• src/
• scene_tree.cpp – overrides Godot’s SceneTree initialization/finalization to call rclcpp::init()/shutdown()
• node.cpp – wraps rclcpp::Node inside Godot::Node derivatives
• register_types.cpp – binds the new types to Godot via GDExtension registration
• demo/
• godot_ros.gdextension – GDExtension manifest listing the compiled library and its ROS dependencies
• *.gd, *.tscn, project.godot – example Godot project and scripts showcasing how to publish/subscribe
Key insights from the README
• Core concept: intercept SceneTree lifecycle, run ROS 2 init/shutdown
• Every Godot node can become a ROS 2 node by embedding a shared_ptr<rclcpp::Node>
• Type conversions between Godot types (String, Image, Array) and ROS messages (std_msgs::msg::String, sensor_msgs::msg::Image, PointCloud)
• Build process driven by SCons, CI workflow shows dependencies and platform targets