You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/scripts/carla.rst
+58-31Lines changed: 58 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
CARLA
4
4
=====
5
5
6
-
`CARLA <https://carla.org/>`_ is an autonomous driving simulator based on Unreal Engine 4.
6
+
`CARLA <https://carla.org/>`_ is an autonomous driving simulator based on Unreal Engine.
7
7
This page explains how to install CARLA and use it with RAMN.
8
8
Although we only tested the scripts on Windows, they should be usable on Linux with minor adjustments.
9
9
Note that the simulator requires that you have a sufficiently powerful GPU.
@@ -17,11 +17,15 @@ Note that the simulator requires that you have a sufficiently powerful GPU.
17
17
Installing CARLA
18
18
----------------
19
19
20
+
.. warning::
21
+
22
+
CARLA is a project independent from RAMN, so please refer to CARLA's documentation for CARLA-related issues.
23
+
20
24
Follow these steps to install CARLA on Windows:
21
25
22
-
- Download and unzip the latest release of CARLA, from their `Github repository <https://github.com/carla-simulator/carla/releases>`_. The latest version that we tested is Release 0.9.15.
23
-
- Check that the simulator works by launching *WindowsNoEditor/CarlaUE4.exe*. This will likely require that you approve the app with Microsoft's SmartScreen. If a 3D view opens, you can close the simulator and move on to the next step. If you get an error message, install the `latest version of Windows DirectX <https://www.microsoft.com/en-us/download/details.aspx?id=35>`_.
24
-
- Install the latest Python **3.8 version (not a later version such as 3.12)** from Python Software foundation's `webpage <https://www.python.org/downloads/windows/>`_. **Check the "add python.exe to PATH" option**. The latest version that we tested is `3.8.10 <https://www.python.org/downloads/release/python-3810/>`_. If you do not know which file you should use, try "Windows installer (64-bit)".
26
+
- Download and unzip the latest release of CARLA, from its `Github repository <https://github.com/carla-simulator/carla/releases>`_. The latest version that we tested is Release 0.9.15.
27
+
- Check that the simulator works by launching ``CarlaUE4.exe`` (or ``CarlaUnreal.exe``), which is typically located in the ``WindowsNoEditor`` folder. This will likely require that you approve the app with Microsoft's SmartScreen. If a 3D view opens, you can close the simulator and move on to the next step. If you get an error message, install the `latest version of Windows DirectX <https://www.microsoft.com/en-us/download/details.aspx?id=35>`_.
28
+
- Install the latest Python **3.8 version** from Python Software foundation's `webpage <https://www.python.org/downloads/windows/>`_ (you may use later Python versions such as 3.12 only on recent CARLA releases). **Check the "add python.exe to PATH" option**. The latest version that we tested is `3.8.10 <https://www.python.org/downloads/release/python-3810/>`_. If you do not know which file you should download, try **"Windows installer (64-bit)"**.
25
29
- Install CARLA's pythonAPI by opening a command prompt (press Windows+R and type "cmd") and executing:
26
30
27
31
.. code-block:: bash
@@ -34,33 +38,49 @@ Follow these steps to install CARLA on Windows:
34
38
35
39
$ pip3 install shapely networkx
36
40
37
-
- Try CARLA's *manual_control.py* and *automatic_control.py* examples. First, execute *WindowsNoEditor/CarlaUE4.exe* and leave the window open (that is your CARLA server). Then, open a command prompt in *WindowsNoEditor/PythonAPI/examples* (open the folder in Windows Explorer and type "cmd" in the address bar) and try the first example:
41
+
- Try CARLA's ``manual_control.py`` and ``automatic_control.py`` examples. First, execute ``CarlaUE4.exe`` (or ``CarlaUnreal.exe``) and leave the window open; that is your CARLA server. Then, open a command prompt in ``PythonAPI/examples`` (open the folder in Windows Explorer and type "cmd" in the address bar) and try the first example:
38
42
39
-
.. code-block:: bash
43
+
.. code-block:: bash
40
44
41
-
$ python manual_control.py
45
+
$ python manual_control.py
42
46
43
-
You should be able to control the car manually with the WASD keys of your keyboard.
44
-
Then, try the second example:
47
+
You should be able to control the car manually with the WASD keys of your keyboard. Refer to the notes below if you encounter issues.
48
+
49
+
You can also verify that the self-driving algorithm is functional with:
45
50
46
51
.. code-block:: bash
47
52
48
53
$ python automatic_control.py
49
54
50
55
You should be able to see the self-driving algorithm in action.
56
+
51
57
52
-
If you have issues with the latest CARLA release, try executing it with the following options:
58
+
.. note::
53
59
54
-
.. code-block:: bash
60
+
If you have issues with the latest CARLA release, try executing it with the following options:
55
61
56
-
$ CarlaUE4.exe -dx11 -windowed -quality-level=Low
62
+
.. code-block:: bash
57
63
58
-
If this does not resolve your issues, try downloading an earlier version of CARLA. RAMN scripts should be compatible with release 0.9.12.
59
-
If you do so, you will also need to install CARLA's API with the corresponding version, e.g.:
If you want, you can download additional assets (maps, etc.) by following the `instructions here <https://carla.readthedocs.io/en/latest/start_quickstart/#import-additional-assets>`_.
70
90
You can also edit CARLA's default settings (weather, etc.) by following `this page <https://carla.readthedocs.io/en/stable/configuring_the_simulation/>`_.
71
91
72
-
If you have not already, you also need to install RAMN's scripts (see :ref:`flashing_scripts`).
73
-
74
92
.. _ramn_carla_scripts:
75
93
76
-
Configuring your environment
77
-
----------------------------
94
+
Configuring your RAMN environment
95
+
---------------------------------
96
+
97
+
- If you haven’t already, you first need to install RAMN’s scripts:
98
+
99
+
1. Download the `RAMN repository <https://github.com/ToyotaInfoTech/RAMN>`_ on your computer (select Code > Download Zip).
100
+
2. Open a command prompt in the ``RAMN/scripts`` folder (you can do this by opening the folder in Windows Explorer and typing "cmd" in the address bar) and execute:
101
+
102
+
.. code-block:: console
103
+
104
+
$ pip3 install -r requirements.txt
78
105
79
-
- Open *RAMN/script/settings/CARLA_PATH.txt* and replace its content with the path to the folder where *CARLAUE4.exe* is located.
80
-
- (Optional) Modify *0_CARLA_SERVER_start.bat* with your preferred settings (resolution, etc.). Read `CARLA's documentation <https://carla.readthedocs.io/en/latest/adv_rendering_options/>`_ for more information about CARLA's options. Specify the quality of graphics using :code:`-quality-level=Epic` (best graphics) or :code:`-quality-level=Low` (best performances). Specify the resolution of the server using :code:`-windowed -ResX=N -ResY=N`.
106
+
- Open ``RAMN/script/settings/CARLA_PATH.txt`` and replace its content with the path to the folder where ``CARLAUE4.exe`` (or ``CarlaUnreal.exe``) is located on your computer.
107
+
- (Optional) Modify ``0_CARLA_SERVER_start.bat`` with your preferred settings (resolution, etc.). Read `CARLA's documentation <https://carla.readthedocs.io/en/latest/adv_rendering_options/>`_ for more information about CARLA's options. Specify the quality of graphics using :code:`-quality-level=Epic` (best graphics) or :code:`-quality-level=Low` (best performances). Specify the resolution of the server using :code:`-windowed -ResX=N -ResY=N`.
81
108
82
-
- (Optional) Modify *CarlaSettings.ini* to edit default settings (weather, etc.)
83
-
- (Optional) Modify *1_CARLA_SERVER_config.bat* to provide a shortcut to execute CARLA's *config.py* as you want (e.g., to `load another map <https://carla.readthedocs.io/en/0.9.15/tuto_first_steps/#loading-a-map>`_).
109
+
- (Optional) Modify ``CarlaSettings.ini`` to edit default settings (weather, etc.)
110
+
- (Optional) Modify ``1_CARLA_SERVER_config.bat`` to provide a shortcut to execute CARLA's ``config.py`` as needed (e.g., to `load a specific map <https://carla.readthedocs.io/en/0.9.15/tuto_first_steps/#loading-a-map>`_).
84
111
85
112
Executing RAMN's scripts for CARLA
86
113
----------------------------------
87
114
88
115
First, start a CARLA server:
89
116
90
-
- Execute *0_CARLA_SERVER_start.bat*.
91
-
- (Optional) Execute *1_CARLA_SERVER_config.bat* to update the server's configuration.
117
+
- Execute ``0_CARLA_SERVER_start.bat``.
118
+
- (Optional) Execute ``1_CARLA_SERVER_config.bat`` to update the server's configuration.
92
119
93
120
You only need to start one server per session. You will be able to execute the following scripts as long as the window stays active.
94
121
You can for example execute the basic RAMN examples:
95
122
96
-
- Execute *2_CARLA_RAMN_manual_serial.bat* to connect RAMN to CARLA and drive the vehicle manually using RAMN's controls.
97
-
- Execute *3_CARLA_RAMN_auto_serial.bat* to connect RAMN to CARLA's self-driving algorithm.
123
+
- Execute ``2_CARLA_RAMN_manual_serial.bat`` to connect RAMN to CARLA and drive the vehicle manually using RAMN's controls.
124
+
- Execute ``3_CARLA_RAMN_auto_serial.bat`` to connect RAMN to CARLA's self-driving algorithm.
98
125
99
126
If you get an error, verify that your RAMN's serial port is not being used by another application.
100
127
@@ -107,10 +134,10 @@ If the LED does not turn off when you center the steering wheel, it may be becau
107
134
You can also connect CARLA to RAMN using a CAN adapter (internal or external) instead of the USB serial connection. To do this:
108
135
109
136
- Modify the scripts' settings to specify your CAN interface (see :ref:`configure_ramn_scripts`)
110
-
- Execute *4_CARLA_RAMN_manual_CAN.bat* to connect RAMN to CARLA and drive the vehicle manually.
111
-
- Execute *5_CARLA_RAMN_auto_CAN.bat* to connect RAMN to CARLA with the self-driving algorithm.
137
+
- Execute ``4_CARLA_RAMN_manual_CAN.bat`` to connect RAMN to CARLA and drive the vehicle manually.
138
+
- Execute ``5_CARLA_RAMN_auto_CAN.bat`` to connect RAMN to CARLA with the self-driving algorithm.
112
139
113
-
The CAN scripts have less features and typically worse performances than the serial one, so avoid using them unless you have a specific use case for them.
140
+
The CAN scripts have fewer features and typically worse performances than the serial one, so avoid using them unless you have a specific use case for them.
114
141
115
142
.. warning::
116
143
When using the CARLA scripts, the serial port of RAMN will not be available for other applications. If you want to interact with the CAN bus, it is recommended that you connect an external CAN adapter. On Linux, you can use the :ref:`vcand` script to multiplex the serial port and observe the CAN bus even when the CARLA scripts are in use.
0 commit comments