@ -74,7 +74,7 @@ CARLA has a [recorder feature](adv_recorder.md) that allows a simulation to be r
Physics must be computed within very low time steps to be precise. The more time goes by, the more variables and chaos come to place, and the more defective the simulation will be.
CARLA uses up to 6 substeps to compute physics in every step, each with a maximum delta time of 0.016667s.
To know how many of these are needed, the time-step used gets divided by the maximum delta time a substep can use `number_of_substeps = time_step/0.016667`. Being these a maximum of 6, `6*0.016667 = 0.1`. If the time-step is greater than `0.1``, there will not be enough physical substeps. Physics will not be in synchrony with the delta time.
To know how many of these are needed, the time-step used gets divided by the maximum delta time a substep can use `number_of_substeps = time_step/0.016667`. Being these a maximum of 6, `6*0.016667 = 0.1`. If the time-step is greater than `0.1`, there will not be enough physical substeps. Physics will not be in synchrony with the delta time.
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 "traffic light". These tags are used by the semantic segmentation sensor. Find more about this and other sensors [here](ref_sensors.md#semantic-segmentation-camera).
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).
Adds an angular impulse to the actor. The parameter `impulse` determines magnitude and global axis where it is applied.
Applies an angular impulse at the center of mass of the actor. Angular impulses are instantaneous. Use __<fontcolor="#7fb800">add_torque()</font>__ to apply rotation forces over time.
Applies an impulse at the center of mass of the actor. Impulses are instantaneous. Use __<fontcolor="#7fb800">add_force()</font>__ to apply forces over time.
- **Parameters:**
- `impulse` (_[carla.Vector3D](#carla.Vector3D)<small>– degrees</small>_) – Impulse vector in global coordinates.
Applies a force at the center of mass of the actor. The effects of the force depend on the delta time (time between simulation steps) during which it is applied. Use __<fontcolor="#7fb800">add_angular_impulse()</font>__ to apply an instantaneous rotation impulse.
- **Parameters:**
- `force` (_[carla.Vector3D](#carla.Vector3D)_) – Force vector in global coordinates.
Applies a torque at the center of mass of the actor. The effects of the torque depend on the delta time (time between simulation steps) during which it is applied. Use __<fontcolor="#7fb800">add_angular_impulse()</font>__ to apply an instantaneous rotation impulse.
- **Parameters:**
- `torque` (_[carla.Vector3D](#carla.Vector3D)_) – Torque vector in global coordinates.
Sets the actor's velocity vector to a constant value over time. The modification is instantaneous. The resulting velocity will not be exactly the `velocity` being set. It will be affected by external forces such as friction.
- **Parameters:**
- `velocity` (_[carla.Vector3D](#carla.Vector3D)_) – Velocity vector in local space.
- **Warning:**<fontcolor="#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. It will not be able to override the constant velocity being set.
Sets the actor's angular velocity vector. The modification is instantaneous, and done before physics. The resulting angular velocity will be affected by external forces over time (such as friction).
Sets the actor's velocity vector. The modification is instantaneous, and done before physics. The resulting velocity will be affected by external forces over time (such as friction).
Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the **<fontcolor="#7fb800">apply_batch_sync()</font>** function right below this one. [Here](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L126) is an example on how to delete the actors that appear in [carla.ActorList](#carla.ActorList) all at once.
Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the __<fontcolor="#7fb800">apply_batch_sync()</font>__ method. [Here](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L126) is an example on how to delete the actors that appear in [carla.ActorList](#carla.ActorList) all at once.
- **Parameters:**
- `commands` (_list_) – A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page.
Executes a list of commands on a single simulation step, blocks until the commands are linked, and returns a list of <b>command.Response</b> that can be used to determine whether a single command succeeded or not. [Here](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L112-L116) is an example of it being used to spawn actors.
- **Parameters:**
- `commands` (_list_) – A list of commands to execute in batch. The commands available are listed right above, in the function**<fontcolor="#7fb800">apply_batch()</font>**.
- `commands` (_list_) – A list of commands to execute in batch. The commands available are listed right above, in the method**<fontcolor="#7fb800">apply_batch()</font>**.
- `due_tick_cue` (_bool_) – A boolean parameter to specify whether or not to perform a [carla.World.tick](#carla.World.tick) after applying the batch in _synchronous mode_. It is __False__ by default.
The client returns the speed limit affecting this vehicle according to last tick (it does not call the simulator). The speed limit is updated when passing by a speed limit signal, so a vehicle might have none right after spawning.
- **Return:**_float<small> – m/s</small>_
@ -2485,7 +2501,7 @@ Returns a list of waypoints from this to the start of the lane separated by a ce
Command adaptation of **<fontcolor="#7fb800">set_angular_velocity()</font>** in [carla.Actor](#carla.Actor). Sets an actor's angular velocity.
Command adaptation of **<fontcolor="#7fb800">set_angular_velocity()</font>** in [carla.Actor](#carla.Actor). Sets the actor's angular velocity vector. The modification is instantaneous, and done before physics. The resulting angular velocity will be affected by external forces over time (such as friction).
Command adaptation of **<fontcolor="#7fb800">set_velocity()</font>** in [carla.Actor](#carla.Actor). Sets an actor's velocity.
Command adaptation of **<fontcolor="#7fb800">set_target_velocity()</font>** in [carla.Actor](#carla.Actor). Sets the actor's velocity vector. The modification is instantaneous, and done before physics. The resulting velocity will be affected by external forces over time (such as friction).
- `velocity` (_[carla.Vector3D](#carla.Vector3D)_) – Velocity vector applied to the actor.
---
@ -2950,7 +2966,7 @@ Actor affected by the command.
---
## command.Response<aname="command.Response"></a>
States the result of executing a command as either the ID of the actor to whom the command was applied to (when succeeded) or an error string (when failed). actor ID, depending on whether or not the command succeeded. The method **<fontcolor="#7fb800">apply_batch_sync()</font>** in [carla.Client](#carla.Client) returns a list of these to summarize the execution of a batch.
States the result of executing a command as either the ID of the actor to whom the command was applied to (when succeeded) or an error string (when failed). actor ID, depending on whether or not the command succeeded. The method __<fontcolor="#7fb800">apply_batch_sync()</font>__ in [carla.Client](#carla.Client) returns a list of these to summarize the execution of a batch.
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 "traffic light". These tags are used by the semantic segmentation sensor. Find more about this and other sensors [here](ref_sensors.md#semantic-segmentation-camera).
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
doc:>
The identifier of the blueprint this actor was based on, e.g. "vehicle.ford.mustang".
The identifier of the blueprint this actor was based on, e.g. `vehicle.ford.mustang`.
# - METHODS ----------------------------
methods:
- def_name:add_impulse
params:
- param_name:impulse
type:carla.Vector3D
param_units:N*s
doc:>
Adds an impulse to the actor. The parameter `impulse` determines magnitude and global axis where it is applied.
# --------------------------------------
- def_name:add_angular_impulse
params:
- param_name:impulse
type:carla.Vector3D
param_units:degrees
param_units:N*s
doc:>
Angular impulse vector in global coordinates.
doc:>
Adds an angular impulse to the actor. The parameter `impulse` determines magnitude and global axis where it is applied.
Applies an angular impulse at the center of mass of the actor. Angular impulses are instantaneous. Use __<font color="#7fb800">add_torque()</font>__ to apply rotation forces over time.
# --------------------------------------
- def_name:add_impulse
params:
- param_name:impulse
type:carla.Vector3D
param_units:degrees
doc:>
Impulse vector in global coordinates.
doc:>
Applies an impulse at the center of mass of the actor. Impulses are instantaneous. Use __<font color="#7fb800">add_force()</font>__ to apply forces over time.
# --------------------------------------
- def_name:add_force
params:
- param_name:force
type:carla.Vector3D
doc:>
Force vector in global coordinates.
doc:>
Applies a force at the center of mass of the actor. The effects of the force depend on the delta time (time between simulation steps) during which it is applied. Use __<font color="#7fb800">add_angular_impulse()</font>__ to apply an instantaneous rotation impulse.
# --------------------------------------
- def_name:add_torque
params:
- param_name:torque
type:carla.Vector3D
doc:>
Torque vector in global coordinates.
doc:>
Applies a torque at the center of mass of the actor. The effects of the torque depend on the delta time (time between simulation steps) during which it is applied. Use __<font color="#7fb800">add_angular_impulse()</font>__ to apply an instantaneous rotation impulse.
# --------------------------------------
- def_name:destroy
return:bool
@ -58,6 +80,23 @@
warning:>
This method blocks the script until the destruction is completed by the simulator.
# --------------------------------------
- def_name:disable_constant_velocity
doc:>
Disables any constant velocity previously set for a carla.Vehicle actor.
# --------------------------------------
- def_name:enable_constant_velocity
params:
- param_name:velocity
type:carla.Vector3D
doc:>
Velocity vector in local space.
doc:>
Sets the actor's velocity vector to a constant value over time. The modification is instantaneous. The resulting velocity will not be exactly the `velocity` being set. It will be affected by external forces such as friction.
Note:>
Only carla.Vehicle actors can use this method.
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. It will not be able to override the constant velocity being set.
# --------------------------------------
- def_name:get_acceleration
return:carla.Vector3D
return_units:m/s<sup>2</sup>
@ -92,12 +131,14 @@
doc:>
Returns the world this actor belongs to.
# --------------------------------------
- def_name:set_angular_velocity
- def_name:set_target_angular_velocity
params:
- param_name:angular_velocity
type:carla.Vector3D
doc:>
Changes the actor's angular velocity vector.
Sets the actor's angular velocity vector. The modification is instantaneous, and done before physics. The resulting angular velocity will be affected by external forces over time (such as friction).
note:>
The update will not be effective until two frames after it is set.
# --------------------------------------
- def_name:set_location
params:
@ -122,12 +163,14 @@
doc:>
Teleports the actor to a given transform (location and rotation).
# --------------------------------------
- def_name:set_velocity
- def_name:set_target_velocity
params:
- param_name:velocity
type:carla.Vector3D
doc:>
Sets the actor's velocity vector.
Sets the actor's velocity vector. The modification is instantaneous, and done before physics. The resulting velocity will be affected by external forces over time (such as friction).
note:>
The update will not be effective until two frames after it is set.
# --------------------------------------
- def_name:__str__
# --------------------------------------
@ -211,7 +254,7 @@
return:carla.VehiclePhysicsControl
doc:>
The simulator returns the last physics control applied to this vehicle.
warning:This function does call the simulator to retrieve the value.
warning:This method does call the simulator to retrieve the value.
# --------------------------------------
- def_name:get_speed_limit
return:float
@ -388,13 +431,13 @@
doc:>
Returns all traffic lights in the group this one belongs to.
note:>
This function calls the simulator.
This method calls the simulator.
# --------------------------------------
- def_name:reset_group
doc:>
Resets the state of the traffic lights of the group to the initial state at the start of the simulation.
A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page.
doc:>
Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the **<font color="#7fb800">apply_batch_sync()</font>** function right below this one.
Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the __<font color="#7fb800">apply_batch_sync()</font>__ method.
[Here](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L126) is an example on how to delete the actors that appear in carla.ActorList all at once.
# --------------------------------------
- def_name:apply_batch_sync
@ -50,7 +50,7 @@
- param_name:commands
type:list
doc:>
A list of commands to execute in batch. The commands available are listed right above, in the function **<font color="#7fb800">apply_batch()</font>**.
A list of commands to execute in batch. The commands available are listed right above, in the method **<font color="#7fb800">apply_batch()</font>**.
States the result of executing a command as either the ID of the actor to whom the command was applied to (when succeeded) or an error string (when failed).
actor ID, depending on whether or not the command succeeded. The method **<font color="#7fb800">apply_batch_sync()</font>** in carla.Client returns a list of these to summarize the execution of a batch.
actor ID, depending on whether or not the command succeeded. The method __<font color="#7fb800">apply_batch_sync()</font>__ in carla.Client returns a list of these to summarize the execution of a batch.
# - PROPERTIES -------------------------
instance_variables:
- var_name:actor_id
@ -205,7 +205,7 @@
- class_name:ApplyVelocity
# - DESCRIPTION ------------------------
doc:>
Command adaptation of **<font color="#7fb800">set_velocity()</font>** in carla.Actor. Sets an actor's velocity.
Command adaptation of **<font color="#7fb800">set_target_velocity()</font>** in carla.Actor. Sets the actor's velocity vector. The modification is instantaneous, and done before physics. The resulting velocity will be affected by external forces over time (such as friction).
# - PROPERTIES -------------------------
instance_variables:
- var_name:actor_id
@ -228,12 +228,14 @@
- param_name:velocity
type:carla.Vector3D
param_untis:m/s
doc:>
Velocity vector applied to the actor.
# --------------------------------------
- class_name:ApplyAngularVelocity
# - DESCRIPTION ------------------------
doc:>
Command adaptation of **<font color="#7fb800">set_angular_velocity()</font>** in carla.Actor. Sets an actor's angular velocity.
Command adaptation of **<font color="#7fb800">set_angular_velocity()</font>** in carla.Actor. Sets the actor's angular velocity vector. The modification is instantaneous, and done before physics. The resulting angular velocity will be affected by external forces over time (such as friction).