Esacode

Docs / Blocks / Simulation

3D scene

Says which 3D model each object uses and which trajectory it follows, for the 3D view and the Render block.

Runs on a worker (Python) Simulation Version 1.0 Code you can open and adapt

How it works

Add one row per object: its name, its model (a shape such as quadrotor, pad, box, sphere, cylinder or arrow, or the name of a 3D file connected to Models: GLB, glTF, OBJ, STL, PLY) and its trajectory: a table connected to Trajectories (CSV, TSV, JSON or JSON lines, with the columns you name: time, x, y, z, and optionally roll, pitch, yaw or a quaternion), an object of a connected scene (scene:drone, for example from the Landing sweep), a fixed position, or live positions streamed while a run goes on (live).

A table holding several objects can be filtered: tracks.csv#id=robot1. The output is one scene, with the model files, for the 3D view and the Render block.

Inputs

InputTakesWhat it is
Models
models
Files
glb, gltf, obj, stl, ply
3D files, for example from a Library or Dataset block Optional. Takes several connections.
Trajectories
tracks
Anything
csv, tsv, json, jsonl
Tables of positions over time, or a scene with recorded runs Optional. Takes several connections.

Outputs

OutputGivesWhat it is
Scene
scene
3D scene
json, glb, gltf, obj, stl, ply
scene.json (esasim.scene/1) and the model files it names
Live telemetry
telemetry
Live telemetryWhat the block sends while it runs, for views such as Chart or 3D view.

Settings

SettingDefaultWhat it does
Objects
objects
[{"name":"drone","model":"quadrotor","trajectory":"scene:drone","color":"#20242c"},{"name… Model: a shape or a file name. Trajectory: a file name (with #column=value to keep some rows), scene:<object> for an object of a connected scene, live or live:<channel> for positions streamed while a run goes on, or empty for a fixed position. Columns: the names of the time, x, y, z columns in the table, then roll, pitch, yaw (or qx, qy, qz, qw) if it has them.
Up axis of the data
up
z
One of: z, y
Units of positions
units
m
One of: m, cm, mm
Angles in
angles
degrees
One of: degrees, radians
Environment
environment
outdoor
One of: outdoor, studio, night
Title
title
empty

Where it runs

On one of your computers with the EsaSim worker: Any worker.

In its code, settings are ctx.params["key"], inputs ctx.inputs["id"] and outputs ctx.output("id", "name.ext"); see Custom blocks.

More in Simulation