swarmsim.agent.control.WaypointPIDController#

PID-based Waypoint Controller class.

class swarmsim.agent.control.WaypointPIDController.WaypointPIDController(agent=None, parent=None, sensor_id=None, speed_pid={'d': 0.0, 'i': 0.0, 'imax': 0.0, 'max': None, 'min': None, 'p': 0.0}, steer_pid={'d': 0.0, 'i': 0.0, 'imax': 0.0, 'max': None, 'min': None, 'p': 0.0}, static_waypoint=None, **kwargs)[source]#

A controller which generates unicycle control inputs (\(v, \omega\)) to follow a waypoint.

For PID arguments, see PID.

Parameters:
  • sensor_id (int, default=None) – The index in agent.sensors of the sensor to query for a waypoint. If None, then static_waypoint is used.

  • speed_pid (dict, default=DEFAULT_PID_ARGS) – The speed PID arguments.

  • steer_pid (dict, default=DEFAULT_PID_ARGS) – The steering PID arguments, by default DEFAULT_PID_ARGS

  • static_waypoint (tuple[float, float] | list | np.ndarray, default=None) – The waypoint to use if sensor_id is None.

Methods

as_config_dict

draw

get_actions

set_agent

set_parent

get_actions(agent)[source]#
swarmsim.agent.control.WaypointPIDController.DEFAULT_PID_ARGS = {'d': 0.0, 'i': 0.0, 'imax': 0.0, 'max': None, 'min': None, 'p': 0.0}#

Classes

WaypointPIDController([agent, parent, ...])

A controller which generates unicycle control inputs (\(v, \omega\)) to follow a waypoint.