scenic.domains.driving.actions

Actions for dynamic agents in the driving domain.

These actions are automatically imported when using the driving domain.

The RegulatedControlAction is based on code from the CARLA project, licensed under the following terms:

Copyright (c) 2018-2020 CVC.

This work is licensed under the terms of the MIT license. For a copy, see <https://opensource.org/licenses/MIT>.

Summary of Module Members

Classes

OffsetAction

Teleports actor forward (in direction of its heading) by some offset.

RegulatedControlAction

Regulated control of throttle, braking, and steering.

SetBrakeAction

Set the amount of brake.

SetHandBrakeAction

Set or release the hand brake.

SetPositionAction

Teleport an agent to the given position.

SetReverseAction

Engage or release reverse gear.

SetSpeedAction

Set the speed of an agent (keeping its heading fixed).

SetSteerAction

Set the steering 'angle'.

SetThrottleAction

Set the throttle.

SetVelocityAction

Set the velocity of an agent.

SetWalkingDirectionAction

Set the walking direction.

SetWalkingSpeedAction

Set the walking speed.

SteeringAction

Abstract class for actions usable by agents which can steer.

Steers

Mixin protocol for agents which can steer.

WalkingAction

Abstract class for actions usable by agents which can walk.

Walks

Mixin protocol for agents which can walk with a given direction and speed.

Member Details

class Steers[source]

Mixin protocol for agents which can steer.

Specifically, agents must support throttling, braking, steering, setting the hand brake, and going into reverse.

class Walks[source]

Mixin protocol for agents which can walk with a given direction and speed.

We provide a simplistic implementation which directly sets the velocity of the agent. This implementation needs to be explicitly opted-into, since simulators may provide a more sophisticated API that properly animates pedestrians.

class SetPositionAction(pos)[source]

Bases: Action

Teleport an agent to the given position.

Parameters:

pos (Vector) –

class OffsetAction(offset)[source]

Bases: Action

Teleports actor forward (in direction of its heading) by some offset.

Parameters:

offset (Vector) –

class SetVelocityAction(xVel, yVel, zVel=0)[source]

Bases: Action

Set the velocity of an agent.

Parameters:
class SetSpeedAction(speed)[source]

Bases: Action

Set the speed of an agent (keeping its heading fixed).

Parameters:

speed (float) –

class SteeringAction[source]

Bases: Action

Abstract class for actions usable by agents which can steer.

Such agents must implement the Steers protocol.

class SetThrottleAction(throttle)[source]

Bases: SteeringAction

Set the throttle.

Parameters:

throttle (float) – Throttle value between 0 and 1.

class SetSteerAction(steer)[source]

Bases: SteeringAction

Set the steering ‘angle’.

Parameters:

steer (float) – Steering ‘angle’ between -1 and 1.

class SetBrakeAction(brake)[source]

Bases: SteeringAction

Set the amount of brake.

Parameters:

brake (float) – Amount of braking between 0 and 1.

class SetHandBrakeAction(handBrake)[source]

Bases: SteeringAction

Set or release the hand brake.

Parameters:

handBrake (bool) – Whether or not the hand brake is set.

class SetReverseAction(reverse)[source]

Bases: SteeringAction

Engage or release reverse gear.

Parameters:

reverse (bool) – Whether or not the car is in reverse.

class RegulatedControlAction(throttle, steer, past_steer, max_throttle=0.5, max_brake=0.5, max_steer=0.8)[source]

Bases: SteeringAction

Regulated control of throttle, braking, and steering.

Controls throttle and braking using one signal that may be positive or negative. Useful with simple controllers that output a single value.

Parameters:
  • throttle (float) – Control signal for throttle and braking (will be clamped as below).

  • steer (float) – Control signal for steering (also clamped).

  • past_steer (float) – Previous steering signal, for regulating abrupt changes.

  • max_throttle (float) – Maximum value for throttle, when positive.

  • max_brake (float) – Maximum (absolute) value for throttle, when negative.

  • max_steer (float) – Maximum absolute value for steer.

class WalkingAction[source]

Bases: Action

Abstract class for actions usable by agents which can walk.

Such agents must implement the Walks protocol.

class SetWalkingDirectionAction(heading)[source]

Bases: WalkingAction

Set the walking direction.

class SetWalkingSpeedAction(speed)[source]

Bases: WalkingAction

Set the walking speed.