Skip to content

ariadne: pose entities, placed by an outside simulation with no plant integrating them - #1375

Merged
transfix merged 1 commit into
masterfrom
feat/ariadne-entity-pose
Nov 20, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/ariadne-entity-pose

Conversation

@transfix

Copy link
Copy Markdown
Owner

A world entity with the new pose controller is placed by a simulation the world does not run. No plant integrates it and no navigator plans for it. Its chassis is a kinematic box in the scene's physics world, moved to each pose at the next step. So it keeps its archetype's look (the Humvee model or the box look) and its entity_labels: label, casts shadows, is picked, pushes what it meets, and is a foreign agent the other vehicles' navigators steer around. It needs no grid.

This is a step toward WD3's server-dynamic entities: a server simulates, and stock clients (arigl, arigl-web) draw the entities where it says.

What a host or a document writes

  • Per entity: entities.<id>.pose.{x,y,z,heading,pitch,roll,speed,steer,t,ref}, or .matrix (16 numbers, row-major).
    • x, y: the chassis's centre, or its rear axle with ref: rear.
    • z: not given means standing on the ground under it.
    • speed and steer: the wheels' look.
    • t: a timed pose. It is drawn between the last two, a tick behind. A jump (over 20 m, set_pose_jump), a time gone back, or the first timed pose is taken at once.
    • A pose entity that holds still is exactly at rest.
  • Batched:
    • entities.poses, a packed text value: id x y z heading pitch roll speed steer t [rear] a line. It is text, so a relay carries it. pack_poses and parse_poses write and read it.
    • C++ WorldVehicles::set_pose, set_poses(std::span<const entity_pose_update>), pose and set_pose_jump, callable from any thread.
  • A table: world: vehicles: poses: <path>, read by id or by name, with its own packed <path>.poses.
    • An entry naming an archetype (<path>.<key>.archetype, plus name, team, color, color2) spawns a pose entity.
    • Emptying the archetype removes it.
    • A server document publishes the table (server: publish: [fleet]), and each client's own world spawns and places the entities.
  • pycvc: WorldEntities.set_pose(id, x, y, z=, heading=, pitch=, roll=, speed=, steer=, t=, rear_axle=), set_poses(ids, poses) (numpy rows of 2 to 9 numbers), pose(id) and set_pose_jump. list() carries posed and pose.

Also

  • The box look's wheels roll at a pose entity's speed: entity_wheel::spin, drawn as Rz(steer) Ry(spin). The other plants keep spin 0, so their look is unchanged.
  • physics.hash: 1 publishes physics.stats.hash, the world's state hash. It costs a save of the world, so only a check asks for it.
  • A drawn scene (realize_scene) now spawns world: vehicles: start:, as SceneWorld::from_scene already did. Until now arigl never spawned a document's start vehicles.

Tests

  • cvcgl_ariadne_physics / test_vehicle_poses_headless_and_drawn:
    • A scripted track on the keys, untimed then timed, run headless and drawn.
    • The entity is bit for bit where the track says.
    • Both runs reach the same state hash, pinned as 696bba66a89b43ec.
    • No Jolt vehicle exists.
    • The drawing sits on the chassis with the entity's label, and the box wheels are steered and rolled.
  • arigl_pose_entities:
    • arigl snapshot runs src/cvc/tests/data/ariadne_pose_entities.ari offscreen. It has two start entities and one spawned from its table, pitched and rolled.
    • The run prints its hash at physics tick 60: 9e21a383280ccbb7.
    • AriadneWorldVehicles.APoseDocumentsHashIsPinned runs the same document headless and pins the same hash.
  • ariadne_scene_world_test:
    • A track followed exactly (pinned ffffc2632ce76a65), including a matrix pose and a rear-axle pose.
    • Timed interpolation, the jump, a time gone back, and a repeated time.
    • set_poses, the packed value, and set_poses from another thread while the world steps.
    • The table: spawn, identity, refusal, removal, re-spawn. A pose entity pushes a crate, and a restart puts it back.
    • A server document places entities through its published namespace.
  • room_relay_integration_test / AClientsWorldPlacesTheServersPosedEntities:
    • A server document publishes a table, the relay replicates it, and a client's own world spawns and places both entities where the server has them.
    • Emptying an entry's archetype removes the entity from the client's world.
  • pycvc_world_poses: 46 checks.

