diff --git a/Docs/python_api.md b/Docs/python_api.md index ee1e09bab..1b7ae0864 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -19,20 +19,20 @@ A list of semantic tags provided by the blueprint listing components for this ac The identifier of the blueprint this actor was based on, e.g. `vehicle.ford.mustang`.

Methods

-- **add_angular_impulse**(**self**, **impulse**) -Applies an angular impulse at the center of mass of the actor. Angular impulses are instantaneous. Use __add_torque()__ to apply rotation forces over time. +- **add_angular_impulse**(**self**, **angular_impulse**) +Applies an angular impulse at the center of mass of the actor. Angular impulses only last an instant. Use __add_torque()__ to apply rotation forces over a period of time. - **Parameters:** - - `impulse` (_[carla.Vector3D](#carla.Vector3D) – N*s_) – Angular impulse vector in global coordinates. -- **add_impulse**(**self**, **impulse**) -Applies an impulse at the center of mass of the actor. Impulses are instantaneous. Use __add_force()__ to apply forces over time. - - **Parameters:** - - `impulse` (_[carla.Vector3D](#carla.Vector3D) – degrees_) – Impulse vector in global coordinates. + - `angular_impulse` (_[carla.Vector3D](#carla.Vector3D) – N*s_) – Angular impulse vector in global coordinates. - **add_force**(**self**, **force**) -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 __add_angular_impulse()__ to apply an instantaneous rotation impulse. +Applies a force at the center of mass of the actor. This method should be used for forces that are applied over a certain period of time. Use __add_impulse()__ to apply an impulse that only lasts an instant. - **Parameters:** - - `force` (_[carla.Vector3D](#carla.Vector3D)_) – Force vector in global coordinates. + - `force` (_[carla.Vector3D](#carla.Vector3D) – degrees_) – Force vector in global coordinates. +- **add_impulse**(**self**, **impulse**) +Applies an impulse at the center of mass of the actor. Impulses only last an instant. Use __add_force()__ to apply forces over a period of time. + - **Parameters:** + - `impulse` (_[carla.Vector3D](#carla.Vector3D)_) – Impulse vector in global coordinates. - **add_torque**(**self**, **torque**) -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 __add_angular_impulse()__ to apply an instantaneous rotation impulse. +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 __add_angular_impulse()__ to apply a rotation impulse that only lasts an instant. - **Parameters:** - `torque` (_[carla.Vector3D](#carla.Vector3D)_) – Torque vector in global coordinates. - **destroy**(**self**) @@ -43,7 +43,7 @@ _ - **disable_constant_velocity**(**self**) Disables any constant velocity previously set for a [carla.Vehicle](#carla.Vehicle) actor. - **enable_constant_velocity**(**self**, **velocity**) -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. +Sets the actor's velocity vector to a constant value over time. The resulting velocity will be approximately the `velocity` being set, as with __set_target_velocity()__. - **Parameters:** - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) – Velocity vector in local space. - **Warning:** _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. @@ -73,7 +73,7 @@ Returns the world this actor belongs to.
Setters
- **set_target_angular_velocity**(**self**, **angular_velocity**) -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 angular velocity vector. The modification will be effective two frames after the setting, and the update between angular velocities will be sudden. Also, this is applied before the physics step so the resulting angular velocity will be affected by external forces at this frame such as friction. - **Parameters:** - `angular_velocity` (_[carla.Vector3D](#carla.Vector3D)_) - **Note:** _The update will not be effective until two frames after it is set. @@ -93,7 +93,7 @@ Teleports the actor to a given transform (location and rotation). - `transform` (_[carla.Transform](#carla.Transform)_) - **Getter:** _[carla.Actor.get_transform](#carla.Actor.get_transform)_ - **set_target_velocity**(**self**, **velocity**) -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). +Sets the actor's velocity vector. The modification will be effective two frames after the setting, and the update between velocities will be sudden. Also, this is applied before the physics step so the resulting velocity will be affected by external forces at this frame such as friction. - **Parameters:** - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) - **Note:** _The update will not be effective until two frames after it is set. @@ -2813,13 +2813,13 @@ Returns True if both **timestamp** are diffe --- ## command.ApplyAngularImpulse -Command adaptation of **add_angular_impulse()** in [carla.Actor](#carla.Actor). Adds angular impulse to an actor. +Command adaptation of __add_angular_impulse()__ in [carla.Actor](#carla.Actor). Applies an angular impulse to an actor.

Instance Variables

- **actor_id** (_int_) Actor affected by the command. - **impulse** (_[carla.Vector3D](#carla.Vector3D) – degrees_) -Angular impulse applied to the actor. Determines magnitude and global axis where it is applied. +Angular impulse applied to the actor.

Methods

- **\__init__**(**self**, **actor**, **impulse**) @@ -2829,8 +2829,25 @@ Angular impulse applied to the actor. Determines magnitude and global axis where --- +## command.ApplyForce +Command adaptation of __add_force()__ in [carla.Actor](#carla.Actor). Applies a force to an actor. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **force** (_[carla.Vector3D](#carla.Vector3D)_) +Force applied to the actor over time. + +

Methods

+- **\__init__**(**self**, **actor**, **force**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `force` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + ## command.ApplyImpulse -Command adaptation of **add_impulse()** in [carla.Actor](#carla.Actor). Adds impulse to an actor. +Command adaptation of __add_impulse()__ in [carla.Actor](#carla.Actor). Applies an impulse to an actor.

Instance Variables

- **actor_id** (_int_) @@ -2847,7 +2864,7 @@ Impulse applied to the actor. --- ## command.ApplyTargetAngularVelocity -Command adaptation of **set_target_angular_velocity()** 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 __set_target_angular_velocity()__ in [carla.Actor](#carla.Actor). Sets the actor's angular velocity vector.

Instance Variables

- **actor_id** (_int_) @@ -2864,7 +2881,7 @@ The 3D angular velocity that will be applied to the actor. --- ## command.ApplyTargetVelocity -Command adaptation of **set_target_velocity()** 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). +Command adaptation of __set_target_velocity()__ in [carla.Actor](#carla.Actor).

Instance Variables

- **actor_id** (_int_) @@ -2880,8 +2897,25 @@ The 3D velocity applied to the actor. --- +## command.ApplyTorque +Command adaptation of __add_torque()__ in [carla.Actor](#carla.Actor). Applies a torque to an actor. + +

Instance Variables

+- **actor_id** (_int_) +Actor affected by the command. +- **torque** (_[carla.Vector3D](#carla.Vector3D)_) +Torque applied to the actor over time. + +

Methods

+- **\__init__**(**self**, **actor**, **torque**) + - **Parameters:** + - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. + - `torque` (_[carla.Vector3D](#carla.Vector3D)_) + +--- + ## command.ApplyTransform -Command adaptation of **set_transform()** in [carla.Actor](#carla.Actor). Sets a new transform to an actor. +Command adaptation of __set_transform()__ in [carla.Actor](#carla.Actor). Sets a new transform to an actor.

Instance Variables

- **actor_id** (_int_) @@ -2898,7 +2932,7 @@ Transformation to be applied. --- ## command.ApplyVehicleControl -Command adaptation of **apply_control()** in [carla.Vehicle](#carla.Vehicle). Applies a certain control to a vehicle. +Command adaptation of __apply_control()__ in [carla.Vehicle](#carla.Vehicle). Applies a certain control to a vehicle.

Instance Variables

- **actor_id** (_int_) @@ -2915,7 +2949,7 @@ Vehicle control to be applied. --- ## command.ApplyWalkerControl -Command adaptation of **apply_control()** in [carla.Walker](#carla.Walker). Applies a control to a walker. +Command adaptation of __apply_control()__ in [carla.Walker](#carla.Walker). Applies a control to a walker.

Instance Variables

- **actor_id** (_int_) @@ -2952,7 +2986,7 @@ Speed to be applied. --- ## command.DestroyActor -Command adaptation of **destroy()** in [carla.Actor](#carla.Actor) that tells the simulator to destroy this actor. It has no effect if the actor was already destroyed. When executed with **apply_batch_sync()** in [carla.Client](#carla.Client) there will be a command.Response that will return a boolean stating whether the actor was successfully destroyed. +Command adaptation of __destroy()__ in [carla.Actor](#carla.Actor) that tells the simulator to destroy this actor. It has no effect if the actor was already destroyed. When executed with __apply_batch_sync()__ in [carla.Client](#carla.Client) there will be a command.Response that will return a boolean stating whether the actor was successfully destroyed.

Instance Variables

- **actor_id** (_int_) @@ -2982,7 +3016,7 @@ Returns True if the command execution fails, and False if it was s --- ## command.SetAutopilot -Command adaptation of **set_autopilot()** in [carla.Vehicle](#carla.Vehicle). Turns on/off the vehicle's autopilot mode. +Command adaptation of __set_autopilot()__ in [carla.Vehicle](#carla.Vehicle). Turns on/off the vehicle's autopilot mode.

Instance Variables

- **actor_id** (_int_) @@ -3002,7 +3036,7 @@ Port of the Traffic Manager where the vehicle is to be registered or unlisted. --- ## command.SetSimulatePhysics -Command adaptation of **set_simulate_physics()** in [carla.Actor](#carla.Actor). Determines whether an actor will be affected by physics or not. +Command adaptation of __set_simulate_physics()__ in [carla.Actor](#carla.Actor). Determines whether an actor will be affected by physics or not.

Instance Variables

- **actor_id** (_int_) @@ -3019,7 +3053,7 @@ If physics should be activated or not. --- ## command.SetVehicleLightState -Command adaptation of **set_light_state()** in [carla.Vehicle](#carla.Vehicle). Sets the light state of a vehicle. +Command adaptation of __set_light_state()__ in [carla.Vehicle](#carla.Vehicle). Sets the light state of a vehicle.

Instance Variables

- **actor_id** (_int_) @@ -3036,7 +3070,7 @@ Defines the light state of a vehicle. --- ## command.SpawnActor -Command adaptation of **spawn_actor()** in [carla.World](#carla.World). Spawns an actor into the world based on the blueprint provided and the transform. If a parent is provided, the actor is attached to it. +Command adaptation of __spawn_actor()__ in [carla.World](#carla.World). Spawns an actor into the world based on the blueprint provided and the transform. If a parent is provided, the actor is attached to it.

Instance Variables

- **transform** (_[carla.Transform](#carla.Transform)_) diff --git a/PythonAPI/docs/actor.yml b/PythonAPI/docs/actor.yml index 098819461..2bc9a17e6 100644 --- a/PythonAPI/docs/actor.yml +++ b/PythonAPI/docs/actor.yml @@ -37,32 +37,32 @@ methods: - def_name: add_angular_impulse params: - - param_name: impulse + - param_name: angular_impulse type: carla.Vector3D param_units: N*s doc: > Angular impulse vector in global coordinates. doc: > - Applies an angular impulse at the center of mass of the actor. Angular impulses are instantaneous. Use __add_torque()__ 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 __add_force()__ to apply forces over time. + Applies an angular impulse at the center of mass of the actor. Angular impulses only last an instant. Use __add_torque()__ to apply rotation forces over a period of time. # -------------------------------------- - def_name: add_force params: - param_name: force type: carla.Vector3D + param_units: degrees 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 __add_angular_impulse()__ to apply an instantaneous rotation impulse. + Applies a force at the center of mass of the actor. This method should be used for forces that are applied over a certain period of time. Use __add_impulse()__ to apply an impulse that only lasts an instant. + # -------------------------------------- + - def_name: add_impulse + params: + - param_name: impulse + type: carla.Vector3D + doc: > + Impulse vector in global coordinates. + doc: > + Applies an impulse at the center of mass of the actor. Impulses only last an instant. Use __add_force()__ to apply forces over a period of time. # -------------------------------------- - def_name: add_torque params: @@ -71,7 +71,7 @@ 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 __add_angular_impulse()__ to apply an instantaneous rotation impulse. + 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 __add_angular_impulse()__ to apply a rotation impulse that only lasts an instant. # -------------------------------------- - def_name: destroy return: bool @@ -91,7 +91,7 @@ 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. + Sets the actor's velocity vector to a constant value over time. The resulting velocity will be approximately the `velocity` being set, as with __set_target_velocity()__. Note: > Only carla.Vehicle actors can use this method. warning: > @@ -136,7 +136,7 @@ - param_name: angular_velocity type: carla.Vector3D doc: > - 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 angular velocity vector. The modification will be effective two frames after the setting, and the update between angular velocities will be sudden. Also, this is applied before the physics step so the resulting angular velocity will be affected by external forces at this frame such as friction. note: > The update will not be effective until two frames after it is set. # -------------------------------------- @@ -168,7 +168,7 @@ - param_name: velocity type: carla.Vector3D doc: > - 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). + Sets the actor's velocity vector. The modification will be effective two frames after the setting, and the update between velocities will be sudden. Also, this is applied before the physics step so the resulting velocity will be affected by external forces at this frame such as friction. note: > The update will not be effective until two frames after it is set. # -------------------------------------- diff --git a/PythonAPI/docs/commands.yml b/PythonAPI/docs/commands.yml index a0ab38393..d9f4a9963 100644 --- a/PythonAPI/docs/commands.yml +++ b/PythonAPI/docs/commands.yml @@ -29,7 +29,7 @@ - class_name: SpawnActor # - DESCRIPTION ------------------------ doc: > - Command adaptation of **spawn_actor()** in carla.World. Spawns an actor into the world based on the blueprint provided and the transform. If a parent is provided, the actor is attached to it. + Command adaptation of __spawn_actor()__ in carla.World. Spawns an actor into the world based on the blueprint provided and the transform. If a parent is provided, the actor is attached to it. # - PROPERTIES ------------------------- instance_variables: - var_name: transform @@ -73,7 +73,7 @@ - class_name: DestroyActor # - DESCRIPTION ------------------------ doc: > - Command adaptation of **destroy()** in carla.Actor that tells the simulator to destroy this actor. It has no effect if the actor was already destroyed. When executed with **apply_batch_sync()** in carla.Client there will be a command.Response that will return a boolean stating whether the actor was successfully destroyed. + Command adaptation of __destroy()__ in carla.Actor that tells the simulator to destroy this actor. It has no effect if the actor was already destroyed. When executed with __apply_batch_sync()__ in carla.Client there will be a command.Response that will return a boolean stating whether the actor was successfully destroyed. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id @@ -93,7 +93,7 @@ - class_name: ApplyVehicleControl # - DESCRIPTION ------------------------ doc: > - Command adaptation of **apply_control()** in carla.Vehicle. Applies a certain control to a vehicle. + Command adaptation of __apply_control()__ in carla.Vehicle. Applies a certain control to a vehicle. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id @@ -119,7 +119,7 @@ - class_name: ApplyWalkerControl # - DESCRIPTION ------------------------ doc: > - Command adaptation of **apply_control()** in carla.Walker. Applies a control to a walker. + Command adaptation of __apply_control()__ in carla.Walker. Applies a control to a walker. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id @@ -145,7 +145,7 @@ - class_name: ApplyTransform # - DESCRIPTION ------------------------ doc: > - Command adaptation of **set_transform()** in carla.Actor. Sets a new transform to an actor. + Command adaptation of __set_transform()__ in carla.Actor. Sets a new transform to an actor. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id @@ -205,7 +205,7 @@ - class_name: ApplyTargetVelocity # - DESCRIPTION ------------------------ doc: > - Command adaptation of **set_target_velocity()** 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). + Command adaptation of __set_target_velocity()__ in carla.Actor. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id @@ -235,7 +235,7 @@ - class_name: ApplyTargetAngularVelocity # - DESCRIPTION ------------------------ doc: > - Command adaptation of **set_target_angular_velocity()** 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). + Command adaptation of __set_target_angular_velocity()__ in carla.Actor. Sets the actor's angular velocity vector. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id @@ -265,7 +265,7 @@ - class_name: ApplyImpulse # - DESCRIPTION ------------------------ doc: > - Command adaptation of **add_impulse()** in carla.Actor. Adds impulse to an actor. + Command adaptation of __add_impulse()__ in carla.Actor. Applies an impulse to an actor. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id @@ -290,21 +290,47 @@ param_units: N*s # -------------------------------------- - - class_name: ApplyAngularImpulse + - class_name: ApplyForce # - DESCRIPTION ------------------------ doc: > - Command adaptation of **add_angular_impulse()** in carla.Actor. Adds angular impulse to an actor. + Command adaptation of __add_force()__ in carla.Actor. Applies a force to an actor. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id type: int doc: > Actor affected by the command. + - var_name: force + type: carla.Vector3D + doc: > + Force applied to the actor over time. + # - 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: force + type: carla.Vector3D + # -------------------------------------- + + - class_name: ApplyAngularImpulse + # - DESCRIPTION ------------------------ + doc: > + Command adaptation of __add_angular_impulse()__ in carla.Actor. Applies an angular impulse to an actor. + # - PROPERTIES ------------------------- + instance_variables: + - var_name: actor_id + type: int + doc: > + Actor affected by the command. - var_name: impulse type: carla.Vector3D var_units: degrees doc: > - Angular impulse applied to the actor. Determines magnitude and global axis where it is applied. + Angular impulse applied to the actor. # - METHODS ---------------------------- methods: - def_name: __init__ @@ -318,10 +344,36 @@ param_units: degrees # -------------------------------------- + - class_name: ApplyTorque + # - DESCRIPTION ------------------------ + doc: > + Command adaptation of __add_torque()__ in carla.Actor. Applies a torque to an actor. + # - PROPERTIES ------------------------- + instance_variables: + - var_name: actor_id + type: int + doc: > + Actor affected by the command. + - var_name: torque + type: carla.Vector3D + doc: > + Torque applied to the actor over time. + # - 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: torque + type: carla.Vector3D + # -------------------------------------- + - class_name: SetSimulatePhysics # - DESCRIPTION ------------------------ doc: > - Command adaptation of **set_simulate_physics()** in carla.Actor. Determines whether an actor will be affected by physics or not. + Command adaptation of __set_simulate_physics()__ in carla.Actor. Determines whether an actor will be affected by physics or not. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id @@ -347,7 +399,7 @@ - class_name: SetAutopilot # - DESCRIPTION ------------------------ doc: > - Command adaptation of **set_autopilot()** in carla.Vehicle. Turns on/off the vehicle's autopilot mode. + Command adaptation of __set_autopilot()__ in carla.Vehicle. Turns on/off the vehicle's autopilot mode. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id @@ -382,7 +434,7 @@ - class_name: SetVehicleLightState # - DESCRIPTION ------------------------ doc: > - Command adaptation of **set_light_state()** in carla.Vehicle. Sets the light state of a vehicle. + Command adaptation of __set_light_state()__ in carla.Vehicle. Sets the light state of a vehicle. # - PROPERTIES ------------------------- instance_variables: - var_name: actor_id