liveBook · Manning

Entity component system

As explained in Robotics for Programmers

An entity component system is a software architecture that represents objects as entities with composable data components and processes them with systems.

An entity component system (ECS) represents a simulated world as entities, attaches composable data components to them, and lets systems process that data. In Gazebo, an entity may be a model, sensor, actuator, or light; components hold properties such as pose, geometry, mass, and color. section 5.4

A robotics ECS divides simulation responsibilities into:

  • Entities: unique identifiers for simulated objects. section 5.4
  • Components: data describing entities, including names, poses, geometry, mass, and color. section 5.4
  • Systems: plugin algorithms that read components and write effects or updated state back to entities. section 5.4
  • Entity Component Managers: stores that server and GUI plugins use to access their respective ECS state. section 5.4

Gazebo simulation step

A simulation loop runs each system before physics, updates the physics engine, then runs systems afterward. Systems communicate by changing components rather than embedding every robot assumption in the simulator. section 5.4

Figure 5.10 The Gazebo simulator has a modular architecture built around an Entity Component System (ECS), separating the headless simulation server from the graphical client while synchronizing entities, components, and plugin systems through the Gazebo transport layer. [7]
CH05 Fxx bihlmaier gazebo architecture

Use the architecture diagram to trace the modular separation between Gazebo’s headless server, GUI client, plugins, ECS managers, and transport layer. section 5.4

while True:
  for system in systems:
    system.pre_update(ecm)
  physics_engine.update(ecm)
  for system in systems:
    system.post_update(ecm)
  sim_time += time_step

Use the pseudocode to inspect the ECS simulation loop from system updates through physics integration and advancing simulation time. section 5.4

How Robotics for Programmers covers it

How deep it goes
Defines entities, components, systems, managers, synchronization, and update ordering, but does not detail component storage beyond Python-like pseudocode.
Examples
Uses Gazebo models, sensors, actuators, lights, component dictionaries, server-client architecture, and a physics-stepped simulation loop.
What you can do after
Operate/configure Gazebo simulations by organizing simulated objects as components and extending behavior through plugins.
How it connects
Connects Gazebo with plugins, the Entity Component Manager, physics engines, simulation loops, ROS, and the Gazebo transport layer.

Also explained in

Compare how 2 books explain entity component system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Robotics for Programmers. The section links point to the parts of the book it draws on.