Agent#
This class describes an agent.
The agent navigates in the environment using a task, a state estimation, a kinematic and a behavior, and a controller.
Agents have a circular shape which should match the shape of their navigation
Behavior
.The role of task and state estimation is to provide goals and environment state (perception) to the behavior.
Agents have a public identifies
id
that is accessible by the other agents’ state estimation and may be passed to their behavior asNeighbor.id
. This identifier may not be unique (e.g., may be used to identifies groups of agents).Agents runs their update at the rate set by
control_period
even if the world is updated at a faster rate.Constructs a new instance.
- Parameters:
radius – The radius of the agent
behavior – The behavior
kinematics – The kinematics
task – The task
estimation – The estimation
control_period – The control period
id – The public identifier
Actuate the current agent control command.
- Parameters:
dt – The time step
Adds a tag.
- Parameters:
tag – The tag
Dumps the object to a YAML-string.
- Returns:
The YAML representation
- Return type:
Gets the last command.
- Returns:
The controller.
Determines if the entity has been in collision at least once since the given time.
- Parameters:
time – The time
- Returns:
True if been in collision since, False otherwise.
Determines if the agent has been stuck since a given time.
- Parameters:
time – The time
- Returns:
True if been stuck since, False otherwise.
Load a agent modulation from a YAML string.
- Returns:
The loaded agent or
None
if loading fails.- Return type:
Agent| None
Removes a tag.
- Parameters:
tag – The tag
Returns the json-schema
- Returns:
json-schema
- Return type:
dict[str, typing.Any]
- Type:
The last actuated command.
the actuated command is always kinematically feasible
- Type:
Angular speed
- Type:
The navigation behavior.
- Type:
The color of the agent.
A valid CSS color to fill the agent in the UI or empty to use the default color.
- Type:
The control period
-
The navigation controller.
- Type:
Whether the agent is enabled.
disabled agents are ignored in the simulation.
- Type:
The agent public identifier
- Type:
Returns whether the task is done and the control is idle.
- Returns:
False if it has an active task or if the control is running
-
The kinematics.
- Type:
The last command.
- Type:
Returns the last collision time
- Type:
Orientation
- Type:
The current pose.
- Type:
Position
- Type:
The agent radius
-
The state estimation.
-
A set of tags used to label the agent.
Tags are used to add meta-information about an agent, for instance when it gets generated by a scenario.
- Type:
The task.
- Type:
The time since the agents has been stuck.
- Type:
The current twist.
- Type:
The type of the agent.
The agent type should not used by the neighbors state estimation. It is mainly used internally to draw the agents in the UI.
- Type:
Velocity