From d18a506edf898cbfc7e33c57d8c36f0f9ef54109 Mon Sep 17 00:00:00 2001 From: sergi-e Date: Wed, 9 Sep 2020 16:48:04 +0200 Subject: [PATCH] First iteration --- Docs/adv_rendering_options.md | 6 +++--- Docs/adv_sumo.md | 8 ++++---- Docs/adv_synchrony_timestep.md | 6 +++--- Docs/build_faq.md | 2 +- Docs/build_linux.md | 4 ++-- Docs/build_windows.md | 4 ++-- Docs/cont_doc_standard.md | 2 +- Docs/ref_sensors.md | 4 ++-- Docs/ros_installation.md | 4 ++-- Docs/start_quickstart.md | 5 +++-- Docs/tuto_A_add_map.md | 2 +- Docs/tuto_A_add_props.md | 2 +- Docs/tuto_A_add_vehicle.md | 2 +- Docs/tuto_G_openstreetmap.md | 2 +- Docs/tuto_G_retrieve_data.md | 20 ++++++++++---------- 15 files changed, 37 insertions(+), 36 deletions(-) diff --git a/Docs/adv_rendering_options.md b/Docs/adv_rendering_options.md index 4272bc167..9dd27fa0c 100644 --- a/Docs/adv_rendering_options.md +++ b/Docs/adv_rendering_options.md @@ -76,15 +76,15 @@ world.apply_settings(settings) ``` And here is an example on how to disable and then enable rendering using the `config.py`. ```sh -cd PythonAPI/util && ./config.py --no-rendering +cd PythonAPI/util && python3 config.py --no-rendering ``` ```sh -cd PythonAPI/util && ./config.py --rendering +cd PythonAPI/util && python3 config.py --rendering ``` The script `PythonAPI/examples/no_rendering_mode.py` will enable no-rendering mode, and use __Pygame__ to create an aerial view using simple graphics. ```sh -cd PythonAPI/examples && ./no_rendering_mode.py +cd PythonAPI/examples && python3 no_rendering_mode.py ``` !!! Warning diff --git a/Docs/adv_sumo.md b/Docs/adv_sumo.md index 6b0c44dfd..25a466c69 100644 --- a/Docs/adv_sumo.md +++ b/Docs/adv_sumo.md @@ -27,13 +27,13 @@ Run a CARLA simulation with __Town04__. cd ~/carla ./CarlaUE4.sh cd PythonAPI/util -python config.py --map Town04 +python3 config.py --map Town04 ``` Then, run the SUMO co-simulation example. ```sh cd ~/carla/Co-Simulation/Sumo -python run_synchronization.py examples/Town04.sumocfg --sumo-gui +python3 run_synchronization.py examples/Town04.sumocfg --sumo-gui ``` !!! Important @@ -83,7 +83,7 @@ Once a simulation is ready and saved as a `.sumocfg`, it is ready to run. There * __`--tls-manager`__ *(default: none)* — Choose which simulator should manage the traffic lights. The other will update those accordingly. The options are `carla`, `sumo`, and `none`. If `none` is chosen, traffic lights will not be synchronized. Each vehicle would only obey the traffic lights in the simulator that spawn it. ```sh -python run_synchronization.py --tls-manager carla --sumo-gui +python3 run_synchronization.py --tls-manager carla --sumo-gui ``` !!! Warning @@ -114,7 +114,7 @@ As the script runs a synchronous simulation, and spawns vehicles in it, the argu # Spawn 10 vehicles, that will be managed by SUMO instead of Traffic Manager. # CARLA in charge of traffic lights. # Open a window for SUMO visualization. -python spawn_sumo_npc.py -n 10 --tls-manager carla --sumo-gui +python3 spawn_sumo_npc.py -n 10 --tls-manager carla --sumo-gui ``` --- diff --git a/Docs/adv_synchrony_timestep.md b/Docs/adv_synchrony_timestep.md index 3ddb424db..475748491 100644 --- a/Docs/adv_synchrony_timestep.md +++ b/Docs/adv_synchrony_timestep.md @@ -35,7 +35,7 @@ world.apply_settings(settings) ``` `PythonAPI/util/config.py` sets the time-step using an argument. Zero equals variable time-step. ```sh -cd PythonAPI/util && ./config.py --delta-seconds 0 +cd PythonAPI/util && python3 config.py --delta-seconds 0 ``` ### Fixed time-step @@ -52,7 +52,7 @@ world.apply_settings(settings) This can also be set using the provided script `PythonAPI/util/config.py`. ```sh -cd PythonAPI/util && ./config.py --delta-seconds 0.05 +cd PythonAPI/util && python3 config.py --delta-seconds 0.05 ``` ### Tips when recording the simulation @@ -101,7 +101,7 @@ world.apply_settings(settings) To disable synchronous mode just set the variable to false or use the script `PythonAPI/util/config.py`. ```sh -cd PythonAPI/util && ./config.py --no-sync # Disables synchronous mode +cd PythonAPI/util && python3 config.py --no-sync # Disables synchronous mode ``` Synchronous mode cannot be enabled using the script, only disabled. Enabling the synchronous mode makes the server wait for a client tick. Using this script, the user cannot send ticks when desired. diff --git a/Docs/build_faq.md b/Docs/build_faq.md index 2d4b435ec..ada389097 100644 --- a/Docs/build_faq.md +++ b/Docs/build_faq.md @@ -295,7 +295,7 @@ Go to `Edit/Editor Preferences/Performance` in the editor preferences, and disab Some scripts have requirements. These are listed in files named __Requirements.txt__, in the same path as the script itself. Be sure to check these in order to run the script. The majority of them can be installed with a simple `pip` command. -Sometimes on Windows, scripts cannot run with just `> script_name.py`. Try adding `> python script_name.py`, and make sure to be in the right directory. +Sometimes on Windows, scripts cannot run with just `> script_name.py`. Try adding `> python3 script_name.py`, and make sure to be in the right directory. diff --git a/Docs/build_linux.md b/Docs/build_linux.md index a0e666e1d..79be3de58 100644 --- a/Docs/build_linux.md +++ b/Docs/build_linux.md @@ -87,7 +87,7 @@ make PythonAPI # Press play in the Editor to initialize the server, and run an example script to test CARLA. cd PythonAPI/examples -python3 spawn_npc.py +python3 spawn_npc.py # Support for Python2 was provided until 0.9.10 (not included) ``` @@ -264,7 +264,7 @@ The project may ask to build other instances such as `UE4Editor-Carla.dll` the f * __make PythonAPI__ compiles the API client, necessary to grant control over the simulation. It is only needed the first time. Remember to run it again when updating CARLA. Scripts will be able to run after this command is executed. The following example will spawn some life into the town. ```sh -make PythonAPI && cd PythonAPI/examples && python3 spawn_npc.py +make PythonAPI && cd PythonAPI/examples && python3 spawn_npc.py # Support for Python2 was provided until 0.9.10 (not included) ``` !!! Important If the simulation is running at very low FPS rates, go to `Edit/Editor preferences/Performance` in the UE editor and disable __Use less CPU when in background__. diff --git a/Docs/build_windows.md b/Docs/build_windows.md index 331c34582..b7f6fb251 100644 --- a/Docs/build_windows.md +++ b/Docs/build_windows.md @@ -52,7 +52,7 @@ make launch make PythonAPI # Press play in the Editor to initialize the server, and run an example script to test CARLA. -cd PythonAPI/Examples && python3 spawn_npc.py +cd PythonAPI/Examples && python3 spawn_npc.py # Support for Python2 was provided until 0.9.10 (not included) ``` @@ -154,7 +154,7 @@ The project may ask to build other instances such as `UE4Editor-Carla.dll` the f * __make PythonAPI__ compiles the API client, necessary to grant control over the simulation. It is only needed the first time. Remember to run it again when updating CARLA. Scripts will be able to run after this command is executed. The following example will spawn some life into the town. ```sh -make PythonAPI && cd PythonAPI/examples && python3 spawn_npc.py +make PythonAPI && cd PythonAPI/examples && python3 spawn_npc.py # Support for Python2 was provided until 0.9.10 (not included) ``` !!! Important If the simulation is running at very low FPS rates, go to `Edit/Editor preferences/Performance` in the UE editor and disable __Use less CPU when in background__. diff --git a/Docs/cont_doc_standard.md b/Docs/cont_doc_standard.md index dd70797ce..71d4a5357 100644 --- a/Docs/cont_doc_standard.md +++ b/Docs/cont_doc_standard.md @@ -30,7 +30,7 @@ This will re-generate the respective Markdown files inside `carla/Docs/`, which --- ## Exceptions - * Documentation generated via python scripts like PythonAPI reference + * Documentation generated via Python scripts like PythonAPI reference Handy markdown [cheatsheet][cheatlink]. diff --git a/Docs/ref_sensors.md b/Docs/ref_sensors.md index fd6b71b34..9be199a2a 100644 --- a/Docs/ref_sensors.md +++ b/Docs/ref_sensors.md @@ -495,7 +495,7 @@ For a better realism, points in the cloud can be dropped off. This is an easy wa Additionally, the `noise_stddev` attribute makes for a noise model to simulate unexpected deviations that appear in real-life sensors. For positive values, each point is randomly perturbed along the vector of the laser ray. The result is a LIDAR sensor with perfect angular positioning, but noisy distance measurement. -The rotation of the LIDAR can be tuned to cover a specific angle on every simulation step (using a [fixed time-step](adv_synchrony_timestep.md)). For example, to rotate once per step (full circle output, as in the picture below), the rotation frequency and the simulated FPS should be equal.
__1.__ Set the sensor's frequency `sensors_bp['lidar'][0].set_attribute('rotation_frequency','10')`.
__2.__ Run the simulation using `python config.py --fps=10`. +The rotation of the LIDAR can be tuned to cover a specific angle on every simulation step (using a [fixed time-step](adv_synchrony_timestep.md)). For example, to rotate once per step (full circle output, as in the picture below), the rotation frequency and the simulated FPS should be equal.
__1.__ Set the sensor's frequency `sensors_bp['lidar'][0].set_attribute('rotation_frequency','10')`.
__2.__ Run the simulation using `python3 config.py --fps=10`. ![LidarPointCloud](img/lidar_point_cloud.jpg) @@ -1329,7 +1329,7 @@ for detection in semantic_lidar_measurement: The rotation of the LIDAR can be tuned to cover a specific angle on every simulation step (using a [fixed time-step](adv_synchrony_timestep.md)). For example, to rotate once per step (full circle output, as in the picture below), the rotation frequency and the simulated FPS should be equal.
__1.__ Set the sensor's frequency `sensors_bp['lidar'][0].set_attribute('rotation_frequency','10')`.
-__2.__ Run the simulation using `python config.py --fps=10`. +__2.__ Run the simulation using `python3 config.py --fps=10`. ![LidarPointCloud](img/semantic_lidar_point_cloud.jpg) diff --git a/Docs/ros_installation.md b/Docs/ros_installation.md index 6102ac91e..26f96ae6d 100644 --- a/Docs/ros_installation.md +++ b/Docs/ros_installation.md @@ -110,7 +110,7 @@ roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch The path to CARLA Python is missing. The apt installation does this automatically, but it may be missing for other installations. Execute the following command with the complete path to the .egg file (included). Use the one supported by the Python version installed. -
+

Note: .egg files may be either in `/PythonAPI/` or `/PythonAPI/dist/` depending on the CARLA installation. ```sh @@ -119,7 +119,7 @@ The path to CARLA Python is missing. The apt installation does this automaticall Import CARLA from Python and wait for a sucess message to check the installation. ```sh -python -c 'import carla;print("Success")' +python3 -c 'import carla;print("Success")' ``` diff --git a/Docs/start_quickstart.md b/Docs/start_quickstart.md index d121e1f4d..2d9ee3240 100644 --- a/Docs/start_quickstart.md +++ b/Docs/start_quickstart.md @@ -47,7 +47,7 @@ cd /opt/carla-simulator # Run a script to test CARLA. cd PythonAPI/examples -python3 spawn_npc.py +python3 spawn_npc.py # Support for Python2 was provided until 0.9.10 (not included) ``` @@ -146,8 +146,9 @@ Now it is time to start running scripts. The following example will spawn some l # Go to the folder containing example scripts > cd PythonAPI/examples -> python3 spawn_npc.py +> python3 spawn_npc.py # Support for Python2 was provided until 0.9.10 (not included) ``` + #### Command-line options There are some configuration options available when launching CARLA. diff --git a/Docs/tuto_A_add_map.md b/Docs/tuto_A_add_map.md index 387fac0f7..e9a54d0b3 100644 --- a/Docs/tuto_A_add_map.md +++ b/Docs/tuto_A_add_map.md @@ -85,7 +85,7 @@ chmod 777 input_folder __2. Run the script to cook the map.__ In the folder `~/carla/Util/Docker` there is a script that connects with the Docker image previously created, and makes the ingestion automatically. It only needs the path for the input and output files, and the name of the package to be ingested. If no `.json` is provided, the name must be `map_package`. ```sh -python docker_tools.py --input ~/path_to_input_folder --output ~/path_to_output_folder --packages map_package +python3 docker_tools.py --input ~/path_to_input_folder --output ~/path_to_output_folder --packages map_package ``` !!! Warning If the argument `--package ` is not provided, the Docker will make a package of CARLA. diff --git a/Docs/tuto_A_add_props.md b/Docs/tuto_A_add_props.md index 88ec4103d..c3af52f42 100644 --- a/Docs/tuto_A_add_props.md +++ b/Docs/tuto_A_add_props.md @@ -119,7 +119,7 @@ __1. Build a Docker image of Unreal Engine.__ Follow [these instructions](https: __2. Run the script to cook the props.__ In the folder `~/carla/Util/Docker` there is a script that connects with the Docker image previously created, and makes the ingestion automatically. It only needs the path for the input and output files, and the name of the package to be ingested. ```sh -python docker_tools.py --input ~/path_to_package --output ~/path_for_output_assets --package=Package01 +python3 docker_tools.py --input ~/path_to_package --output ~/path_for_output_assets --package=Package01 ``` __3. Locate the package__. The Docker should have generated the package `Package01.tar.gz` in the output path. This is the standalone package for the assets. diff --git a/Docs/tuto_A_add_vehicle.md b/Docs/tuto_A_add_vehicle.md index d8bad3506..8c0d09e39 100644 --- a/Docs/tuto_A_add_vehicle.md +++ b/Docs/tuto_A_add_vehicle.md @@ -111,7 +111,7 @@ __4. Export the result__. Select all the meshes and the base of the skeleton a * __11. Test the vehicle__. Launch CARLA, open a terminal in `PythonAPI/examples` and run the following command. ```sh -python manual_control.py --filter # The name used in step 10.2 +python3 manual_control.py --filter # The name used in step 10.2 ``` --- diff --git a/Docs/tuto_G_openstreetmap.md b/Docs/tuto_G_openstreetmap.md index ebfd49471..c95a591a7 100644 --- a/Docs/tuto_G_openstreetmap.md +++ b/Docs/tuto_G_openstreetmap.md @@ -91,7 +91,7 @@ world = client.generate_opendrive_world( __b) Using `config.py`__ — The script can load an OpenStreetMap file directly into CARLA using a new argument. ``` -config.py --osm-file=/path/to/OSM/file +python3 config.py --osm-file=/path/to/OSM/file ``` !!! Warning [client.generate_opendrive_world()](python_api.md#carla.Client.generate_opendrive_world) requires the __content of the OpenDRIVE file parsed as string__, and allows parameterization. On the contrary, __`config.py`__ script needs __the path to the `.xodr` file__ and always uses default parameters. diff --git a/Docs/tuto_G_retrieve_data.md b/Docs/tuto_G_retrieve_data.md index a70262c02..be168678b 100644 --- a/Docs/tuto_G_retrieve_data.md +++ b/Docs/tuto_G_retrieve_data.md @@ -87,7 +87,7 @@ Open a new terminal. Change the map using the __config.py__ script. ``` cd /opt/carla/PythonAPI/utils -./config.py --map Town01 +python3 config.py --map Town01 ``` This script can enable different settings. Some of them will be mentioned during the tutorial, others will not. Hereunder there is a brief summary. @@ -133,14 +133,14 @@ Each town is loaded with a specific weather that fits it, however this can be se ```sh cd /opt/carla/PythonAPI/examples -python dynamic_weather.py --speed 1.0 +python3 dynamic_weather.py --speed 1.0 ``` * __To set custom conditions__. Use the script __environment.py__. There are quite a lot of possible settings. Take a look at the optional arguments, and the documentation for [carla.WeatherParameters](python_api.md#carla.WeatherParameters). ```sh cd /opt/carla/PythonAPI/util -python environment.py --clouds 100 --rain 80 --wetness 100 --puddles 60 --wind 80 --fog 50 +python3 environment.py --clouds 100 --rain 80 --wetness 100 --puddles 60 --wind 80 --fog 50 ```
@@ -182,7 +182,7 @@ Open a new terminal, and run __spawn_npc.py__ to spawn vehicles and walkers. Let ```sh cd /opt/carla/PythonAPI/examples -python spawn_npc.py -n 50 -w 50 --safe +python3 spawn_npc.py -n 50 -w 50 --safe ```
Optional arguments in spawn_npc.py @@ -228,7 +228,7 @@ echo "export SUMO_HOME=/usr/share/sumo" >> ~/.bashrc && source ~/.bashrc * With the CARLA server on, run the [SUMO-CARLA synchrony script](https://github.com/carla-simulator/carla/blob/master/Co-Simulation/Sumo/run_synchronization.py). ```sh cd ~/carla/Co-Simulation/Sumo -python run_synchronization.py examples/Town01.sumocfg --sumo-gui +python3 run_synchronization.py examples/Town01.sumocfg --sumo-gui ``` * A SUMO window should have opened. __Press Play__ in order to start traffic in both simulations. ``` @@ -632,7 +632,7 @@ The same `config.py` used to [set the map](#map-setting) can disable rendering, ``` cd /opt/carla/PythonAPI/utils -./config.py --no-rendering --delta-seconds 0.05 # Never greater than 0.1s +python3 config.py --no-rendering --delta-seconds 0.05 # Never greater than 0.1s ``` !!! Warning @@ -644,12 +644,12 @@ The script `PythonAPI/examples/no_rendering_mode.py` provides an overview of the ``` cd /opt/carla/PythonAPI/examples -python manual_control.py +python3 manual_control.py ``` ``` cd /opt/carla/PythonAPI/examples -python no_rendering_mode.py --no-rendering +python3 no_rendering_mode.py --no-rendering ```
@@ -712,7 +712,7 @@ while True: ``` cd /opt/carla/PythonAPI/examples -python manual_control.py +python3 manual_control.py ``` !!! Note @@ -742,7 +742,7 @@ It is time to run a new simulation. To reenact the simulation, [choose a fragment](#choose-a-fragment) and run the script containing the code for the playback. ```sh -python tuto_replay.py +python3 tuto_replay.py ``` ### Query the events