The pinned hashes are guarded by cap_determinism_cross_platform, as physics_world_test's golden hash is. The arigl test skips on a build without Jolt.

Found on the way (not fixed here)

  • The relay does not replicate a subtree's removal in a published namespace. Neither state-set-tree of the entry nor of its parent reached the client. So the docs say to take a server's entity out by emptying its archetype.
  • room_relay_integration_test does not compile on master with CVC_ENABLE_WS alone, without gRPC: it uses r.grpc unguarded around line 1616.

Checked locally

Linux, GCC 13, Release, Jolt 5.6.0+cvc.6, gRPC and WS on:

  • ariadne_scene_world_test (AriadneWorldVehicles.*, 26 tests)
  • cvcgl_ariadne_physics
  • arigl_pose_entities, 3 of 3 runs on the same hash
  • the relay test, 3 of 3
  • pycvc_world_entities and pycvc_world_poses
  • clang-format 18 clean on the changed lines

… integrating them

A world entity with the new `pose` controller is not driven: something outside
the world says where it is, and the world takes it at the next physics step.
Its chassis is a kinematic box in the scene's physics world, moved to each pose,
so it keeps its archetype's look and label, casts shadows, is picked, pushes
what it meets and is a foreign agent the navigators steer around. It needs no
grid.

- entity_pose: x, y (chassis centre, or rear axle), z (or on the ground),
  heading/pitch/roll, speed and steer for the wheels' look, and a time. Timed
  poses are drawn between the last two, a tick behind; a jump, a time gone back
  or the first timed pose is taken at once. A still pose entity is exactly at
  rest.
- Inputs: entities.<id>.pose.{x,y,z,heading,pitch,roll,speed,steer,t,ref} or
  .matrix; a packed text value of many (entities.poses; pack_poses /
  parse_poses); world: vehicles: poses: <path>, a table read by id or name
  whose entries naming an archetype spawn and remove the entities (a server
  document publishes it and stock clients' worlds draw them); and thread-safe
  WorldVehicles::set_pose / set_poses(span) / pose / set_pose_jump.
- pycvc.WorldEntities.set_pose, set_poses (numpy rows), pose, set_pose_jump;
  list() carries posed and pose.
- The box look's wheels roll at a pose entity's speed (entity_wheel::spin,
  Rz(steer) Ry(spin)).
- physics.hash = 1 publishes physics.stats.hash (the world's state hash).
- A drawn scene now spawns world: vehicles: start: as a headless one does.

Tests: a scripted track followed exactly with its state hash pinned headless
and drawn (cvcgl_ariadne_physics) and in arigl snapshot (arigl_pose_entities,
the same hash as ariadne_scene_world_test's headless run of its document);
timed interpolation, batches, another thread, the table, a server document;
a relay round trip (room_relay_integration_test); pycvc_world_poses.
Documented in ARIADNE.md and ARIADNE_WORLDS.md (WD3).
@transfix
transfix enabled auto-merge (squash) November 19, 2026 22:53
@transfix
transfix merged commit 58cadb9 into master Nov 20, 2026
29 checks passed
@transfix
transfix deleted the feat/ariadne-entity-pose branch November 20, 2026 03:29
transfix added a commit that referenced this pull request Nov 20, 2026
Master's pose entities (#1375) and FL1a met in WorldVehicles' entity, info(), spawn(), clear()
and entities(): both kept. Kinematic overlaps on the grid include pose entities, and a pose
entity is placed at once while a fleet holds its own placing. A fleet's vehicles are driven, so
a fleet entry with controller: pose is refused, and so is a fleet whose archetype's first
controller is pose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant