From cec8fd90ae0b78ac1e698c289597ee081bd34e91 Mon Sep 17 00:00:00 2001 From: Corinne <38050983+corkyw10@users.noreply.github.com> Date: Fri, 7 May 2021 15:16:32 +0200 Subject: [PATCH] Corkyw10/chrono docs (#4160) * Added Chrono Integration page to navigation * Initial draft of Chrono documentation * Added Python API information for enable_chrono_physics. Made some syntactical changes to first draft of Chrono docs. * Made the forward slash character in PythonAPI stand out. Added link to Actor class in the Chrono doc. * Added manual_control_chrono.py to PythonAPI/examples * Edited chrono torial. Edited changelog. Co-authored-by: Axel --- CHANGELOG.md | 2 + Docs/python_api.md | 586 ++++----- Docs/tuto_G_chrono.md | 75 ++ PythonAPI/docs/actor.yml | 35 +- PythonAPI/examples/manual_control_chrono.py | 1206 +++++++++++++++++++ mkdocs.yml | 1 + 6 files changed, 1619 insertions(+), 286 deletions(-) create mode 100644 Docs/tuto_G_chrono.md create mode 100644 PythonAPI/examples/manual_control_chrono.py diff --git a/CHANGELOG.md b/CHANGELOG.md index c1930cfb1..7c4c908c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ * Added optional flag to `client.replay_file()` `replay_sensors` to enable or disable the replaying the sensors * Improved manual_control: now cameras are set in relation with car size * Added CHRONO library for vehicle dynamics simulation (https://projectchrono.org/) + - Supported JSON vehicle definition + - Unsupported collision dynamics * Added performance benchmarking section to documentation * CARLA is compatible with the last RoadRunner nomenclature for road assets * Fixed a bug when importing a FBX map with some **_** in the FBX name diff --git a/Docs/python_api.md b/Docs/python_api.md index cf946fbed..a923880cc 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -42,10 +42,25 @@ Tells the simulator to destroy this actor and returns True if it was succ _ - **disable_constant_velocity**(**self**) Disables any constant velocity previously set for a [carla.Vehicle](#carla.Vehicle) actor. +- **enable_chrono_physics**(**self**, **max_substeps**, **max_substep_delta_time**, **vehicle_json**, **powertrain_json**, **tire_json**, **base_json_path**) +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:** _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. +_ - **enable_constant_velocity**(**self**, **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) – m/s_) – Velocity vector in local space. + - **Note:** _Only [carla.Vehicle](#carla.Vehicle) actors can use this method. +_ - **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. _ @@ -3378,146 +3393,37 @@ world.load_map_layer(carla.MapLayer.ParkedVehicles) -