$ show cyberbotics/webots
Webots is an open-source robot simulator providing a complete environment for modeling, programming, and simulating robots. It consists of a C++ Qt-based main application (src/webots) that manages 3D rendering via the custom WREN engine (src/wren), physics simulation via a forked ODE engine (src/ode) with fluid dynamics extensions, and a multi-language controller API (C, C++, Python, Java, MATLAB) in src/controller. The repository includes a vast library of reusable robot models, sensors, actuators, objects, vehicles, and environments under projects/, as well as extensive documentation (docs/) and a web-based streaming interface (resources/web/wwi). The architecture is modular: the simulation world is defined in VRML-based .wbt files, robots are instantiated from PROTO definitions, and controllers run as separate processes communicating via shared memory. Webots supports ROS integration, SUMO traffic simulation, and OpenStreetMap import. The project is actively maintained with comprehensive CI/CD, test suites, and packaging scripts.
The LLM identified 5 files worth highlighting for reuse:
Core C API implementation for robot controllers. Provides functions for initializing robot, stepping simulation, reading sensors, actuating motors, and managing communication between the controller process and the Webots simulator via shared memory. This API is the foundation for all controller bindings (C++, Python, Java, MATLAB) and is a well-abstracted, reusable interface for any robot simulation.
Scene graph management for the custom WREN rendering engine. Handles hierarchical transforms, lights, cameras, renderables, and post-processing effects. Demonstrates a clean separation of concerns with a node-based architecture (Transform, Renderable, Light) that is reusable for any 3D application requiring a lightweight OpenGL engine.
Main entry point for the Webots Web Interface (WWI). Implements a WebSocket-based streaming client that receives 3D scene updates and renders them using WebGL. Handles robot window overlays, simulation controls, and user interaction. This component is a standalone, reusable web-based viewer for any simulation that can output a stream of 3D scene changes.
PROTO definition of the e-puck robot, a widely used educational robot. This file defines the robot's geometry, sensors (distance, camera, accelerometer), actuators (motors, LEDs), and physics properties. It is a prime example of how Webots encapsulates complex robot models into reusable, parameterizable components that can be instantiated in any world with different configurations.
Core implementation of the immersion (buoyancy) fluid dynamics kernel for the ODE physics engine. Calculates buoyant forces and torques on immersed bodies using a volume-based approach. This is a specialized, reusable physics extension that can be applied to any rigid-body simulation needing fluid interaction, demonstrating advanced computational geometry integration.