Review python api ()

* updated missing api docs

* auto generated python_api.md

* @glopezdiest corrections

---------

Co-authored-by: bernat <bernatx@gmail.com>
This commit is contained in:
MattRoweEAIF 2023-04-14 08:43:38 +02:00 committed by GitHub
parent 8a33893cb0
commit ade852e619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 532 additions and 138 deletions

View File

@ -1,6 +1,40 @@
#Python API reference
This reference contains all the details the Python API. To consult a previous reference for a specific CARLA release, change the documentation version using the panel in the bottom right corner.<br>This will change the whole documentation to a previous state. Remember that the <i>latest</i> version is the `dev` branch and may show features not available in any packaged versions of CARLA.<hr>
## carla.AckermannControllerSettings<a name="carla.AckermannControllerSettings"></a>
Manages the settings of the Ackermann PID controller.
### Instance Variables
- <a name="carla.AckermannControllerSettings.speed_kp"></a>**<font color="#f8805a">speed_kp</font>** (_float_)
Proportional term of the speed PID controller.
- <a name="carla.AckermannControllerSettings.speed_ki"></a>**<font color="#f8805a">speed_ki</font>** (_float_)
Integral term of the speed PID controller.
- <a name="carla.AckermannControllerSettings.speed_kd"></a>**<font color="#f8805a">speed_kd</font>** (_float_)
Derivative term of the speed PID controller.
- <a name="carla.AckermannControllerSettings.accel_kp"></a>**<font color="#f8805a">accel_kp</font>** (_float_)
Proportional term of the acceleration PID controller.
- <a name="carla.AckermannControllerSettings.accel_ki"></a>**<font color="#f8805a">accel_ki</font>** (_float_)
Integral term of the acceleration PID controller.
- <a name="carla.AckermannControllerSettings.accel_kd"></a>**<font color="#f8805a">accel_kd</font>** (_float_)
Derivative term of the acceleration PID controller.
### Methods
- <a name="carla.AckermannControllerSettings.__init__"></a>**<font color="#7fb800">\__init__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**speed_kp**=0.15</font>, <font color="#00a6ed">**speed_ki**=0.0</font>, <font color="#00a6ed">**speed_kd**=0.25</font>, <font color="#00a6ed">**accel_kp**=0.01</font>, <font color="#00a6ed">**accel_ki**=0.0</font>, <font color="#00a6ed">**accel_kd**=0.01</font>)
- **Parameters:**
- `speed_kp` (_float_)
- `speed_ki` (_float_)
- `speed_kd` (_float_)
- `accel_kp` (_float_)
- `accel_ki` (_float_)
- `accel_kd` (_float_)
##### Dunder methods
- <a name="carla.AckermannControllerSettings.__eq__"></a>**<font color="#7fb800">\__eq__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**other**=[carla.AckermannControllerSettings](#carla.AckermannControllerSettings)</font>)
- <a name="carla.AckermannControllerSettings.__ne__"></a>**<font color="#7fb800">\__ne__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**other**=[carla.AckermannControllerSettings](#carla.AckermannControllerSettings)</font>)
- <a name="carla.AckermannControllerSettings.__str__"></a>**<font color="#7fb800">\__str__</font>**(<font color="#00a6ed">**self**</font>)
---
## carla.Actor<a name="carla.Actor"></a>
CARLA defines actors as anything that plays a role in the simulation or can be moved around. That includes: pedestrians, vehicles, sensors and traffic signs (considering traffic lights as part of these). Actors are spawned in the simulation by [carla.World](#carla.World) and they need for a [carla.ActorBlueprint](#carla.ActorBlueprint) to be created. These blueprints belong into a library provided by CARLA, find more about them [here](bp_library.md).
@ -9,14 +43,22 @@ CARLA defines actors as anything that plays a role in the simulation or can be m
A dictionary containing the attributes of the blueprint this actor was based on.
- <a name="carla.Actor.id"></a>**<font color="#f8805a">id</font>** (_int_)
Identifier for this actor. Unique during a given episode.
- <a name="carla.Actor.type_id"></a>**<font color="#f8805a">type_id</font>** (_str_)
The identifier of the blueprint this actor was based on, e.g. `vehicle.ford.mustang`.
- <a name="carla.Actor.is_alive"></a>**<font color="#f8805a">is_alive</font>** (_bool_)
Returns whether this object was destroyed using this actor handle.
- <a name="carla.Actor.is_active"></a>**<font color="#f8805a">is_active</font>** (_bool_)
Returns whether this actor is active (True) or not (False).
- <a name="carla.Actor.is_dormant"></a>**<font color="#f8805a">is_dormant</font>** (_bool_)
Returns whether this actor is dormant (True) or not (False) - the opposite of is_active.
- <a name="carla.Actor.parent"></a>**<font color="#f8805a">parent</font>** (_[carla.Actor](#carla.Actor)_)
Actors may be attached to a parent actor that they will follow around. This is said actor.
- <a name="carla.Actor.semantic_tags"></a>**<font color="#f8805a">semantic_tags</font>** (_list(int)_)
A list of semantic tags provided by the blueprint listing components for this actor. E.g. a traffic light could be tagged with `Pole` and `TrafficLight`. These tags are used by the semantic segmentation sensor. Find more about this and other sensors [here](ref_sensors.md#semantic-segmentation-camera).
- <a name="carla.Actor.type_id"></a>**<font color="#f8805a">type_id</font>** (_str_)
The identifier of the blueprint this actor was based on, e.g. `vehicle.ford.mustang`.
- <a name="carla.Actor.actor_state"></a>**<font color="#f8805a">actor_state</font>** (_[carla.ActorState](#carla.ActorState)_)
Returns the [carla.ActorState](#carla.ActorState), which can identify if the actor is Active, Dormant or Invalid.
- <a name="carla.Actor.bounding_box"></a>**<font color="#f8805a">bounding_box</font>** (_[carla.BoundingBox](#carla.BoundingBox)_)
Bounding box containing the geometry of the actor. Its location and rotation are relative to the actor it is attached to.
### Methods
- <a name="carla.Actor.add_angular_impulse"></a>**<font color="#7fb800">add_angular_impulse</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**angular_impulse**</font>)
@ -35,12 +77,6 @@ Applies an impulse at the center of mass of the actor. This method should be use
Applies a torque at the center of mass of the actor. This method should be used for torques that are applied over a certain period of time. Use __<font color="#7fb800">add_angular_impulse()</font>__ to apply a torque that only lasts an instant.
- **Parameters:**
- `torque` (_[carla.Vector3D](#carla.Vector3D)<small> - degrees</small>_) - Torque vector in global coordinates.
- <a name="carla.Actor.close_door"></a>**<font color="#7fb800">close_door</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**door_idx**</font>)
Close the door door_idx if the vehicle has it. Use [carla.VehicleDoor.All](#carla.VehicleDoor.All) to close all available doors.
- **Parameters:**
- `door_idx` (_[carla.VehicleDoor](#carla.VehicleDoor)_) - door index.
- **Note:** <font color="#8E8E8E">_Only [carla.Vehicle](#carla.Vehicle) actors can use this method.
_</font>
- <a name="carla.Actor.destroy"></a>**<font color="#7fb800">destroy</font>**(<font color="#00a6ed">**self**</font>)
Tells the simulator to destroy this actor and returns <b>True</b> if it was successful. It has no effect if it was already destroyed.
- **Return:** _bool_
@ -48,19 +84,6 @@ Tells the simulator to destroy this actor and returns <b>True</b> if it was succ
_</font>
- <a name="carla.Actor.disable_constant_velocity"></a>**<font color="#7fb800">disable_constant_velocity</font>**(<font color="#00a6ed">**self**</font>)
Disables any constant velocity previously set for a [carla.Vehicle](#carla.Vehicle) actor.
- <a name="carla.Actor.enable_chrono_physics"></a>**<font color="#7fb800">enable_chrono_physics</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**max_substeps**</font>, <font color="#00a6ed">**max_substep_delta_time**</font>, <font color="#00a6ed">**vehicle_json**</font>, <font color="#00a6ed">**powertrain_json**</font>, <font color="#00a6ed">**tire_json**</font>, <font color="#00a6ed">**base_json_path**</font>)
Enables Chrono physics on a spawned vehicle.
- **Parameters:**
- `max_substeps` (_int_) - Max number of Chrono substeps.
- `max_substep_delta_time` (_int_) - Max size of substep.
- `vehicle_json` (_str_) - Path to vehicle json file relative to `base_json_path`.
- `powertrain_json` (_str_) - Path to powertrain json file relative to `base_json_path`.
- `tire_json` (_str_) - Path to tire json file relative to `base_json_path`.
- `base_json_path` (_str_) - Path to `chrono/data/vehicle` folder. E.g., `/home/user/carla/Build/chrono-install/share/chrono/data/vehicle/` (the final `/` character is required).
- **Note:** <font color="#8E8E8E">_Ensure that you have started the CARLA server with the `ARGS="--chrono"` flag. You will not be able to use Chrono physics without this flag set.
_</font>
- **Warning:** <font color="#ED2F2F">_Collisions are not supported. When a collision is detected, physics will revert to the default CARLA physics.
_</font>
- <a name="carla.Actor.enable_constant_velocity"></a>**<font color="#7fb800">enable_constant_velocity</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**velocity**</font>)
Sets a vehicle's velocity vector to a constant value over time. The resulting velocity will be approximately the `velocity` being set, as with __<font color="#7fb800">set_target_velocity()</font>__.
- **Parameters:**
@ -69,16 +92,6 @@ Sets a vehicle's velocity vector to a constant value over time. The resulting ve
_</font>
- **Warning:** <font color="#ED2F2F">_Enabling a constant velocity for a vehicle managed by the [Traffic Manager](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_traffic_manager/) may cause conflicts. This method overrides any changes in velocity by the TM.
_</font>
- <a name="carla.Actor.open_door"></a>**<font color="#7fb800">open_door</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**door_idx**</font>)
Open the door door_idx if the vehicle has it. Use [carla.VehicleDoor.All](#carla.VehicleDoor.All) to open all available doors.
- **Parameters:**
- `door_idx` (_[carla.VehicleDoor](#carla.VehicleDoor)_) - door index.
- **Note:** <font color="#8E8E8E">_Only [carla.Vehicle](#carla.Vehicle) actors can use this method.
_</font>
- <a name="carla.Actor.show_debug_telemetry"></a>**<font color="#7fb800">show_debug_telemetry</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**enabled**=True</font>)
Enables or disables the telemetry on this vehicle. This shows information about the vehicles current state and forces applied to it in the spectator window. Only information for one vehicle can be shown so if you enable a second one, the previous will be automatically disabled.
- **Parameters:**
- `enabled` (_bool_)
##### Getters
- <a name="carla.Actor.get_acceleration"></a>**<font color="#7fb800">get_acceleration</font>**(<font color="#00a6ed">**self**</font>)
@ -295,12 +308,25 @@ Returns the velocity vector registered for an actor in that tick.
---
## carla.ActorState<a name="carla.ActorState"></a>
Class that defines the state of an actor.
### Instance Variables
- <a name="carla.ActorState.Invalid"></a>**<font color="#f8805a">Invalid</font>**
An actor is Invalid if a problem has occurred.
- <a name="carla.ActorState.Active"></a>**<font color="#f8805a">Active</font>**
An actor is Active when it visualized and can affect other actors.
- <a name="carla.ActorState.Dormant"></a>**<font color="#f8805a">Dormant</font>**
An actor is Dormant when it is not visualized and will not affect other actors through physics. For example, actors are dormant if they are on an unloaded tile in a large map.
---
## carla.AttachmentType<a name="carla.AttachmentType"></a>
Class that defines attachment options between an actor and its parent. When spawning actors, these can be attached to another actor so their position changes accordingly. This is specially useful for sensors. The snipet in [carla.World.spawn_actor](#carla.World.spawn_actor) shows some sensors being attached to a car when spawned. Note that the attachment type is declared as an enum within the class.
### Instance Variables
- <a name="carla.AttachmentType.Rigid"></a>**<font color="#f8805a">Rigid</font>**
With this fixed attatchment the object follow its parent position strictly. This is the recommended attachment to retrieve precise data from the simulation.
With this fixed attachment the object follow its parent position strictly. This is the recommended attachment to retrieve precise data from the simulation.
- <a name="carla.AttachmentType.SpringArm"></a>**<font color="#f8805a">SpringArm</font>**
An attachment that expands or retracts the position of the actor, depending on its parent. This attachment is only recommended to record videos from the simulation where a smooth movement is needed. SpringArms are an Unreal Engine component so [check the UE docs](https://docs.unrealengine.com/en-US/Gameplay/HowTo/UsingCameras/SpringArmComponents/index.html) to learn more about them. <br><b style="color:red;">Warning:</b> The <b>SpringArm</b> attachment presents weird behaviors when an actor is spawned with a relative translation in the Z-axis (e.g. <code>child_location = Location(0,0,2)</code>).
- <a name="carla.AttachmentType.SpringArmGhost"></a>**<font color="#f8805a">SpringArmGhost</font>**
@ -554,6 +580,9 @@ Returns the world object currently active in the simulation. This world will be
- <a name="carla.Client.set_replayer_ignore_hero"></a>**<font color="#7fb800">set_replayer_ignore_hero</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**ignore_hero**</font>)
- **Parameters:**
- `ignore_hero` (_bool_) - Enables or disables playback of the hero vehicle during a playback of a recorded simulation.
- <a name="carla.Client.set_replayer_ignore_spectator"></a>**<font color="#7fb800">set_replayer_ignore_spectator</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**ignore_spectator**</font>)
- **Parameters:**
- `ignore_spectator` (_bool_) - Determines whether the recorded spectator movements will be replicated by the replayer.
- <a name="carla.Client.set_replayer_time_factor"></a>**<font color="#7fb800">set_replayer_time_factor</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**time_factor**=1.0</font>)
When used, the time speed of the reenacted simulation is modified at will. It can be used several times while a playback is in curse.
- **Parameters:**
@ -613,7 +642,7 @@ Class that defines conversion patterns that can be applied to a [carla.Image](#c
### Instance Variables
- <a name="carla.ColorConverter.CityScapesPalette"></a>**<font color="#f8805a">CityScapesPalette</font>**
Converts the image to a segmentated map using tags provided by the blueprint library. Used by the [semantic segmentation camera](ref_sensors.md#semantic-segmentation-camera).
Converts the image to a segmented map using tags provided by the blueprint library. Used by the [semantic segmentation camera](ref_sensors.md#semantic-segmentation-camera).
- <a name="carla.ColorConverter.Depth"></a>**<font color="#f8805a">Depth</font>**
Converts the image to a linear depth map. Used by the [depth camera](ref_sensors.md#depth-camera).
- <a name="carla.ColorConverter.LogarithmicDepth"></a>**<font color="#f8805a">LogarithmicDepth</font>**
@ -929,6 +958,7 @@ Image height in pixels.
- <a name="carla.Image.width"></a>**<font color="#f8805a">width</font>** (_int_)
Image width in pixels.
- <a name="carla.Image.raw_data"></a>**<font color="#f8805a">raw_data</font>** (_bytes_)
Flattened array of pixel data, use reshape to create an image array.
### Methods
- <a name="carla.Image.convert"></a>**<font color="#7fb800">convert</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**color_converter**</font>)
@ -956,7 +986,7 @@ Class that embodies the intersections on the road described in the OpenDRIVE fil
### Instance Variables
- <a name="carla.Junction.id"></a>**<font color="#f8805a">id</font>** (_int_)
Identificator found in the OpenDRIVE file.
Identifier found in the OpenDRIVE file.
- <a name="carla.Junction.bounding_box"></a>**<font color="#f8805a">bounding_box</font>** (_[carla.BoundingBox](#carla.BoundingBox)_)
Bounding box encapsulating the junction lanes.
@ -1009,9 +1039,9 @@ Height where the landmark is placed.
- <a name="carla.Landmark.country"></a>**<font color="#f8805a">country</font>** (_str_)
Country code where the landmark is defined (default to OpenDRIVE is Germany 2017).
- <a name="carla.Landmark.type"></a>**<font color="#f8805a">type</font>** (_str_)
Type identificator of the landmark according to the country code.
Type identifier of the landmark according to the country code.
- <a name="carla.Landmark.sub_type"></a>**<font color="#f8805a">sub_type</font>** (_str_)
Subtype identificator of the landmark according to the country code.
Subtype identifier of the landmark according to the country code.
- <a name="carla.Landmark.value"></a>**<font color="#f8805a">value</font>** (_float_)
Value printed in the signal (e.g. speed limit, maximum weight, etc).
- <a name="carla.Landmark.unit"></a>**<font color="#f8805a">unit</font>** (_str_)
@ -1245,7 +1275,7 @@ Every type except for NONE.
---
## carla.LidarDetection<a name="carla.LidarDetection"></a>
Data contained inside a [carla.LidarMeasurement](#carla.LidarMeasurement). Each of these represents one of the points in the cloud with its location and its asociated intensity.
Data contained inside a [carla.LidarMeasurement](#carla.LidarMeasurement). Each of these represents one of the points in the cloud with its location and its associated intensity.
### Instance Variables
- <a name="carla.LidarDetection.point"></a>**<font color="#f8805a">point</font>** (_[carla.Location](#carla.Location)<small> - meters</small>_)
@ -1270,7 +1300,7 @@ Number of lasers shot.
- <a name="carla.LidarMeasurement.horizontal_angle"></a>**<font color="#f8805a">horizontal_angle</font>** (_float<small> - radians</small>_)
Horizontal angle the LIDAR is rotated at the time of the measurement.
- <a name="carla.LidarMeasurement.raw_data"></a>**<font color="#f8805a">raw_data</font>** (_bytes_)
Received list of 4D points. Each point consists of [x,y,z] coordiantes plus the intensity computed for that point.
Received list of 4D points. Each point consists of [x,y,z] coordinates plus the intensity computed for that point.
### Methods
- <a name="carla.LidarMeasurement.save_to_disk"></a>**<font color="#7fb800">save_to_disk</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**path**</font>)
@ -1550,6 +1580,10 @@ Constructor for this class. Though a map is automatically generated when initial
- `name` (_str_) - Name of the current map.
- `xodr_content` (_str_) - .xodr content in string format.
- **Return:** _list([carla.Transform](#carla.Transform))_
- <a name="carla.Map.cook_in_memory_map"></a>**<font color="#7fb800">cook_in_memory_map</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**path**</font>)
Generates a binary file from the CARLA map containing information used by the Traffic Manager. This method is only used during the import process for maps.
- **Parameters:**
- `path` (_str_) - Path to the intended location of the stored binary map file.
- <a name="carla.Map.generate_waypoints"></a>**<font color="#7fb800">generate_waypoints</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**distance**</font>)
Returns a list of waypoints with a certain distance between them for every lane and centered inside of it. Waypoints are not listed in any particular order. Remember that waypoints closer than 2cm within the same road, section and lane will have the same identificator.
- **Parameters:**
@ -1704,6 +1738,7 @@ Image height in pixels.
- <a name="carla.OpticalFlowImage.width"></a>**<font color="#f8805a">width</font>** (_int_)
Image width in pixels.
- <a name="carla.OpticalFlowImage.raw_data"></a>**<font color="#f8805a">raw_data</font>** (_bytes_)
Flattened array of pixel data, use reshape to create an image array.
### Methods
@ -2492,6 +2527,8 @@ Adjust probability that in each timestep the actor will perform a right lane cha
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor)_) - The actor that you wish to query.
- `percentage` (_float_) - The probability of lane change in percentage units (between 0 and 100).
- <a name="carla.TrafficManager.shut_down"></a>**<font color="#7fb800">shut_down</font>**(<font color="#00a6ed">**self**</font>)
Shuts down the traffic manager.
- <a name="carla.TrafficManager.update_vehicle_lights"></a>**<font color="#7fb800">update_vehicle_lights</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**actor**</font>, <font color="#00a6ed">**do_update**</font>)
Sets if the Traffic Manager is responsible of updating the vehicle lights, or not.
Default is __False__. The traffic manager will not change the vehicle light status of a vehicle, unless its auto_update_status is st to __True__.
@ -2614,6 +2651,10 @@ Describes a rotation for an object according to Unreal Engine's axis system.
Translates a 3D point from local to global coordinates using the current transformation as frame of reference.
- **Parameters:**
- `in_point` (_[carla.Location](#carla.Location)_) - Location in the space to which the transformation will be applied.
- <a name="carla.Transform.transform_vector"></a>**<font color="#7fb800">transform_vector</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**in_vector**</font>)
Rotates a vector using the current transformation as frame of reference, without applying translation. Use this to transform, for example, a velocity.
- **Parameters:**
- `in_vector` (_[carla.Vector3D](#carla.Vector3D)_) - Vector to which the transformation will be applied.
##### Getters
- <a name="carla.Transform.get_forward_vector"></a>**<font color="#7fb800">get_forward_vector</font>**(<font color="#00a6ed">**self**</font>)
@ -2626,7 +2667,7 @@ Computes the 4-matrix representation of the inverse transformation.
Computes the 4-matrix representation of the transformation.
- **Return:** _list(list(float))_
- <a name="carla.Transform.get_right_vector"></a>**<font color="#7fb800">get_right_vector</font>**(<font color="#00a6ed">**self**</font>)
Computes a right vector using the rotatio of the object.
Computes a right vector using the rotation of the object.
- **Return:** _[carla.Vector3D](#carla.Vector3D)_
- <a name="carla.Transform.get_up_vector"></a>**<font color="#7fb800">get_up_vector</font>**(<font color="#00a6ed">**self**</font>)
Computes an up vector using the rotation of the object.
@ -2748,6 +2789,13 @@ Returns a vector with the same direction and unitary length.
Computes the squared length of the vector.
- **Return:** _float_
##### Getters
- <a name="carla.Vector3D.get_vector_angle"></a>**<font color="#7fb800">get_vector_angle</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**vector**</font>)
Computes the angle between a pair of 3D vectors in radians.
- **Parameters:**
- `vector` (_[carla.Vector3D](#carla.Vector3D)_)
- **Return:** _float_
##### Dunder methods
- <a name="carla.Vector3D.__abs__"></a>**<font color="#7fb800">\__abs__</font>**(<font color="#00a6ed">**self**</font>)
Returns a Vector3D with the absolute value of the components x, y and z.
@ -2770,13 +2818,22 @@ Returns the axis values for the vector parsed as string.
## carla.Vehicle<a name="carla.Vehicle"></a>
<small style="display:block;margin-top:-20px;">Inherited from _[carla.Actor](#carla.Actor)_</small></br>
One of the most important group of actors in CARLA. These include any type of vehicle from cars to trucks, motorbikes, vans, bycicles and also official vehicles such as police cars. A wide set of these actors is provided in [carla.BlueprintLibrary](#carla.BlueprintLibrary) to facilitate differente requirements. Vehicles can be either manually controlled or set to an autopilot mode that will be conducted client-side by the <b>traffic manager</b>.
One of the most important groups of actors in CARLA. These include any type of vehicle from cars to trucks, motorbikes, vans, bycicles and also official vehicles such as police cars. A wide set of these actors is provided in [carla.BlueprintLibrary](#carla.BlueprintLibrary) to facilitate differente requirements. Vehicles can be either manually controlled or set to an autopilot mode that will be conducted client-side by the <b>traffic manager</b>.
### Instance Variables
- <a name="carla.Vehicle.bounding_box"></a>**<font color="#f8805a">bounding_box</font>** (_[carla.BoundingBox](#carla.BoundingBox)_)
Bounding box containing the geometry of the vehicle. Its location and rotation are relative to the vehicle it is attached to.
### Methods
- <a name="carla.Vehicle.apply_ackermann_control"></a>**<font color="#7fb800">apply_ackermann_control</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**control**</font>)
Applies an Ackermann control object on the next tick.
- **Parameters:**
- `control` (_[carla.VehicleAckermannControl](#carla.VehicleAckermannControl)_)
- <a name="carla.Vehicle.apply_ackermann_controller_settings"></a>**<font color="#7fb800">apply_ackermann_controller_settings</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**settings**</font>)
Applies a new Ackermann control settings to this vehicle in the next tick.
- **Parameters:**
- `settings` (_[carla.AckermannControllerSettings](#carla.AckermannControllerSettings)_)
- **Warning:** <font color="#ED2F2F">_This method does call the simulator._</font>
- <a name="carla.Vehicle.apply_control"></a>**<font color="#7fb800">apply_control</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**control**</font>)
Applies a control object on the next tick, containing driving parameters such as throttle, steering or gear shifting.
- **Parameters:**
@ -2785,19 +2842,48 @@ Applies a control object on the next tick, containing driving parameters such as
Applies a physics control object in the next tick containing the parameters that define the vehicle as a corporeal body. E.g.: moment of inertia, mass, drag coefficient and many more.
- **Parameters:**
- `physics_control` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_)
- <a name="carla.Vehicle.close_door"></a>**<font color="#7fb800">close_door</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**door_idx**</font>)
Close the door `door_idx` if the vehicle has it. Use [carla.VehicleDoor.All](#carla.VehicleDoor.All) to close all available doors.
- **Parameters:**
- `door_idx` (_[carla.VehicleDoor](#carla.VehicleDoor)_) - door index.
- <a name="carla.Vehicle.enable_carsim"></a>**<font color="#7fb800">enable_carsim</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**simfile_path**</font>)
Enables the CarSim physics solver for this particular vehicle. In order for this function to work, there needs to be a valid license manager running on the server side. The control inputs are redirected to CarSim which will provide the position and orientation of the vehicle for every frame.
- **Parameters:**
- `simfile_path` (_str_) - Path to the `.simfile` file with the parameters of the simulation.
- <a name="carla.Vehicle.enable_chrono_physics"></a>**<font color="#7fb800">enable_chrono_physics</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**max_substeps**</font>, <font color="#00a6ed">**max_substep_delta_time**</font>, <font color="#00a6ed">**vehicle_json**</font>, <font color="#00a6ed">**powertrain_json**</font>, <font color="#00a6ed">**tire_json**</font>, <font color="#00a6ed">**base_json_path**</font>)
Enables Chrono physics on a spawned vehicle.
- **Parameters:**
- `max_substeps` (_int_) - Max number of Chrono substeps.
- `max_substep_delta_time` (_int_) - Max size of substep.
- `vehicle_json` (_str_) - Path to vehicle json file relative to `base_json_path`.
- `powertrain_json` (_str_) - Path to powertrain json file relative to `base_json_path`.
- `tire_json` (_str_) - Path to tire json file relative to `base_json_path`.
- `base_json_path` (_str_) - Path to `chrono/data/vehicle` folder. E.g., `/home/user/carla/Build/chrono-install/share/chrono/data/vehicle/` (the final `/` character is required).
- **Note:** <font color="#8E8E8E">_Ensure that you have started the CARLA server with the `ARGS="--chrono"` flag. You will not be able to use Chrono physics without this flag set.
_</font>
- **Warning:** <font color="#ED2F2F">_Collisions are not supported. When a collision is detected, physics will revert to the default CARLA physics.
_</font>
- <a name="carla.Vehicle.is_at_traffic_light"></a>**<font color="#7fb800">is_at_traffic_light</font>**(<font color="#00a6ed">**self**</font>)
Vehicles will be affected by a traffic light when the light is red and the vehicle is inside its bounding box. The client returns whether a traffic light is affecting this vehicle according to last tick (it does not call the simulator).
- **Return:** _bool_
- <a name="carla.Vehicle.open_door"></a>**<font color="#7fb800">open_door</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**door_idx**</font>)
Open the door `door_idx` if the vehicle has it. Use [carla.VehicleDoor.All](#carla.VehicleDoor.All) to open all available doors.
- **Parameters:**
- `door_idx` (_[carla.VehicleDoor](#carla.VehicleDoor)_) - door index.
- <a name="carla.Vehicle.show_debug_telemetry"></a>**<font color="#7fb800">show_debug_telemetry</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**enabled**=True</font>)
Enables or disables the telemetry on this vehicle. This shows information about the vehicles current state and forces applied to it in the spectator window. Only information for one vehicle can be shown so that, if you enable a second one, the previous will be automatically disabled.
- **Parameters:**
- `enabled` (_bool_)
- <a name="carla.Vehicle.use_carsim_road"></a>**<font color="#7fb800">use_carsim_road</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**enabled**</font>)
Enables or disables the usage of CarSim vs terrain file specified in the `.simfile`. By default this option is disabled and CarSim uses unreal engine methods to process the geometry of the scene.
- **Parameters:**
- `enabled` (_bool_)
##### Getters
- <a name="carla.Vehicle.get_ackermann_controller_settings"></a>**<font color="#7fb800">get_ackermann_controller_settings</font>**(<font color="#00a6ed">**self**</font>)
Returns the last Ackermann control settings applied to this vehicle.
- **Return:** _[carla.AckermannControllerSettings](#carla.AckermannControllerSettings)_
- **Warning:** <font color="#ED2F2F">_This method does call the simulator to retrieve the value._</font>
- <a name="carla.Vehicle.get_control"></a>**<font color="#7fb800">get_control</font>**(<font color="#00a6ed">**self**</font>)
The client returns the control applied in the last tick. The method does not call the simulator.
- **Return:** _[carla.VehicleControl](#carla.VehicleControl)_
@ -2853,6 +2939,37 @@ _</font>
---
## carla.VehicleAckermannControl<a name="carla.VehicleAckermannControl"></a>
Manages the basic movement of a vehicle using Ackermann driving controls.
### Instance Variables
- <a name="carla.VehicleAckermannControl.steer"></a>**<font color="#f8805a">steer</font>** (_float_)
Desired steer (rad). Positive value is to the right. Default is 0.0.
- <a name="carla.VehicleAckermannControl.steer_speed"></a>**<font color="#f8805a">steer_speed</font>** (_float_)
Steering velocity (rad/s). Zero steering angle velocity means change the steering angle as quickly as possible. Default is 0.0.
- <a name="carla.VehicleAckermannControl.speed"></a>**<font color="#f8805a">speed</font>** (_float_)
Desired speed (m/s). Default is 0.0.
- <a name="carla.VehicleAckermannControl.acceleration"></a>**<font color="#f8805a">acceleration</font>** (_float_)
Desired acceleration (m/s2) Default is 0.0.
- <a name="carla.VehicleAckermannControl.jerk"></a>**<font color="#f8805a">jerk</font>** (_float_)
Desired jerk (m/s3). Default is 0.0.
### Methods
- <a name="carla.VehicleAckermannControl.__init__"></a>**<font color="#7fb800">\__init__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**steer**=0.0</font>, <font color="#00a6ed">**steer_speed**=0.0</font>, <font color="#00a6ed">**speed**=0.0</font>, <font color="#00a6ed">**acceleration**=0.0</font>, <font color="#00a6ed">**jerk**=0.0</font>)
- **Parameters:**
- `steer` (_float_)
- `steer_speed` (_float_)
- `speed` (_float_)
- `acceleration` (_float_)
- `jerk` (_float_)
##### Dunder methods
- <a name="carla.VehicleAckermannControl.__eq__"></a>**<font color="#7fb800">\__eq__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**other**=[carla.AckermannVehicleControl](#carla.AckermannVehicleControl)</font>)
- <a name="carla.VehicleAckermannControl.__ne__"></a>**<font color="#7fb800">\__ne__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**other**=[carla.AckermannVehicleControl](#carla.AckermannVehicleControl)</font>)
- <a name="carla.VehicleAckermannControl.__str__"></a>**<font color="#7fb800">\__str__</font>**(<font color="#00a6ed">**self**</font>)
---
## carla.VehicleControl<a name="carla.VehicleControl"></a>
Manages the basic movement of a vehicle using typical driving controls.
@ -3033,10 +3150,6 @@ Back wheel of a 2 wheeled vehicle.
<small style="display:block;margin-top:-20px;">Inherited from _[carla.Actor](#carla.Actor)_</small></br>
This class inherits from the [carla.Actor](#carla.Actor) and defines pedestrians in the simulation. Walkers are a special type of actor that can be controlled either by an AI ([carla.WalkerAIController](#carla.WalkerAIController)) or manually via script, using a series of [carla.WalkerControl](#carla.WalkerControl) to move these and their skeletons.
### Instance Variables
- <a name="carla.Walker.bounding_box"></a>**<font color="#f8805a">bounding_box</font>** (_[carla.BoundingBox](#carla.BoundingBox)_)
Bounding box containing the geometry of the walker. Its location and rotation are relative to the walker it is attached to.
### Methods
- <a name="carla.Walker.apply_control"></a>**<font color="#7fb800">apply_control</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**control**</font>)
On the next tick, the control will move the walker in a certain direction with a certain speed. Jumps can be commanded too.
@ -3180,13 +3293,17 @@ Waypoints in CARLA are described as 3D directed points. They have a [carla.Trans
### Instance Variables
- <a name="carla.Waypoint.id"></a>**<font color="#f8805a">id</font>** (_int_)
The identificator is generated using a hash combination of the <b>road</b>, <b>section</b>, <b>lane</b> and <b>s</b> values that correspond to said point in the OpenDRIVE geometry. The <b>s</b> precision is set to 2 centimeters, so 2 waypoints closer than 2 centimeters in the same road, section and lane, will have the same identificator.
The identifier is generated using a hash combination of the <b>road</b>, <b>section</b>, <b>lane</b> and <b>s</b> values that correspond to said point in the OpenDRIVE geometry. The <b>s</b> precision is set to 2 centimeters, so 2 waypoints closer than 2 centimeters in the same road, section and lane, will have the same identificator.
- <a name="carla.Waypoint.transform"></a>**<font color="#f8805a">transform</font>** (_[carla.Transform](#carla.Transform)_)
Position and orientation of the waypoint according to the current lane information. This data is computed the first time it is accessed. It is not created right away in order to ease computing costs when lots of waypoints are created but their specific transform is not needed.
- <a name="carla.Waypoint.road_id"></a>**<font color="#f8805a">road_id</font>** (_int_)
OpenDRIVE road's id.
- <a name="carla.Waypoint.section_id"></a>**<font color="#f8805a">section_id</font>** (_int_)
OpenDRIVE section's id, based on the order that they are originally defined.
- <a name="carla.Waypoint.is_junction"></a>**<font color="#f8805a">is_junction</font>** (_bool_)
True if the current Waypoint is on a junction as defined by OpenDRIVE.
- <a name="carla.Waypoint.junction_id"></a>**<font color="#f8805a">junction_id</font>** (_int_)
OpenDRIVE junction's id. For more information refer to OpenDRIVE [documentation](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf#page=20).
- <a name="carla.Waypoint.lane_id"></a>**<font color="#f8805a">lane_id</font>** (_int_)
OpenDRIVE lane's id, this value can be positive or negative which represents the direction of the current lane with respect to the road. For more information refer to OpenDRIVE [documentation](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf#page=20).
- <a name="carla.Waypoint.s"></a>**<font color="#f8805a">s</font>** (_float_)
@ -3230,7 +3347,7 @@ Returns a list of waypoints from this to the start of the lane separated by a ce
##### Getters
- <a name="carla.Waypoint.get_junction"></a>**<font color="#7fb800">get_junction</font>**(<font color="#00a6ed">**self**</font>)
If the waypoint belongs to a junction this method returns the asociated junction object. Otherwise returns null.
If the waypoint belongs to a junction this method returns the associated junction object. Otherwise returns null.
- **Return:** _[carla.Junction](#carla.Junction)_
- <a name="carla.Waypoint.get_landmarks"></a>**<font color="#7fb800">get_landmarks</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**distance**</font>, <font color="#00a6ed">**stop_at_junction**=False</font>)
Returns a list of landmarks in the road from the current waypoint until the specified distance.
@ -3440,7 +3557,7 @@ Freezes or unfreezes all traffic lights in the scene. Frozen traffic lights can
- **Parameters:**
- `frozen` (_bool_)
- <a name="carla.World.ground_projection"></a>**<font color="#7fb800">ground_projection</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**location**</font>, <font color="#00a6ed">**search_distance**</font>)
Projects the specified point downwards in the scene. The functions casts a ray from location in the direction (0,0,-1) (downwards) and returns a [carla.Labelled](#carla.Labelled) object with the first geometry this ray intersects (usually the ground). If no geometry is found in the search_distance range the function returns `None`.
Projects the specified point downwards in the scene. The functions casts a ray from location in the direction (0,0,-1) (downwards) and returns a [carla.LabelledPoint](#carla.LabelledPoint) object with the first geometry this ray intersects (usually the ground). If no geometry is found in the search_distance range the function returns `None`.
- **Parameters:**
- `location` (_[carla.Location](#carla.Location)_) - The point to be projected.
- `search_distance` (_float_) - The maximum distance to perform the projection.
@ -3665,7 +3782,7 @@ This snapshot comprises all the information for every actor on scene at a certai
### Instance Variables
- <a name="carla.WorldSnapshot.id"></a>**<font color="#f8805a">id</font>** (_int_)
A value unique for every snapshot to differenciate them.
A value unique for every snapshot to differentiate them.
- <a name="carla.WorldSnapshot.frame"></a>**<font color="#f8805a">frame</font>** (_int_)
Simulation frame in which the snapshot was taken.
- <a name="carla.WorldSnapshot.timestamp"></a>**<font color="#f8805a">timestamp</font>** (_[carla.Timestamp](#carla.Timestamp)<small> - seconds</small>_)
@ -3817,6 +3934,23 @@ Transformation to be applied.
---
## command.ApplyVehicleAckermannControl<a name="command.ApplyVehicleAckermannControl"></a>
Command adaptation of __<font color="#7fb800">apply_ackermann_control()</font>__ in [carla.Vehicle](#carla.Vehicle). Applies a certain akermann control to a vehicle.
### Instance Variables
- <a name="command.ApplyVehicleAckermannControl.actor_id"></a>**<font color="#f8805a">actor_id</font>** (_int_)
Vehicle actor affected by the command.
- <a name="command.ApplyVehicleAckermannControl.control"></a>**<font color="#f8805a">control</font>** (_[carla.AckermannVehicleControl](#carla.AckermannVehicleControl)_)
Vehicle ackermann control to be applied.
### Methods
- <a name="command.ApplyVehicleAckermannControl.__init__"></a>**<font color="#7fb800">\__init__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**actor**</font>, <font color="#00a6ed">**control**</font>)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `control` (_[carla.AckermannVehicleControl](#carla.AckermannVehicleControl)_)
---
## command.ApplyVehicleControl<a name="command.ApplyVehicleControl"></a>
Command adaptation of __<font color="#7fb800">apply_control()</font>__ in [carla.Vehicle](#carla.Vehicle). Applies a certain control to a vehicle.
@ -3840,14 +3974,14 @@ Command adaptation of __<font color="#7fb800">apply_physics_control()</font>__ i
### Instance Variables
- <a name="command.ApplyVehiclePhysicsControl.actor_id"></a>**<font color="#f8805a">actor_id</font>** (_int_)
Vehicle actor affected by the command.
- <a name="command.ApplyVehiclePhysicsControl.control"></a>**<font color="#f8805a">control</font>** (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_)
- <a name="command.ApplyVehiclePhysicsControl.physics_control"></a>**<font color="#f8805a">physics_control</font>** (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_)
Physics control to be applied.
### Methods
- <a name="command.ApplyVehiclePhysicsControl.__init__"></a>**<font color="#7fb800">\__init__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**actor**</font>, <font color="#00a6ed">**control**</font>)
- <a name="command.ApplyVehiclePhysicsControl.__init__"></a>**<font color="#7fb800">\__init__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**actor**</font>, <font color="#00a6ed">**physics_control**</font>)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `control` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_)
- `physics_control` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_)
---

View File

@ -16,10 +16,22 @@
type: int
doc: >
Identifier for this actor. Unique during a given episode.
- var_name: type_id
type: str
doc: >
The identifier of the blueprint this actor was based on, e.g. `vehicle.ford.mustang`.
- var_name: is_alive
type: bool
doc: >
Returns whether this object was destroyed using this actor handle.
- var_name: is_active
type: bool
doc: >
Returns whether this actor is active (True) or not (False).
- var_name: is_dormant
type: bool
doc: >
Returns whether this actor is dormant (True) or not (False) - the opposite of is_active.
- var_name: parent
type: carla.Actor
doc: >
@ -28,10 +40,14 @@
type: list(int)
doc: >
A list of semantic tags provided by the blueprint listing components for this actor. E.g. a traffic light could be tagged with `Pole` and `TrafficLight`. These tags are used by the semantic segmentation sensor. Find more about this and other sensors [here](ref_sensors.md#semantic-segmentation-camera).
- var_name: type_id
type: str
- var_name: actor_state
type: carla.ActorState
doc: >
The identifier of the blueprint this actor was based on, e.g. `vehicle.ford.mustang`.
Returns the carla.ActorState, which can identify if the actor is Active, Dormant or Invalid.
- var_name: bounding_box
type: carla.BoundingBox
doc: >
Bounding box containing the geometry of the actor. Its location and rotation are relative to the actor it is attached to.
# - METHODS ----------------------------
methods:
@ -86,39 +102,6 @@
doc: >
Disables any constant velocity previously set for a carla.Vehicle actor.
# --------------------------------------
- def_name: enable_chrono_physics
params:
- param_name: max_substeps
type: int
doc: >
Max number of Chrono substeps
- param_name: max_substep_delta_time
type: int
doc: >
Max size of substep
- param_name: vehicle_json
type: str
doc: >
Path to vehicle json file relative to `base_json_path`
- param_name: powertrain_json
type: str
doc: >
Path to powertrain json file relative to `base_json_path`
- param_name: tire_json
type: str
doc: >
Path to tire json file relative to `base_json_path`
- param_name: base_json_path
type: str
doc: >
Path to `chrono/data/vehicle` folder. E.g., `/home/user/carla/Build/chrono-install/share/chrono/data/vehicle/` (the final `/` character is required).
doc: >
Enables Chrono physics on a spawned vehicle.
note: >
Ensure that you have started the CARLA server with the `ARGS="--chrono"` flag. You will not be able to use Chrono physics without this flag set.
warning: >
Collisions are not supported. When a collision is detected, physics will revert to the default CARLA physics.
# --------------------------------------
- def_name: enable_constant_velocity
params:
- param_name: velocity
@ -133,36 +116,6 @@
warning: >
Enabling a constant velocity for a vehicle managed by the [Traffic Manager](https://carla.readthedocs.io/en/latest/adv_traffic_manager/) may cause conflicts. This method overrides any changes in velocity by the TM.
# --------------------------------------
- def_name: show_debug_telemetry
params:
- param_name: enabled
type: bool
default: True
doc: >
Enables or disables the telemetry on this vehicle. This shows information about the vehicles current state and forces applied to it in the spectator window. Only information for one vehicle can be shown so if you enable a second one, the previous will be automatically disabled.
# --------------------------------------
- def_name: open_door
params:
- param_name: door_idx
type: carla.VehicleDoor
doc: >
door index
doc: >
Open the door door_idx if the vehicle has it. Use carla.VehicleDoor.All to open all available doors.
note: >
Only carla.Vehicle actors can use this method.
# --------------------------------------
- def_name: close_door
params:
- param_name: door_idx
type: carla.VehicleDoor
doc: >
door index
doc: >
Close the door door_idx if the vehicle has it. Use carla.VehicleDoor.All to close all available doors.
note: >
Only carla.Vehicle actors can use this method.
# --------------------------------------
- def_name: get_acceleration
return: carla.Vector3D
return_units: m/s<sup>2</sup>
@ -244,6 +197,24 @@
doc: >
Enables or disables gravity for the actor. __Default__ is True.
- class_name: ActorState
# - DESCRIPTION ------------------------
doc: >
Class that defines the state of an actor.
# - PROPERTIES -------------------------
instance_variables:
- var_name: Invalid
doc: >
An actor is Invalid if a problem has occurred.
- var_name: Active
doc: >
An actor is Active when it visualized and can affect other actors.
- var_name: Dormant
doc: >
An actor is Dormant when it is not visualized and will not affect other actors through physics. For example, actors are dormant if they are on an unloaded tile in a large map.
- class_name: VehicleLightState
# - DESCRIPTION ------------------------
doc: >
@ -281,7 +252,7 @@
parent: carla.Actor
# - DESCRIPTION ------------------------
doc: >
One of the most important group of actors in CARLA. These include any type of vehicle from cars to trucks, motorbikes, vans, bycicles and also official vehicles such as police cars. A wide set of these actors is provided in carla.BlueprintLibrary to facilitate differente requirements. Vehicles can be either manually controlled or set to an autopilot mode that will be conducted client-side by the <b>traffic manager</b>.
One of the most important groups of actors in CARLA. These include any type of vehicle from cars to trucks, motorbikes, vans, bycicles and also official vehicles such as police cars. A wide set of these actors is provided in carla.BlueprintLibrary to facilitate differente requirements. Vehicles can be either manually controlled or set to an autopilot mode that will be conducted client-side by the <b>traffic manager</b>.
# - PROPERTIES -------------------------
instance_variables:
- var_name: bounding_box
@ -295,7 +266,28 @@
- param_name: control
type: carla.VehicleControl
doc: >
Applies a control object on the next tick, containing driving parameters such as throttle, steering or gear shifting.
Applies a control object on the next tick, containing driving parameters such as throttle, steering or gear shifting.
# --------------------------------------
- def_name: apply_ackermann_control
params:
- param_name: control
type: carla.VehicleAckermannControl
doc: >
Applies an Ackermann control object on the next tick.
# --------------------------------------
- def_name: apply_ackermann_controller_settings
params:
- param_name: settings
type: carla.AckermannControllerSettings
doc: >
Applies a new Ackermann control settings to this vehicle in the next tick.
warning: This method does call the simulator.
# --------------------------------------
- def_name: get_ackermann_controller_settings
return: carla.AckermannControllerSettings
doc: >
Returns the last Ackermann control settings applied to this vehicle.
warning: This method does call the simulator to retrieve the value.
# --------------------------------------
- def_name: apply_physics_control
params:
@ -360,6 +352,39 @@
doc: >
Enables or disables the usage of CarSim vs terrain file specified in the `.simfile`. By default this option is disabled and CarSim uses unreal engine methods to process the geometry of the scene.
# --------------------------------------
- def_name: enable_chrono_physics
params:
- param_name: max_substeps
type: int
doc: >
Max number of Chrono substeps
- param_name: max_substep_delta_time
type: int
doc: >
Max size of substep
- param_name: vehicle_json
type: str
doc: >
Path to vehicle json file relative to `base_json_path`
- param_name: powertrain_json
type: str
doc: >
Path to powertrain json file relative to `base_json_path`
- param_name: tire_json
type: str
doc: >
Path to tire json file relative to `base_json_path`
- param_name: base_json_path
type: str
doc: >
Path to `chrono/data/vehicle` folder. E.g., `/home/user/carla/Build/chrono-install/share/chrono/data/vehicle/` (the final `/` character is required).
doc: >
Enables Chrono physics on a spawned vehicle.
note: >
Ensure that you have started the CARLA server with the `ARGS="--chrono"` flag. You will not be able to use Chrono physics without this flag set.
warning: >
Collisions are not supported. When a collision is detected, physics will revert to the default CARLA physics.
# --------------------------------------
- def_name: set_autopilot
params:
- param_name: enabled
@ -408,6 +433,31 @@
doc: >
Vehicle have failure states, to indicate that it is incapable of continuing its route. This function returns the vehicle's specific failure state, or in other words, the cause that resulted in it.
# --------------------------------------
- def_name: show_debug_telemetry
params:
- param_name: enabled
type: bool
default: True
doc: >
Enables or disables the telemetry on this vehicle. This shows information about the vehicles current state and forces applied to it in the spectator window. Only information for one vehicle can be shown so that, if you enable a second one, the previous will be automatically disabled.
# --------------------------------------
- def_name: open_door
params:
- param_name: door_idx
type: carla.VehicleDoor
doc: >
door index
doc: >
Open the door `door_idx` if the vehicle has it. Use carla.VehicleDoor.All to open all available doors.
# --------------------------------------
- def_name: close_door
params:
- param_name: door_idx
type: carla.VehicleDoor
doc: >
door index
doc: >
Close the door `door_idx` if the vehicle has it. Use carla.VehicleDoor.All to close all available doors.
- class_name: Walker
@ -416,11 +466,6 @@
doc: >
This class inherits from the carla.Actor and defines pedestrians in the simulation. Walkers are a special type of actor that can be controlled either by an AI (carla.WalkerAIController) or manually via script, using a series of carla.WalkerControl to move these and their skeletons.
# - PROPERTIES -------------------------
instance_variables:
- var_name: bounding_box
type: carla.BoundingBox
doc: >
Bounding box containing the geometry of the walker. Its location and rotation are relative to the walker it is attached to.
# - METHODS ----------------------------
methods:
- def_name: apply_control
@ -669,6 +714,8 @@
# --------------------------------------
- def_name: __str__
# --------------------------------------
- class_name: VehicleWheelLocation
doc: >
`enum` representing the position of each wheel on a vehicle.
@ -694,6 +741,7 @@
doc: >
Back wheel of a 2 wheeled vehicle.
# --------------------------------------
- class_name: VehicleDoor
doc: >
Possible index representing the possible doors that can be open.

View File

@ -327,6 +327,7 @@
doc: >
Filters a list of blueprints matching the `wildcard_pattern` against the id and tags of every blueprint contained in this library and returns the result as a new one. Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard.
return: carla.BlueprintLibrary
# --------------------------------------
- def_name: filter_by_attribute
params:
- param_name: name

View File

@ -305,6 +305,13 @@
type: bool
doc: >
Enables or disables playback of the hero vehicle during a playback of a recorded simulation.
# --------------------------------------
- def_name: set_replayer_ignore_spectator
params:
- param_name: ignore_spectator
type: bool
doc: >
Determines whether the recorded spectator movements will be replicated by the replayer.
# --------------------------------------
- def_name: set_files_base_folder
params:
@ -717,6 +724,10 @@
doc: >
Adjust probability that in each timestep the actor will perform a right lane change, dependent on lane change availability.
# --------------------------------------
- def_name: shut_down
doc: >
Shuts down the traffic manager.
# --------------------------------------
- class_name: OpendriveGenerationParameters
# - DESCRIPTION ------------------------

View File

@ -101,7 +101,7 @@
type: int
doc: >
Vehicle actor affected by the command.
- var_name: control
- var_name: physics_control
type: carla.VehiclePhysicsControl
doc: >
Physics control to be applied.
@ -113,7 +113,7 @@
type: carla.Actor or int
doc: >
Actor or its ID to whom the command will be applied to.
- param_name: control
- param_name: physics_control
type: carla.VehiclePhysicsControl
# --------------------------------------
@ -143,6 +143,32 @@
type: carla.VehicleControl
# --------------------------------------
- class_name: ApplyVehicleAckermannControl
# - DESCRIPTION ------------------------
doc: >
Command adaptation of __<font color="#7fb800">apply_ackermann_control()</font>__ in carla.Vehicle. Applies a certain akermann control to a vehicle.
# - PROPERTIES -------------------------
instance_variables:
- var_name: actor_id
type: int
doc: >
Vehicle actor affected by the command.
- var_name: control
type: carla.AckermannVehicleControl
doc: >
Vehicle ackermann control to be applied.
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
- param_name: actor
type: carla.Actor or int
doc: >
Actor or its ID to whom the command will be applied to.
- param_name: control
type: carla.AckermannVehicleControl
# --------------------------------------
- class_name: ApplyWalkerControl
# - DESCRIPTION ------------------------
doc: >

View File

@ -86,6 +86,140 @@
- def_name: __str__
# --------------------------------------
- class_name: VehicleAckermannControl
# - DESCRIPTION ------------------------
doc: >
Manages the basic movement of a vehicle using Ackermann driving controls.
# - PROPERTIES -------------------------
instance_variables:
- var_name: steer
type: float
doc: >
Desired steer (rad). Positive value is to the right. Default is 0.0.
# --------------------------------------
- var_name: steer_speed
type: float
doc: >
Steering velocity (rad/s). Zero steering angle velocity means change the steering angle as quickly as possible. Default is 0.0.
# --------------------------------------
- var_name: speed
type: float
doc: >
Desired speed (m/s). Default is 0.0.
# --------------------------------------
- var_name: acceleration
type: float
doc: >
Desired acceleration (m/s2) Default is 0.0.
# --------------------------------------
- var_name: jerk
type: float
doc: >
Desired jerk (m/s3). Default is 0.0.
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
- param_name: steer
type: float
default: 0.0
- param_name: steer_speed
type: float
default: 0.0
- param_name: speed
type: float
default: 0.0
- param_name: acceleration
type: float
default: 0.0
- param_name: jerk
type: float
default: 0.0
# --------------------------------------
- def_name: __eq__
params:
- param_name: other
type: carla.AckermannVehicleControl
# --------------------------------------
- def_name: __ne__
params:
- param_name: other
type: carla.AckermannVehicleControl
# --------------------------------------
- def_name: __str__
# --------------------------------------
- class_name: AckermannControllerSettings
# - DESCRIPTION ------------------------
doc: >
Manages the settings of the Ackermann PID controller.
# - PROPERTIES -------------------------
instance_variables:
- var_name: speed_kp
type: float
doc: >
Proportional term of the speed PID controller.
# --------------------------------------
- var_name: speed_ki
type: float
doc: >
Integral term of the speed PID controller.
# --------------------------------------
- var_name: speed_kd
type: float
doc: >
Derivative term of the speed PID controller.
# --------------------------------------
- var_name: accel_kp
type: float
doc: >
Proportional term of the acceleration PID controller.
# --------------------------------------
- var_name: accel_ki
type: float
doc: >
Integral term of the acceleration PID controller.
# --------------------------------------
- var_name: accel_kd
type: float
doc: >
Derivative term of the acceleration PID controller.
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
- param_name: speed_kp
type: float
default: 0.15
- param_name: speed_ki
type: float
default: 0.0
- param_name: speed_kd
type: float
default: 0.25
- param_name: accel_kp
type: float
default: 0.01
- param_name: accel_ki
type: float
default: 0.0
- param_name: accel_kd
type: float
default: 0.01
# --------------------------------------
- def_name: __eq__
params:
- param_name: other
type: carla.AckermannControllerSettings
# --------------------------------------
- def_name: __ne__
params:
- param_name: other
type: carla.AckermannControllerSettings
# --------------------------------------
- def_name: __str__
# --------------------------------------
- class_name: WalkerControl
doc: >
This class defines specific directions that can be commanded to a carla.Walker to control it via script.

View File

@ -192,6 +192,14 @@
doc: >
Computes the 2-dimensional squared distance between two vectors.
# --------------------------------------
- def_name: get_vector_angle
return: float
params:
- param_name: vector
type: carla.Vector3D
doc: >
Computes the angle between a pair of 3D vectors in radians.
# --------------------------------------
- def_name: __add__
params:
- param_name: other
@ -436,6 +444,15 @@
doc: >
Translates a 3D point from local to global coordinates using the current transformation as frame of reference.
# --------------------------------------
- def_name: transform_vector
params:
- param_name: in_vector
type: carla.Vector3D
doc: >
Vector to which the transformation will be applied.
doc: >
Rotates a vector using the current transformation as frame of reference, without applying translation. Use this to transform, for example, a velocity.
# --------------------------------------
- def_name: get_forward_vector
return: carla.Vector3D
doc: >
@ -444,7 +461,7 @@
- def_name: get_right_vector
return: carla.Vector3D
doc: >
Computes a right vector using the rotatio of the object.
Computes a right vector using the rotation of the object.
# --------------------------------------
- def_name: get_up_vector
return: carla.Vector3D

View File

@ -275,6 +275,15 @@
Returns a list of locations with all crosswalk zones in the form of closed polygons. The first point is repeated, symbolizing where the polygon begins and ends.
return: list(carla.Location)
# --------------------------------------
- def_name: cook_in_memory_map
params:
- param_name: path
type: str
doc: >
Path to the intended location of the stored binary map file.
doc: >
Generates a binary file from the CARLA map containing information used by the Traffic Manager. This method is only used during the import process for maps.
# --------------------------------------
- def_name: __str__
# --------------------------------------
@ -313,7 +322,7 @@
- var_name: id
type: int
doc: >
The identificator is generated using a hash combination of the <b>road</b>, <b>section</b>, <b>lane</b> and <b>s</b> values that correspond to said point in the OpenDRIVE geometry. The <b>s</b> precision is set to 2 centimeters, so 2 waypoints closer than 2 centimeters in the same road, section and lane, will have the same identificator.
The identifier is generated using a hash combination of the <b>road</b>, <b>section</b>, <b>lane</b> and <b>s</b> values that correspond to said point in the OpenDRIVE geometry. The <b>s</b> precision is set to 2 centimeters, so 2 waypoints closer than 2 centimeters in the same road, section and lane, will have the same identificator.
- var_name: transform
type: carla.Transform
doc: >
@ -326,6 +335,14 @@
type: int
doc: >
OpenDRIVE section's id, based on the order that they are originally defined.
- var_name: is_junction
type: bool
doc: >
True if the current Waypoint is on a junction as defined by OpenDRIVE.
- var_name: junction_id
type: int
doc: >
OpenDRIVE junction's id. For more information refer to OpenDRIVE [documentation](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf#page=20)
- var_name: lane_id
type: int
doc: >
@ -413,7 +430,7 @@
- def_name: get_junction
return: carla.Junction
doc: >
If the waypoint belongs to a junction this method returns the asociated junction object. Otherwise returns null.
If the waypoint belongs to a junction this method returns the associated junction object. Otherwise returns null.
# --------------------------------------
- def_name: get_landmarks
params:
@ -477,7 +494,7 @@
- var_name: id
type: int
doc: >
Identificator found in the OpenDRIVE file.
Identifier found in the OpenDRIVE file.
- var_name: bounding_box
type: carla.BoundingBox
doc: >
@ -686,11 +703,11 @@
- var_name: type
type: str
doc: >
Type identificator of the landmark according to the country code.
Type identifier of the landmark according to the country code.
- var_name: sub_type
type: str
doc: >
Subtype identificator of the landmark according to the country code.
Subtype identifier of the landmark according to the country code.
- var_name: value
type: float
doc: >

View File

@ -29,6 +29,7 @@
doc: >
Takes the content of an <code>.osm</code> file (OpenStreetMap format) and returns the content of the <code>.xodr</code> (OpenDRIVE format) describing said map. Some parameterization is passed to do the conversion.
# --------------------------------------
- class_name: Osm2OdrSettings
# - DESCRIPTION ------------------------
doc: >

View File

@ -41,7 +41,7 @@
instance_variables:
- var_name: CityScapesPalette
doc: >
Converts the image to a segmentated map using tags provided by the blueprint library. Used by the [semantic segmentation camera](ref_sensors.md#semantic-segmentation-camera).
Converts the image to a segmented map using tags provided by the blueprint library. Used by the [semantic segmentation camera](ref_sensors.md#semantic-segmentation-camera).
- var_name: Depth
doc: >
Converts the image to a linear depth map. Used by the [depth camera](ref_sensors.md#depth-camera).
@ -106,6 +106,8 @@
Image width in pixels.
- var_name: raw_data
type: bytes
doc: >
Flattened array of pixel data, use reshape to create an image array.
# - METHODS ----------------------------
methods:
- def_name: convert
@ -172,6 +174,8 @@
Image width in pixels.
- var_name: raw_data
type: bytes
doc: >
Flattened array of pixel data, use reshape to create an image array.
# - METHODS ----------------------------
methods:
- def_name: get_color_coded_flow
@ -221,7 +225,7 @@
- var_name: raw_data
type: bytes
doc: >
Received list of 4D points. Each point consists of [x,y,z] coordiantes plus the intensity computed for that point.
Received list of 4D points. Each point consists of [x,y,z] coordinates plus the intensity computed for that point.
# - METHODS ----------------------------
methods:
- def_name: save_to_disk
@ -263,7 +267,7 @@
- class_name: LidarDetection
# - DESCRIPTION ------------------------
doc: >
Data contained inside a carla.LidarMeasurement. Each of these represents one of the points in the cloud with its location and its asociated intensity.
Data contained inside a carla.LidarMeasurement. Each of these represents one of the points in the cloud with its location and its associated intensity.
# - PROPERTIES -------------------------
instance_variables:
- var_name: point
@ -613,6 +617,7 @@
Part of the data contained inside a carla.RssResponse describing the state of the vehicle. The parameters include its current dynamics, and how it is heading regarding the target route.
# - PROPERTIES -------------------------
instance_variables:
## ** Missing timestamp and time_since_epoch_check_start_ms
- var_name: ego_speed
type: <a href="https://ad-map-access.readthedocs.io/en/latest/ad_physics/apidoc/html/classad_1_1physics_1_1Speed.html">ad.physics.Speed</a>
doc: >

View File

@ -12,7 +12,7 @@
- var_name: id
type: int
doc: >
A value unique for every snapshot to differenciate them.
A value unique for every snapshot to differentiate them.
- var_name: frame
type: int
doc: >

View File

@ -278,7 +278,7 @@
instance_variables:
- var_name: Rigid
doc: >
With this fixed attatchment the object follow its parent position strictly. This is the recommended attachment to retrieve precise data from the simulation.
With this fixed attachment the object follow its parent position strictly. This is the recommended attachment to retrieve precise data from the simulation.
- var_name: SpringArm
doc: >
An attachment that expands or retracts the position of the actor, depending on its parent. This attachment is only recommended to record videos from the simulation where a smooth movement is needed. SpringArms are an Unreal Engine component so [check the UE docs](https://docs.unrealengine.com/en-US/Gameplay/HowTo/UsingCameras/SpringArmComponents/index.html) to learn more about them. <br><b style="color:red;">Warning:</b> The <b>SpringArm</b> attachment presents weird behaviors when an actor is spawned with a relative translation in the Z-axis (e.g. <code>child_location = Location(0,0,2)</code>).
@ -790,7 +790,7 @@
doc: >
The maximum distance to perform the projection
doc: >
Projects the specified point downwards in the scene. The functions casts a ray from location in the direction (0,0,-1) (downwards) and returns a carla.Labelled object with the first geometry this ray intersects (usually the ground). If no geometry is found in the search_distance range the function returns `None`.
Projects the specified point downwards in the scene. The functions casts a ray from location in the direction (0,0,-1) (downwards) and returns a carla.LabelledPoint object with the first geometry this ray intersects (usually the ground). If no geometry is found in the search_distance range the function returns `None`.
# --------------------------------------
- def_name: load_map_layer
params: