Monty.Frameworks.Models.MotorSystemState.AgentState (ExTbpMonty.Core v0.1.0)

Copy Markdown View Source

Where one agent is, how it is turned, and where its sensors are.

Mirrors tbp/monty/frameworks/models/motor_system_state.py::AgentState. The sensors are keyed by sensor id, and their positions and rotations are relative to this agent's — which is what lets an environment move an agent without rewriting every sensor.

Summary

Functions

Where the sensor sensor_id is, in the world.

Types

sensor_id()

@type sensor_id() :: atom() | String.t()

t()

@type t() :: %Monty.Frameworks.Models.MotorSystemState.AgentState{
  position: [float()],
  rotation: Monty.Geometry.Rotation.t(),
  sensors: %{
    optional(sensor_id()) =>
      Monty.Frameworks.Models.MotorSystemState.SensorState.t()
  }
}

Functions

sensor_pose(agent, sensor_id)

Where the sensor sensor_id is, in the world.

The sensor's own offset is relative to the agent, so its place is the agent's position with that offset turned: agent.position + qt.rotate_vectors(agent.rotation, sensor.position), and its rotation the two rotations multiplied (sensor_modules.py:565-570).

Monty writes those two lines twice — once in CameraSM.update_state, once in the transform-pipeline SensorModule.update_state — and the port keeps one copy, because it is one rule (docs/monty-differences.md §2.12).