Skip to content

State

Immutable snapshots and commands exchanged between the engine and your code.

state

Command dataclass

Command(v=0.0, omega=0.0)

Velocity command emitted by agents/controllers for a B-bot.

v class-attribute instance-attribute

v = 0.0

omega class-attribute instance-attribute

omega = 0.0

as_tuple

as_tuple()
Source code in src/hivebr/state.py
def as_tuple(self) -> tuple[float, float]:
    return (self.v, self.omega)

RobotState dataclass

RobotState(
    id,
    x,
    y,
    theta,
    v=0.0,
    omega=0.0,
    type="differential",
    radius=0.1375,
    battery=100.0,
    goal=None,
)

Immutable snapshot of a single B-bot at a given timestep.

goal is the robot's current waypoint as a tuple, either (x, y) or (x, y, theta); None when the robot has no active target.

id instance-attribute

id

x instance-attribute

x

y instance-attribute

y

theta instance-attribute

theta

v class-attribute instance-attribute

v = 0.0

omega class-attribute instance-attribute

omega = 0.0

type class-attribute instance-attribute

type = 'differential'

radius class-attribute instance-attribute

radius = 0.1375

battery class-attribute instance-attribute

battery = 100.0

goal class-attribute instance-attribute

goal = None

position property

position

pose property

pose

goal_position property

goal_position

FleetState dataclass

FleetState(t, robots)

Immutable snapshot of the whole fleet at a given timestep.

t instance-attribute

t

robots instance-attribute

robots

ids

ids()
Source code in src/hivebr/state.py
def ids(self) -> tuple[int, ...]:
    return tuple(self.robots.keys())