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
Teleports actor forward (in direction of its heading) by some offset. |
|
Regulated control of throttle, braking, and steering. |
|
Set the amount of brake. |
|
Set or release the hand brake. |
|
Teleport an agent to the given position. |
|
Engage or release reverse gear. |
|
Set the speed of an agent (keeping its heading fixed). |
|
Set the steering 'angle'. |
|
Set the throttle. |
|
Set the velocity of an agent. |
|
Set the walking direction. |
|
Set the walking speed. |
|
Abstract class for actions usable by agents which can steer. |
|
Mixin protocol for agents which can steer. |
|
Abstract class for actions usable by agents which can walk. |
|
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:
ActionTeleport an agent to the given position.
- Parameters:
pos (Vector)
- class OffsetAction(offset)[source]
Bases:
ActionTeleports actor forward (in direction of its heading) by some offset.
- Parameters:
offset (Vector)
- class SetSpeedAction(speed)[source]
Bases:
ActionSet the speed of an agent (keeping its heading fixed).
- Parameters:
speed (float)
- class SteeringAction[source]
Bases:
ActionAbstract class for actions usable by agents which can steer.
Such agents must implement the
Steersprotocol.
- class SetThrottleAction(throttle)[source]
Bases:
SteeringActionSet the throttle.
The throttle setting will remain constant until this action is taken again.
- Parameters:
throttle (float) – Throttle value between 0 and 1.
- class SetSteerAction(steer)[source]
Bases:
SteeringActionSet the steering ‘angle’.
The steering setting will remain constant until this action is taken again.
- Parameters:
steer (float) – Steering ‘angle’ between -1 and 1. Positive values steer to the right.
- class SetBrakeAction(brake)[source]
Bases:
SteeringActionSet the amount of brake.
The brake setting will remain constant until this action is taken again.
- Parameters:
brake (float) – Amount of braking between 0 and 1.
- class SetHandBrakeAction(handBrake)[source]
Bases:
SteeringActionSet or release the hand brake.
The handbrake setting will remain constant until this action is taken again.
- Parameters:
handBrake (bool) – Whether or not the hand brake is set.
- class SetReverseAction(reverse)[source]
Bases:
SteeringActionEngage or release reverse gear.
The reverse setting will remain constant until this action is taken again.
- 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:
SteeringActionRegulated 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:
ActionAbstract class for actions usable by agents which can walk.
Such agents must implement the
Walksprotocol.
- class SetWalkingDirectionAction(heading)[source]
Bases:
WalkingActionSet the walking direction.
- class SetWalkingSpeedAction(speed)[source]
Bases:
WalkingActionSet the walking speed.