From 6b1298111b8fd8937d1832b2d6bee14f8507748a Mon Sep 17 00:00:00 2001 From: sergi-e Date: Thu, 24 Sep 2020 12:21:18 +0200 Subject: [PATCH] New iteration with units and fixes --- Docs/python_api.md | 38 ++++++++++++++++++------------------- PythonAPI/docs/actor.yml | 21 +++++++++++--------- PythonAPI/docs/commands.yml | 12 ++++++++---- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/Docs/python_api.md b/Docs/python_api.md index 1b7ae0864..d7b594bea 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -20,21 +20,21 @@ The identifier of the blueprint this actor was based on, e.g. `vehicle.ford.must

Methods

- **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. +Applies an angular impulse at the center of mass of the actor. This method should be used for instantaneous torques, usually applied once. Use __add_torque()__ to apply rotation forces over a period of time. - **Parameters:** - - `angular_impulse` (_[carla.Vector3D](#carla.Vector3D) – N*s_) – Angular impulse vector in global coordinates. + - `angular_impulse` (_[carla.Vector3D](#carla.Vector3D) – degrees*s_) – Angular impulse vector in global coordinates. - **add_force**(**self**, **force**) 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) – degrees_) – Force vector in global coordinates. + - `force` (_[carla.Vector3D](#carla.Vector3D) – N_) – 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. +Applies an impulse at the center of mass of the actor. This method should be used for instantaneous forces, usually applied once. Use __add_force()__ to apply forces over a period of time. - **Parameters:** - - `impulse` (_[carla.Vector3D](#carla.Vector3D)_) – Impulse vector in global coordinates. + - `impulse` (_[carla.Vector3D](#carla.Vector3D) – N*s_) – 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 a rotation impulse that only lasts an instant. +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 __add_angular_impulse()__ to apply a torque that only lasts an instant. - **Parameters:** - - `torque` (_[carla.Vector3D](#carla.Vector3D)_) – Torque vector in global coordinates. + - `torque` (_[carla.Vector3D](#carla.Vector3D) – degrees_) – Torque vector in global coordinates. - **destroy**(**self**) Tells the simulator to destroy this actor and returns True if it was successful. It has no effect if it was already destroyed. - **Return:** _bool_ @@ -43,10 +43,10 @@ _ - **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 resulting velocity will be approximately the `velocity` being set, as with __set_target_velocity()__. +Sets a vehicle'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. + - `velocity` (_[carla.Vector3D](#carla.Vector3D) – m/s_) – 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. This method overrides any changes in velocity by the TM. _
Getters
@@ -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 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. +Sets the actor's angular velocity vector. The modification will be effective two frames after the setting. 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 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. +Sets the actor's velocity vector. The modification will be effective two frames after the setting. 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. @@ -2818,14 +2818,14 @@ Command adaptation of __add_angular_impulse()__ in

Instance Variables

- **actor_id** (_int_) Actor affected by the command. -- **impulse** (_[carla.Vector3D](#carla.Vector3D) – degrees_) +- **impulse** (_[carla.Vector3D](#carla.Vector3D) – degrees*s_) Angular impulse applied to the actor.

Methods

- **\__init__**(**self**, **actor**, **impulse**) - **Parameters:** - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. - - `impulse` (_[carla.Vector3D](#carla.Vector3D) – degrees_) + - `impulse` (_[carla.Vector3D](#carla.Vector3D) – degrees*s_) --- @@ -2835,14 +2835,14 @@ Command adaptation of __add_force()__ in [carla.Act

Instance Variables

- **actor_id** (_int_) Actor affected by the command. -- **force** (_[carla.Vector3D](#carla.Vector3D)_) +- **force** (_[carla.Vector3D](#carla.Vector3D) – N_) 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)_) + - `force` (_[carla.Vector3D](#carla.Vector3D) – N_) --- @@ -2893,7 +2893,7 @@ The 3D velocity applied to the actor. - **\__init__**(**self**, **actor**, **velocity**) - **Parameters:** - `actor` (_[carla.Actor](#carla.Actor) or int_) – Actor or its ID to whom the command will be applied to. - - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) – Velocity vector applied to the actor. + - `velocity` (_[carla.Vector3D](#carla.Vector3D) – m/s_) – Velocity vector applied to the actor. --- @@ -2903,14 +2903,14 @@ Command adaptation of __add_torque()__ in [carla.Ac

Instance Variables

- **actor_id** (_int_) Actor affected by the command. -- **torque** (_[carla.Vector3D](#carla.Vector3D)_) +- **torque** (_[carla.Vector3D](#carla.Vector3D) – degrees_) 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)_) + - `torque` (_[carla.Vector3D](#carla.Vector3D) – degrees_) --- diff --git a/PythonAPI/docs/actor.yml b/PythonAPI/docs/actor.yml index 2bc9a17e6..21e9285f1 100644 --- a/PythonAPI/docs/actor.yml +++ b/PythonAPI/docs/actor.yml @@ -39,17 +39,17 @@ params: - param_name: angular_impulse type: carla.Vector3D - param_units: N*s + param_units: degrees*s doc: > Angular impulse vector in global coordinates. doc: > - 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. + Applies an angular impulse at the center of mass of the actor. This method should be used for instantaneous torques, usually applied once. 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 + param_units: N doc: > Force vector in global coordinates. doc: > @@ -59,19 +59,21 @@ params: - param_name: impulse type: carla.Vector3D + param_units: N*s 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. + Applies an impulse at the center of mass of the actor. This method should be used for instantaneous forces, usually applied once. Use __add_force()__ to apply forces over a period of time. # -------------------------------------- - def_name: add_torque params: - param_name: torque type: carla.Vector3D + param_units: degrees 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 a rotation impulse that only lasts an instant. + 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 __add_angular_impulse()__ to apply a torque that only lasts an instant. # -------------------------------------- - def_name: destroy return: bool @@ -90,12 +92,13 @@ type: carla.Vector3D doc: > Velocity vector in local space. + param_units: m/s doc: > - 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()__. + Sets a vehicle'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: > - 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. + 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: get_acceleration return: carla.Vector3D @@ -136,7 +139,7 @@ - param_name: angular_velocity type: carla.Vector3D doc: > - 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. + Sets the actor's angular velocity vector. The modification will be effective two frames after the setting. 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 +171,7 @@ - param_name: velocity type: carla.Vector3D doc: > - 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. + Sets the actor's velocity vector. The modification will be effective two frames after the setting. 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 d9f4a9963..f9edf58fe 100644 --- a/PythonAPI/docs/commands.yml +++ b/PythonAPI/docs/commands.yml @@ -115,7 +115,7 @@ - param_name: control type: carla.VehicleControl # -------------------------------------- - + - class_name: ApplyWalkerControl # - DESCRIPTION ------------------------ doc: > @@ -227,7 +227,7 @@ Actor or its ID to whom the command will be applied to. - param_name: velocity type: carla.Vector3D - param_untis: m/s + param_units: m/s doc: > Velocity vector applied to the actor. # -------------------------------------- @@ -304,6 +304,7 @@ type: carla.Vector3D doc: > Force applied to the actor over time. + var_units: N # - METHODS ---------------------------- methods: - def_name: __init__ @@ -314,6 +315,7 @@ Actor or its ID to whom the command will be applied to. - param_name: force type: carla.Vector3D + param_units: N # -------------------------------------- - class_name: ApplyAngularImpulse @@ -328,7 +330,7 @@ Actor affected by the command. - var_name: impulse type: carla.Vector3D - var_units: degrees + var_units: degrees*s doc: > Angular impulse applied to the actor. # - METHODS ---------------------------- @@ -341,7 +343,7 @@ Actor or its ID to whom the command will be applied to. - param_name: impulse type: carla.Vector3D - param_units: degrees + param_units: degrees*s # -------------------------------------- - class_name: ApplyTorque @@ -358,6 +360,7 @@ type: carla.Vector3D doc: > Torque applied to the actor over time. + var_units: degrees # - METHODS ---------------------------- methods: - def_name: __init__ @@ -368,6 +371,7 @@ Actor or its ID to whom the command will be applied to. - param_name: torque type: carla.Vector3D + param_units: degrees # -------------------------------------- - class_name: SetSimulatePhysics