set_relation
Record or remove spatial relationships between entities in the world model to establish topological links like on, inside, or next_to without changing entity poses.
Instructions
Record or remove a spatial relationship between two entities. Actions: add, remove. Relations: on, inside, next_to, above, below, near, contains, occluded_by, connected_to, facing, holding, part_of, custom. This mutates the relation graph only, not entity poses. Returns {ok, relation}. Use set_relation instead of update_entity when establishing topological links (on, inside, contains) rather than setting entity coordinates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Action to perform (default: add) | |
| offset | No | Relative offset vector from source to target | |
| project | No | Optional project identifier | |
| distance | No | Optional measured distance between entities | |
| metadata | No | Additional relation metadata | |
| relation | Yes | Type of spatial relation | |
| source_id | Yes | Source entity ID | |
| target_id | Yes | Target entity ID | |
| bidirectional | No | If true, automatically sets inverse relationship on target |