Audience

Verification level

Configuration only, with an important runtime limitation. Both declarations compile successfully. This does not start PyBullet. Sensor support depends on the chosen backend and adapter. FastSim's current physical runtime projection does not lower light entities, so this demo does not claim that the light can run natively.

Files

  • run.yaml declares one RGB camera and one distant light.
  • main.py verifies the component defaults merged into both instances.
  • Sensor manifest describes camera defaults and the portable RGB channel.
  • Light manifest describes a backend-neutral light.

Sensor manifest, line by line

yaml
schema: fastsim-component/1
id: sensor://fastsim/component-demo-camera # Stable sensor identity.
version: 1.0.0
kind: sensor                               # Legal under scene.sensors.
defaults:
  params:
    width_px: 1280                         # Default image width.
    height_px: 720                         # Default image height.
    modalities: [rgb]                     # Default output selection.
semantics:
  sensor_type: camera                      # Portable sensor category.
  channels:
    rgb:
      dtype: uint8                         # Channel element type.
      shape: [720, 1280, 3]               # One RGB image: height, width, channels.
      unit: pixel                          # Value interpretation.
      frame: sensor                        # Coordinate frame label.
variants:
  '*': {}                                  # Backend-neutral declaration.

Defaults reduce repeated Run configuration. This demo accepts the manifest's 1280×720 RGB defaults without repeating them in the Run. An instance may still override params; if the effective shape is part of an observation contract, keep channel metadata and parameter overrides consistent.

Light manifest, line by line

yaml
schema: fastsim-component/1
id: light://fastsim/component-demo-sun    # Stable light identity.
version: 1.0.0
kind: light                               # Legal under scene.lights.
defaults:
  params:
    light_type: distant                   # Directional/distant source intent.
    intensity: 3000.0                     # Default intensity value.
    color_rgb: [1.0, 0.95, 0.85]         # Warm RGB color.
variants:
  '*': {}                                 # Declaration compiles for every backend.

'*' means the configuration is backend-neutral. It does not promise that every runtime adapter implements that kind. Capabilities and native acceptance must still be verified. In the current FastSim runtime, light lowering is not implemented.

run.yaml, line by line

yaml
schema: fastsim/2
name: sensor-and-light-components
backend: pybullet

runtime:
  physics_hz: 60
  control_hz: 30
  seed: 106

scenario:
  scene:
    sensors:
      overview:                           # Local ID: sensors.overview.
        use: sensor://fastsim/component-demo-camera
        pose:
          xyz_m: [1.2, -1.2, 1.0]       # Camera position in world metres.
          quat_xyzw: [0.0, 0.0, 0.0, 1.0]
    lights:
      key:                                # Local ID: lights.key.
        use: light://fastsim/component-demo-sun
        pose:
          xyz_m: [0.0, 0.0, 2.5]
          quat_xyzw: [0.0, 0.0, 0.0, 1.0]

Both entities omit params, so their effective values come from component defaults.

What main.py proves

The program compiles through public load_project, finds both resolved components, and asserts their kinds and wildcard variants. It then checks the effective camera and light defaults in ExecutionPlan.entities.

It deliberately does not call fastsim.app: doing so would misrepresent the current light runtime support.

Run it

bash
cd demo/components/06_sensor_and_light_components
fastsim config validate run.yaml --json
fastsim config expand run.yaml
fastsim config explain run.yaml scenario.scene.sensors.overview.params.width_px
fastsim config explain run.yaml scenario.scene.lights.key.params.intensity
fastsim config lock run.yaml --output run.lock.yaml
fastsim config verify-lock run.lock.yaml --json
python main.py

Expected output

text
Compiled declaration: sensors.overview (camera, 1280x720 RGB)
Compiled declaration: lights.key (distant, intensity=3000.0)
Runtime note: light lowering is not implemented; this case is compile-only.

Common errors

  • A sensor or light must be placed in its matching scene group.
  • A wildcard variant is not proof of native runtime support.
  • Camera pose alone does not guarantee it looks at the subject; orientation and convention must be verified with a native rendered frame.
  • Manifest defaults and Run params are deep-merged; inspect config expand to see the effective result.
  • Do not advertise a native light pass until runtime lowering and backend acceptance are implemented and tested.

Next

Previous: environment component · Next: deformable and fluid components