carla/PythonAPI/docs/control.yml

511 lines
17 KiB
YAML
Raw Normal View History

2019-05-03 18:18:02 +08:00
---
- module_name: carla
2019-05-03 18:18:02 +08:00
# - CLASSES ------------------------------
classes:
- class_name: VehicleControl
2019-06-06 19:13:47 +08:00
# - DESCRIPTION ------------------------
doc: >
Manages the basic movement of a vehicle using typical driving controls.
# - PROPERTIES -------------------------
instance_variables:
- var_name: throttle
2019-07-01 23:46:27 +08:00
type: float
doc: >
A scalar value to control the vehicle throttle [0.0, 1.0]. Default is 0.0.
# --------------------------------------
- var_name: steer
2019-07-01 23:46:27 +08:00
type: float
doc: >
A scalar value to control the vehicle steering [-1.0, 1.0]. Default is 0.0.
# --------------------------------------
- var_name: brake
2019-07-01 23:46:27 +08:00
type: float
doc: >
A scalar value to control the vehicle brake [0.0, 1.0]. Default is 0.0.
# --------------------------------------
- var_name: hand_brake
2019-07-01 23:46:27 +08:00
type: bool
doc: >
Determines whether hand brake will be used. Default is <b>False</b>.
# --------------------------------------
- var_name: reverse
2019-07-01 23:46:27 +08:00
type: bool
doc: >
Determines whether the vehicle will move backwards. Default is <b>False</b>.
# --------------------------------------
- var_name: manual_gear_shift
2019-07-01 23:46:27 +08:00
type: bool
doc: >
Determines whether the vehicle will be controlled by changing gears manually. Default is <b>False</b>.
# --------------------------------------
- var_name: gear
2019-07-01 23:46:27 +08:00
type: int
doc: >
States which gear is the vehicle running on.
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
- param_name: throttle
type: float
default: 0.0
2020-09-14 22:58:48 +08:00
doc: Scalar value between [0.0,1.0]
- param_name: steer
type: float
default: 0.0
2020-09-14 22:58:48 +08:00
doc: Scalar value between [0.0,1.0]
- param_name: brake
type: float
default: 0.0
2020-09-14 22:58:48 +08:00
doc: Scalar value between [0.0,1.0]
- param_name: hand_brake
type: bool
default: False
- param_name: reverse
type: bool
default: False
- param_name: manual_gear_shift
type: bool
default: False
- param_name: gear
type: int
default: 0
# --------------------------------------
- def_name: __eq__
params:
- param_name: other
2019-07-01 23:46:27 +08:00
type: carla.VehicleControl
# --------------------------------------
- def_name: __ne__
params:
- param_name: other
2019-07-01 23:46:27 +08:00
type: carla.VehicleControl
2019-06-07 20:53:16 +08:00
# --------------------------------------
- def_name: __str__
# --------------------------------------
- class_name: WalkerControl
doc: >
2021-11-04 17:07:41 +08:00
This class defines specific directions that can be commanded to a carla.Walker to control it via script.
AI control can be settled for walkers, but the control used to do so is carla.WalkerAIController.
# - PROPERTIES -------------------------
instance_variables:
- var_name: direction
type: carla.Vector3D
doc: >
Vector using global coordinates that will correspond to the direction of the walker.
# --------------------------------------
- var_name: speed
type: float
2020-09-14 22:58:48 +08:00
var_units: m/s
doc: >
A scalar value to control the walker's speed.
# --------------------------------------
- var_name: jump
type: bool
doc: >
If <b>True</b>, the walker will perform a jump.
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
- param_name: direction
default: [1.0, 0.0, 0.0]
type: carla.Vector3D
- param_name: speed
default: 0.0
2020-09-14 23:48:20 +08:00
param_units: m/s
type: float
- param_name: jump
default: False
type: bool
# --------------------------------------
- def_name: __eq__
params:
- param_name: other
2019-07-01 23:46:27 +08:00
type: carla.WalkerControl
doc: >
Compares every variable with `other` and returns <b>True</b> if these are all the same.
# --------------------------------------
- def_name: __ne__
params:
- param_name: other
2019-07-01 23:46:27 +08:00
type: carla.WalkerControl
doc: >
Compares every variable with `other` and returns <b>True</b> if any of these differ.
2019-07-01 23:46:27 +08:00
# --------------------------------------
- def_name: __str__
# --------------------------------------
2021-11-04 17:07:41 +08:00
- class_name: WalkerBoneControlOut
# - DESCRIPTION ------------------------
doc: >
This class is used to return all bone positions of a pedestrian. For each bone we get its _name_ and its transform in three different spaces (world, actor and relative).
# - PROPERTIES -------------------------
instance_variables:
- var_name: bone_transforms
type: list([name,world, actor, relative])
doc: >
List of one entry per bone with this information:
- name: bone name
- world: transform in world coordinates
- component: transform based on the pivot of the actor
- relative: transform based on the bone parent
# - METHODS ----------------------------
methods:
- def_name: __str__
# --------------------------------------
- class_name: WalkerBoneControlIn
2019-07-01 23:46:27 +08:00
# - DESCRIPTION ------------------------
doc: >
2020-03-02 21:35:50 +08:00
This class grants bone specific manipulation for walker. The skeletons of walkers have been unified for clarity and the transform applied to each bone are always relative to its parent. Take a look [here](tuto_G_control_walker_skeletons.md) to learn more on how to create a walker and define its movement.
2019-07-01 23:46:27 +08:00
# - PROPERTIES -------------------------
instance_variables:
- var_name: bone_transforms
type: list([name,transform])
doc: >
2021-11-04 17:07:41 +08:00
List with the data for each bone we want to set:
- name: bone name
- relative: transform based on the bone parent
2019-07-01 23:46:27 +08:00
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
- param_name: 'list(name,transform)'
2019-07-01 23:46:27 +08:00
type: tuple
doc: >
2020-09-14 22:58:48 +08:00
Initializes an object containing moves to be applied on tick. These are listed with the name of the bone and the transform that will be applied to it.
2019-07-01 23:46:27 +08:00
# --------------------------------------
- def_name: __str__
2019-06-07 20:53:16 +08:00
# --------------------------------------
2019-04-24 22:13:46 +08:00
2019-07-06 00:55:26 +08:00
- class_name: GearPhysicsControl
# - DESCRIPTION ------------------------
doc: >
Class that provides access to vehicle transmission details by defining a gear and when to run on it. This will be later used by carla.VehiclePhysicsControl to help simulate physics.
2019-07-06 00:55:26 +08:00
# - PROPERTIES -------------------------
instance_variables:
- var_name: ratio
type: float
doc: >
The transmission ratio of the gear.
2019-07-06 00:55:26 +08:00
# --------------------------------------
- var_name: down_ratio
type: float
doc: >
Quotient between current RPM and MaxRPM where the autonomous gear box should shift down.
2019-07-06 00:55:26 +08:00
# --------------------------------------
- var_name: up_ratio
type: float
doc: >
Quotient between current RPM and MaxRPM where the autonomous gear box should shift up.
2019-07-06 00:55:26 +08:00
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
- param_name: ratio
type: float
default: 1.0
- param_name: down_ratio
type: float
default: 0.5
- param_name: up_ratio
type: float
default: 0.65
# --------------------------------------
- def_name: __eq__
params:
- param_name: other
type: carla.GearPhysicsControl
# --------------------------------------
- def_name: __ne__
params:
- param_name: other
type: carla.GearPhysicsControl
# --------------------------------------
- def_name: __str__
# --------------------------------------
2019-04-24 22:13:46 +08:00
- class_name: VehiclePhysicsControl
2019-05-03 18:18:02 +08:00
doc: >
Summarizes the parameters that will be used to simulate a carla.Vehicle as a physical object. The specific settings for the wheels though are stipulated using carla.WheelPhysicsControl.
2019-04-24 22:13:46 +08:00
2019-05-03 18:18:02 +08:00
# - PROPERTIES -------------------------
instance_variables:
2019-04-24 22:13:46 +08:00
- var_name: torque_curve
2019-06-07 20:53:16 +08:00
type: list(carla.Vector2D)
2019-05-03 18:18:02 +08:00
doc: >
2019-04-24 22:13:46 +08:00
Curve that indicates the torque measured in Nm for a specific RPM of the vehicle's engine.
# --------------------------------------
- var_name: max_rpm
2019-06-07 20:53:16 +08:00
type: float
2019-05-03 18:18:02 +08:00
doc: >
2019-04-24 22:13:46 +08:00
The maximum RPM of the vehicle's engine.
2019-05-03 18:18:02 +08:00
# --------------------------------------
2019-04-24 22:13:46 +08:00
- var_name: moi
2019-06-07 20:53:16 +08:00
type: float
2020-09-14 22:58:48 +08:00
var_units: kg*m<sup>2</sup>
2019-05-03 18:18:02 +08:00
doc: >
2019-04-24 22:13:46 +08:00
The moment of inertia of the vehicle's engine.
2019-05-03 18:18:02 +08:00
# --------------------------------------
2019-04-24 22:13:46 +08:00
- var_name: damping_rate_full_throttle
2019-06-07 20:53:16 +08:00
type: float
2019-05-03 18:18:02 +08:00
doc: >
Damping ratio when the throttle is maximum.
2019-05-03 18:18:02 +08:00
# --------------------------------------
2019-04-24 22:13:46 +08:00
- var_name: damping_rate_zero_throttle_clutch_engaged
2019-06-07 20:53:16 +08:00
type: float
2019-05-03 18:18:02 +08:00
doc: >
Damping ratio when the throttle is zero with clutch engaged.
2019-04-24 22:13:46 +08:00
# --------------------------------------
- var_name: damping_rate_zero_throttle_clutch_disengaged
2019-06-07 20:53:16 +08:00
type: float
2019-05-03 18:18:02 +08:00
doc: >
Damping ratio when the throttle is zero with clutch disengaged.
2019-04-24 22:13:46 +08:00
# --------------------------------------
- var_name: use_gear_autobox
2019-06-07 20:53:16 +08:00
type: bool
2019-05-03 18:18:02 +08:00
doc: >
If <b>True</b>, the vehicle will have an automatic transmission.
2019-04-24 22:13:46 +08:00
# --------------------------------------
- var_name: gear_switch_time
2019-06-07 20:53:16 +08:00
type: float
2020-09-14 22:58:48 +08:00
var_units: seconds
2019-05-03 18:18:02 +08:00
doc: >
2019-04-24 22:13:46 +08:00
Switching time between gears.
2019-05-03 18:18:02 +08:00
# --------------------------------------
2019-04-24 22:13:46 +08:00
- var_name: clutch_strength
2019-06-07 20:53:16 +08:00
type: float
2020-09-14 22:58:48 +08:00
var_units: kg*m<sup>2</sup>/s
2019-05-03 18:18:02 +08:00
doc: >
2020-09-14 22:58:48 +08:00
Clutch strength of the vehicle.
2019-05-03 18:18:02 +08:00
# --------------------------------------
2019-07-06 00:55:26 +08:00
- var_name: final_ratio
type: float
doc: >
2020-09-14 22:58:48 +08:00
Fixed ratio from transmission to wheels.
2019-07-06 00:55:26 +08:00
# --------------------------------------
- var_name: forward_gears
type: list(carla.GearPhysicsControl)
doc: >
List of objects defining the vehicle's gears.
2019-07-06 00:55:26 +08:00
# --------------------------------------
2019-04-24 22:13:46 +08:00
- var_name: mass
2019-06-07 20:53:16 +08:00
type: float
2020-09-14 22:58:48 +08:00
var_units: kilograms
2019-05-03 18:18:02 +08:00
doc: >
2020-09-14 22:58:48 +08:00
Mass of the vehicle.
2019-05-03 18:18:02 +08:00
# --------------------------------------
2019-04-24 22:13:46 +08:00
- var_name: drag_coefficient
2019-06-07 20:53:16 +08:00
type: float
2019-05-03 18:18:02 +08:00
doc: >
2019-04-24 22:13:46 +08:00
Drag coefficient of the vehicle's chassis.
# --------------------------------------
- var_name: center_of_mass
2019-06-07 20:53:16 +08:00
type: carla.Vector3D
2020-09-14 22:58:48 +08:00
var_units: meters
2019-05-03 18:18:02 +08:00
doc: >
2020-09-14 22:58:48 +08:00
Center of mass of the vehicle.
2019-04-24 22:13:46 +08:00
# --------------------------------------
- var_name: steering_curve
2019-06-07 20:53:16 +08:00
type: list(carla.Vector2D)
2019-05-03 18:18:02 +08:00
doc: >
2019-04-24 22:13:46 +08:00
Curve that indicates the maximum steering for a specific forward speed.
# --------------------------------------
- var_name: use_sweep_wheel_collision
type: bool
doc: >
2020-12-21 18:57:25 +08:00
Enable the use of sweep for wheel collision. By default, it is disabled and it uses a
simple raycast from the axis to the floor for each wheel. This option provides a better
collision model in which the full volume of the wheel is checked against collisions.
# --------------------------------------
2019-04-24 22:13:46 +08:00
- var_name: wheels
2019-06-07 20:53:16 +08:00
type: list(carla.WheelPhysicsControl)
2019-05-03 18:18:02 +08:00
doc: >
List of wheel physics objects. This list should have 4 elements, where index 0 corresponds to the front left wheel, index 1 corresponds to the front right wheel, index 2 corresponds to the back left wheel and index 3 corresponds to the back right wheel. For 2 wheeled vehicles, set the same values for both front and back wheels.
2019-04-24 22:13:46 +08:00
2019-05-03 18:18:02 +08:00
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
2019-04-24 22:13:46 +08:00
- param_name: torque_curve
default: [[0.0,500.0], [5000.0, 500.0]]
type: list(carla.Vector2D)
2019-04-24 22:13:46 +08:00
- param_name: max_rpm
default: 5000.0
type: float
2019-04-24 22:13:46 +08:00
- param_name: moi
default: 1.0
type: float
2020-09-14 22:58:48 +08:00
param_units: kg*m<sup>2</sup>
2019-04-24 22:13:46 +08:00
- param_name: damping_rate_full_throttle
default: 0.15
type: float
2019-04-24 22:13:46 +08:00
- param_name: damping_rate_zero_throttle_clutch_engaged
default: 2.0
type: float
2019-04-24 22:13:46 +08:00
- param_name: damping_rate_zero_throttle_clutch_disengaged
default: 0.35
type: float
2019-04-24 22:13:46 +08:00
- param_name: use_gear_autobox
default: True
type: bool
2019-04-24 22:13:46 +08:00
- param_name: gear_switch_time
default: 0.5
type: float
2020-09-14 22:58:48 +08:00
param_units: seconds
2019-04-24 22:13:46 +08:00
- param_name: clutch_strength
default: 10.0
type: float
2020-09-14 22:58:48 +08:00
param_units: kg*m<sup>2</sup>/s
- param_name: final_ratio
default: 4.0
type: float
- param_name: forward_gears
default: list()
type: list(carla.GearPhysicsControl)
2019-04-24 22:13:46 +08:00
- param_name: drag_coefficient
default: 0.3
type: float
2019-04-24 22:13:46 +08:00
- param_name: center_of_mass
default: [0.0, 0.0, 0.0]
type: carla.Vector3D
2019-04-24 22:13:46 +08:00
- param_name: steering_curve
default: [[0.0, 1.0],[10.0, 0.5]]
type: carla.Vector2D
2019-04-24 22:13:46 +08:00
- param_name: wheels
2019-06-07 20:53:16 +08:00
default: list()
type: list(carla.WheelPhysicsControl)
- param_name: use_sweep_wheel_collision
default: False
type: bool
- param_name: mass
default: 1000.0
type: float
param_units: kilograms
2019-04-24 22:13:46 +08:00
doc: >
VehiclePhysicsControl constructor
2019-05-03 18:18:02 +08:00
# --------------------------------------
- def_name: __eq__
params:
2019-04-24 22:13:46 +08:00
- param_name: other
2019-07-01 23:46:27 +08:00
type: carla.VehiclePhysicsControl
2019-06-07 20:53:16 +08:00
# --------------------------------------
2019-05-03 18:18:02 +08:00
- def_name: __ne__
params:
2019-04-24 22:13:46 +08:00
- param_name: other
2019-07-01 23:46:27 +08:00
type: carla.VehiclePhysicsControl
# --------------------------------------
- def_name: __str__
2019-06-07 20:53:16 +08:00
# --------------------------------------
2019-05-03 18:18:02 +08:00
2019-04-24 22:13:46 +08:00
- class_name: WheelPhysicsControl
2019-05-03 18:18:02 +08:00
doc: >
Class that defines specific physical parameters for wheel objects that will be part of a carla.VehiclePhysicsControl to simulate vehicle it as a material object.
2019-05-03 18:18:02 +08:00
# - PROPERTIES -------------------------
instance_variables:
2019-04-24 22:13:46 +08:00
- var_name: tire_friction
type: float
2019-05-03 18:18:02 +08:00
doc: >
2019-07-05 20:22:22 +08:00
A scalar value that indicates the friction of the wheel.
2019-04-24 22:13:46 +08:00
# --------------------------------------
- var_name: damping_rate
type: float
2019-05-03 18:18:02 +08:00
doc: >
Damping rate of the wheel.
2019-04-24 22:13:46 +08:00
# --------------------------------------
- var_name: max_steer_angle
type: float
2020-09-14 22:58:48 +08:00
var_units: degrees
2019-05-03 18:18:02 +08:00
doc: >
2020-09-14 22:58:48 +08:00
Maximum angle that the wheel can steer.
2019-04-24 22:13:46 +08:00
# --------------------------------------
2019-06-06 19:13:47 +08:00
- var_name: radius
type: float
2020-09-14 22:58:48 +08:00
var_units: centimeters
2019-06-06 19:13:47 +08:00
doc: >
2020-09-14 22:58:48 +08:00
Radius of the wheel.
2019-06-06 19:13:47 +08:00
# --------------------------------------
2019-07-06 00:55:26 +08:00
- var_name: max_brake_torque
type: float
2020-09-14 22:58:48 +08:00
var_units: N*m
2019-07-06 00:55:26 +08:00
doc: >
2020-09-14 22:58:48 +08:00
Maximum brake torque.
2019-07-06 00:55:26 +08:00
# --------------------------------------
- var_name: max_handbrake_torque
type: float
2020-09-14 22:58:48 +08:00
var_units: N*m
2019-07-06 00:55:26 +08:00
doc: >
2020-09-14 22:58:48 +08:00
Maximum handbrake torque.
2019-07-06 00:55:26 +08:00
# --------------------------------------
2019-06-06 19:13:47 +08:00
- var_name: position
2019-07-01 23:46:27 +08:00
type: carla.Vector3D
2019-05-03 18:18:02 +08:00
doc: >
World position of the wheel. This is a read-only parameter.
# --------------------------------------
- var_name: long_stiff_value
type: float
var_units: kg per radian
doc: >
Tire longitudinal stiffness per unit gravitational acceleration. Each vehicle has a custom value.
# --------------------------------------
- var_name: lat_stiff_max_load
type: float
doc: >
Maximum normalized tire load at which the tire can deliver no more lateral stiffness no matter how much extra load is applied to the tire. Each vehicle has a custom value.
# --------------------------------------
- var_name: lat_stiff_value
type: float
doc: >
Maximum stiffness per unit of lateral slip. Each vehicle has a custom value.
2019-05-03 18:18:02 +08:00
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
2019-04-24 22:13:46 +08:00
- param_name: tire_friction
default: 2.0
type: float
2019-04-24 22:13:46 +08:00
- param_name: damping_rate
default: 0.25
type: float
2019-04-24 22:13:46 +08:00
- param_name: max_steer_angle
default: 70.0
type: float
2020-09-14 22:58:48 +08:00
param_units: degrees
2019-06-06 19:13:47 +08:00
- param_name: radius
default: 30.0
type: float
2020-09-14 22:58:48 +08:00
param_units: centimerers
- param_name: max_brake_torque
default: 1500.0
type: float
2020-09-14 22:58:48 +08:00
param_units: N*m
- param_name: max_handbrake_torque
default: 3000.0
type: float
2020-09-14 22:58:48 +08:00
param_units: N*m
2019-07-01 23:46:27 +08:00
- param_name: position
default: (0.0,0.0,0.0)
type: carla.Vector3D
2020-09-14 22:58:48 +08:00
param_units: meters
2019-05-03 18:18:02 +08:00
# --------------------------------------
- def_name: __eq__
params:
2019-04-24 22:13:46 +08:00
- param_name: other
2019-07-01 23:46:27 +08:00
type: carla.WheelPhysicsControl
2019-06-06 19:13:47 +08:00
# --------------------------------------
2019-05-03 18:18:02 +08:00
- def_name: __ne__
params:
2019-04-24 22:13:46 +08:00
- param_name: other
2019-07-01 23:46:27 +08:00
type: carla.WheelPhysicsControl
# --------------------------------------
- def_name: __str__
2019-06-07 20:53:16 +08:00
# --------------------------------------
2019-05-03 18:18:02 +08:00
...