Agents¶

Background¶

Used internally to control agents in the scene such as traffic lights, cross walks, pedestrians and background cars. These are not intended to be instantiated outside the UDS environment
class gym_urbandriving.agents.background.planning_pursuit_agent.PlanningPursuitAgent(agent_num=0)[source]

Background agent which implements the full plannning stack given known behavioral logic. The planner first generates a nominal trajecotry, then at each timestep plans its velocity to avoid collisons.

agent_num

int – Index of this agent in the world. Used to access its object in state.dynamic_objects

eval_policy(state, simplified=False)[source]

Returns action based on current state

Parameters: state (PositionState) – State of the world, unused tuple with floats (steering,acceleration)
class gym_urbandriving.agents.background.pursuit_agent.PursuitAgent(agent_num=0)[source]
eval_policy(state, type_of_agent='background_cars')[source]

Returns action based next state in trajectory.

Parameters: state (PositionState) – State of the world, unused SteeringAction

Hierarchical¶

Used to build control at different levels of the planning software stack. They are used internally in FLUIDS to allow the user to apply a different type of actions to the environment.

class gym_urbandriving.agents.hierarchical.velocity_action_agent.VelocityActionAgent(agent_num=0)[source]

Hierarichal agent which implements the full plannning stack except the velocity component The planner first generates a nominal trajecotry, then at each timestep recives a target velocity to track with PID controller.

agent_num

int – Index of this agent in the world. Used to access its object in state.dynamic_objects

eval_policy(action, state, simplified=False)[source]

Returns action based next state in trajectory.

Parameters: state (PositionState) – State of the world, unused action (VelocityAction or None) – Target velocity for car to travel at tuple with floats (steering,acceleration)
class gym_urbandriving.agents.hierarchical.steering_action_agent.SteeringActionAgent(agent_num=0)[source]

Hierarichal agent which does not include any planning stack and only requires specifiying the steering agent.

agent_num

int – Index of this agent in the world. Used to access its object in state.dynamic_objects

eval_policy(action, state, simplified=False)[source]

Returns action based next state in trajectory.

Parameters: state (PositionState) – State of the world, unused action (SteeringAction) – tuple with floats (steering,acceleration)

Supervisors¶

Classes use to control different cars in the scene. Logically they are similar to background cars and have access to the internal state of the world to make a decision. However, they can be used to collect data and provide ground truth of what the supervisor would have done in a single state.

class gym_urbandriving.agents.supervisor.velocity_supervisor.VelocitySupervisor(agent_num=0)[source]

Superivsor agent which implements the planning stack to obtain velocity level supervision of which the car should follow.

agent_num

int – Index of this agent in the world. Used to access its object in state.dynamic_objects

eval_policy(state, simplified=False)[source]

Returns action based next state in trajectory.

Parameters: state (PositionState) – State of the world, unused simplified (bool) – specifies whether or not to use a simplified greedy model for look ahead planning float specifying target velocity
class gym_urbandriving.agents.supervisor.steering_supervisor.SteeringSupervisor(agent_num=0)[source]

Superivsor agent which implements the planning stack to obtain steering level supervision of which the car should follow.

agent_num

int – Index of this agent in the world. Used to access its object in state.dynamic_objects

eval_policy(state)[source]

Returns action based on current world state

Parameters: state (PositionState) – State of the world, unused action (float) – Target velocity for car to travel at SteeringAction

Tele-Op¶

Used for a human supervisor to operate the vehicle. Currently, the use of keyboard commands is supported.

class gym_urbandriving.agents.tele_op.keyboard_agent.KeyboardAgent(agent_num=0)[source]

Agent which interprets user keyboard inputs

agent_num

int – Index of this agent in the world. Used to access its object in state.dynamic_objects

eval_policy(state)[source]

Returns action based on keyboard input

Parameters: state (PositionState) – State of the world, unused numpy array with elements (steering,acceleration)

Pedestrian¶

FLUIDS also packages a basic pedestrian controller for controling the movement of background pedestrians. Pedestrians display simple behavior, walking forwards unless blocked by a crosswalk signal.

class gym_urbandriving.agents.supervisor.pedestrian_supervisor.PedestrianAgent(agent_num=0)[source]

Supervisor Agent for controlling pedestrians

agent_num

int – Index of this agent in the world

eval_policy(state)[source]

Returns action based on state of world

Parameters: state (PositionState) – State of the world Turning angle, acceleration pair