Documentation fixes
This commit is contained in:
parent
1061e0f395
commit
9a16cf9a03
|
@ -11,11 +11,11 @@ The time-step is the _simulation-time_ elapsed between two steps of the
|
|||
simulation. In video-games, this _simulation-time_ is almost always adjusted to
|
||||
real time for better realism. This is achieved by having a **variable
|
||||
time-step** that adjusts the simulation to keep up with real-time. In
|
||||
simulations however, it is better to detach the _simulation-time_ from real-
|
||||
time, and let the simulation run as fast as possible using a **fixed time-
|
||||
step**. Doing so, we are not only able to simulate longer periods in less time,
|
||||
but also gain repeatability by reducing the float-point arithmetic errors that a
|
||||
variable time-step introduces.
|
||||
simulations however, it is better to detach the _simulation-time_ from
|
||||
real-time, and let the simulation run as fast as possible using a **fixed
|
||||
time-step**. Doing so, we are not only able to simulate longer periods in less
|
||||
time, but also gain repeatability by reducing the float-point arithmetic errors
|
||||
that a variable time-step introduces.
|
||||
|
||||
CARLA can be run in both modes.
|
||||
|
||||
|
|
123
Docs/faq.md
123
Docs/faq.md
|
@ -44,57 +44,12 @@ Once you open the project in the Unreal Editor, you can hit Play to test CARLA.
|
|||
<!-- ======================================================================= -->
|
||||
<details>
|
||||
<summary><h5 style="display:inline">
|
||||
Setup.sh fails to download content, can I skip this step?
|
||||
Can I connect to the simulator while running within Unreal Editor?
|
||||
</h4></summary>
|
||||
|
||||
It is possible to skip the download step by passing the `-s` argument to the
|
||||
setup script
|
||||
|
||||
$ ./Setup.sh -s
|
||||
|
||||
Bear in mind that if you do so, you are supposed to manually download and
|
||||
extract the content package yourself, check out the last output of the Setup.sh
|
||||
for instructions or run
|
||||
|
||||
$ ./Update.sh -s
|
||||
|
||||
</details>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<details>
|
||||
<summary><h5 style="display:inline">
|
||||
Can I run the server from within Unreal Editor?
|
||||
</h4></summary>
|
||||
|
||||
Yes, you can connect the Python client to a server running within Unreal Editor
|
||||
as if it was the standalone server.
|
||||
|
||||
Go to **"Unreal/CarlaUE4/Config/CarlaSettings.ini"** (this file should have been
|
||||
created by the Setup.sh) and enable networking. If for whatever reason you don't
|
||||
have this file, just create it and add the following
|
||||
|
||||
```ini
|
||||
[CARLA/Server]
|
||||
UseNetworking=true
|
||||
```
|
||||
|
||||
Now when you hit Play the editor will hang until a client connects.
|
||||
|
||||
</details>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<details>
|
||||
<summary><h5 style="display:inline">
|
||||
Why Unreal Editor hangs after hitting Play?
|
||||
</h4></summary>
|
||||
|
||||
This is most probably happening because CARLA is starting in server mode. Check
|
||||
your **"Unreal/CarlaUE4/Config/CarlaSettings.ini"** and set
|
||||
|
||||
```ini
|
||||
[CARLA/Server]
|
||||
UseNetworking=false
|
||||
```
|
||||
Yes, you can connect a Python client to a simulator running within Unreal
|
||||
Editor. Press the "Play" button and wait until the scene is loaded, at that
|
||||
point you can connect as you would with the standalone simulator.
|
||||
|
||||
</details>
|
||||
|
||||
|
@ -104,9 +59,9 @@ UseNetworking=false
|
|||
How can I create a binary version of CARLA?
|
||||
</h4></summary>
|
||||
|
||||
In Linux, the recommended way is to use the `Package.sh` script provided. This
|
||||
script makes a packaged version of the project, including the Python client.
|
||||
This is the script we use to make a release of CARLA for Linux.
|
||||
In Linux, the recommended way is to run `make package` in the project folder.
|
||||
This method makes a packaged version of the project, including the Python API
|
||||
modules. This is the method we use to make a release of CARLA for Linux.
|
||||
|
||||
Alternatively, it is possible to compile a binary version of CARLA within Unreal
|
||||
Editor, open the CarlaUE4 project, go to the menu "File -> Package Project", and
|
||||
|
@ -130,11 +85,11 @@ disable the "Use Less CPU When in Background" option.
|
|||
<!-- ======================================================================= -->
|
||||
<details>
|
||||
<summary><h5 style="display:inline">
|
||||
Is it possible to dump images from the CARLA server view?
|
||||
Is it possible to dump images from the CARLA simulator view?
|
||||
</h4></summary>
|
||||
|
||||
Yes, this is an Unreal Engine feature. You can dump the images of the server
|
||||
camera by running CARLA with
|
||||
Yes, this is an Unreal Engine feature. You can dump the images of the spectator
|
||||
camera (simulator view) by running CARLA with
|
||||
|
||||
$ ./CarlaUE4.sh -benchmark -fps=30 -dumpmovie
|
||||
|
||||
|
@ -148,62 +103,12 @@ Images are saved to "CarlaUE4/Saved/Screenshots/LinuxNoEditor".
|
|||
Fatal error: 'version.h' has been modified since the precompiled header.
|
||||
</h4></summary>
|
||||
|
||||
This happens from time to time due to Linux updates. It is possible to force a
|
||||
rebuild of all the project files with
|
||||
This happens from time to time due to Linux updates, and for that we have a
|
||||
special target in our Makefile
|
||||
|
||||
$ cd Unreal/CarlaUE4/
|
||||
$ make CarlaUE4Editor ARGS=-clean
|
||||
$ make hard-clean
|
||||
$ make CarlaUE4Editor
|
||||
|
||||
It takes a long time but fixes the issue. Sometimes a reboot is also needed.
|
||||
|
||||
</details>
|
||||
|
||||
<!-- ======================================================================= -->
|
||||
<details>
|
||||
<summary><h5 style="display:inline">
|
||||
Fatal error: 'carla/carla_server.h' file not found.
|
||||
</h4></summary>
|
||||
|
||||
This indicates that the CarlaServer dependency failed to compile.
|
||||
|
||||
Please follow the instructions at
|
||||
[How to build on Linux](http://carla.readthedocs.io/en/latest/how_to_build_on_linux/).
|
||||
|
||||
Make sure that the Setup script does print _"Success!"_ at the end
|
||||
|
||||
$ ./Setup.sh
|
||||
...
|
||||
...
|
||||
****************
|
||||
*** Success! ***
|
||||
****************
|
||||
|
||||
Then check if CarlaServer compiles without errors running make
|
||||
|
||||
$ make
|
||||
|
||||
It should end printing something like
|
||||
|
||||
```
|
||||
[1/1] Install the project...
|
||||
-- Install configuration: "Release"
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/shared/libc++abi.so.1
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/shared/libc++abi.so.1.0
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/shared/libc++.so.1
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/shared/libc++.so.1.0
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/shared/libc++.so
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/shared/libc++abi.so
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/lib/libc++abi.a
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/lib/libboost_system.a
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/lib/libprotobuf.a
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/include/carla
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/include/carla/carla_server.h
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/lib/libcarlaserver.a
|
||||
-- Installing: Unreal/CarlaUE4/Plugins/Carla/CarlaServer/bin/test_carlaserver
|
||||
-- Set runtime path of "Unreal/CarlaUE4/Plugins/Carla/CarlaServer/bin/test_carlaserver" to ""
|
||||
```
|
||||
|
||||
If so you can safely run Rebuild.sh.
|
||||
It takes a long time but fixes the issue.
|
||||
|
||||
</details>
|
||||
|
|
|
@ -25,16 +25,16 @@ First of all, we need to introduce a few core concepts:
|
|||
|
||||
#### Connecting and retrieving the world
|
||||
|
||||
To connect to a simulator we need to create a "Client" object, and to do so we
|
||||
need to provide the IP address and port of a running instance of the simulator
|
||||
To connect to a simulator we need to create a "Client" object, to do so we need
|
||||
to provide the IP address and port of a running instance of the simulator
|
||||
|
||||
```py
|
||||
client = carla.Client('localhost', 2000)
|
||||
```
|
||||
|
||||
First thing most scripts do is setting the client time-out. This time-out sets a
|
||||
time limit to all networking operations, if the time-out is not set networking
|
||||
operations may block forever.
|
||||
The first recommended thing to do right after creating a client instance is
|
||||
setting its time-out. This time-out sets a time limit to all networking
|
||||
operations, if the time-out is not set networking operations may block forever
|
||||
|
||||
```py
|
||||
client.set_timeout(10.0) # seconds
|
||||
|
@ -47,7 +47,7 @@ world = client.get_world()
|
|||
```
|
||||
|
||||
Typically we won't need the client object anymore, all the objects created by
|
||||
the world will connect to the IP and port provided if they need to. This
|
||||
the world will connect to the IP and port provided if they need to. These
|
||||
operations are usually done in the background and are transparent to the user.
|
||||
|
||||
#### Blueprints
|
||||
|
@ -111,7 +111,7 @@ The spawn actor function comes in two flavours, `spawn_actor` and
|
|||
spawned, the later will return `None` instead. The most typical cause of
|
||||
failure is collision at spawn point, meaning the actor does not fit at the spot
|
||||
we chose; probably another vehicle is in that spot or we tried to spawn into a
|
||||
building.
|
||||
static object.
|
||||
|
||||
To ease the task of finding a spawn location, each map provides a list of
|
||||
recommended transforms
|
||||
|
@ -120,11 +120,11 @@ recommended transforms
|
|||
spawn_points = world.get_map().get_spawn_points()
|
||||
```
|
||||
|
||||
We add more on the map class later in this tutorial.
|
||||
We'll add more on the map object later in this tutorial.
|
||||
|
||||
Finally, the spawn functions have an optional argument that controls whether the
|
||||
actor is going to be attached to another actor. This is specially useful for
|
||||
sensors. In the next example the camera remains rigidly attached to our vehicle
|
||||
sensors. In the next example, the camera remains rigidly attached to our vehicle
|
||||
during the rest of the simulation
|
||||
|
||||
```py
|
||||
|
@ -153,13 +153,13 @@ We can even freeze and actor by disabling its physics simulation
|
|||
actor.set_simulate_physics(False)
|
||||
```
|
||||
|
||||
And once we are tired of an actor we can remove it from the simulation with
|
||||
And once we get tired of an actor we can remove it from the simulation with
|
||||
|
||||
```py
|
||||
actor.destroy()
|
||||
```
|
||||
|
||||
Note that actors are not cleaned up automatically when we the Python script
|
||||
Note that actors are not cleaned up automatically when the Python script
|
||||
finishes, if we want to get rid of them we need to explicitly destroy them.
|
||||
|
||||
!!! important
|
||||
|
@ -171,9 +171,9 @@ finishes, if we want to get rid of them we need to explicitly destroy them.
|
|||
|
||||
#### Vehicles
|
||||
|
||||
Vehicles are a special type of actors that provide a few methods specific for
|
||||
wheeled vehicles. Apart from the handling methods common to all actors, vehicles
|
||||
can also be controlled by providing throttle, break, and steer values
|
||||
Vehicles are a special type of actor that provide a few extra methods. Apart
|
||||
from the handling methods common to all actors, vehicles can also be controlled
|
||||
by providing throttle, break, and steer values
|
||||
|
||||
```py
|
||||
vehicle.apply_control(carla.VehicleControl(throttle=1.0, steer=-1.0))
|
||||
|
@ -213,9 +213,9 @@ print(box.extent) # XYZ half-box extents in meters.
|
|||
|
||||
#### Sensors
|
||||
|
||||
Sensors are a special type of actor that produce a stream of data. Sensors are
|
||||
such a key component of CARLA that they deserve their own documentation page, so
|
||||
here we'll limit ourselves to show a small example of how sensors work
|
||||
Sensors are actors that produce a stream of data. Sensors are such a key
|
||||
component of CARLA that they deserve their own documentation page, so here we'll
|
||||
limit ourselves to show a small example of how sensors work
|
||||
|
||||
```py
|
||||
camera_bp = blueprint_library.find('sensor.camera.rgb')
|
||||
|
@ -224,15 +224,15 @@ camera.listen(lambda image: image.save_to_disk('output/%06d.png' % image.frame_n
|
|||
```
|
||||
|
||||
In this example we have attached a camera to a vehicle, and told the camera to
|
||||
save to disk each of the images generated.
|
||||
save to disk each of the images that are going to be generated.
|
||||
|
||||
The full list of sensors and their measurement is explained in
|
||||
[Cameras and sensors](cameras_and_sensors.md).
|
||||
|
||||
#### Other actors
|
||||
|
||||
Apart from vehicles and sensors, there are many other actors in the world. The
|
||||
full list can be requested to the world
|
||||
Apart from vehicles and sensors, there are a few other actors in the world. The
|
||||
full list can be requested to the world with
|
||||
|
||||
```py
|
||||
actor_list = world.get_actors()
|
||||
|
@ -283,13 +283,13 @@ The full list of presets can be found in the
|
|||
|
||||
#### Map and waypoints
|
||||
|
||||
One of the key features of CARLA is that our roads are fully annotated, all our
|
||||
maps come accompanied by an OpenDrive file that defines the road layout.
|
||||
Furthermore, we provide a higher level API for querying and navigating this
|
||||
information.
|
||||
One of the key features of CARLA is that our roads are fully annotated. All our
|
||||
maps come accompanied by [OpenDrive](http://www.opendrive.org/) files that
|
||||
defines the road layout. Furthermore, we provide a higher level API for querying
|
||||
and navigating this information.
|
||||
|
||||
These objects were a recent addition to our API and are still in heavy
|
||||
development, we hope to make them soon much more powerful that are now.
|
||||
development, we hope to make them soon much more powerful yet.
|
||||
|
||||
Let's start by getting the map of the current world
|
||||
|
||||
|
@ -313,7 +313,7 @@ waypoint = map.get_waypoint(vehicle.get_location())
|
|||
This waypoint's `transform` is located on a drivable lane, and it's oriented
|
||||
according to the road direction at that point.
|
||||
|
||||
Waypoints also have function to query the "next" waypoints, this method returns
|
||||
Waypoints also have function to query the "next" waypoints; this method returns
|
||||
a list of waypoints at a certain distance that can be accessed from this
|
||||
waypoint following the traffic rules. In other words, if a vehicle is placed in
|
||||
this waypoint, give me the list of posible locations that this vehicle can drive
|
||||
|
@ -337,7 +337,7 @@ The map object also provides methods for generating in bulk waypoints all over
|
|||
the map at an approximated distance between them
|
||||
|
||||
```py
|
||||
map.generate_waypoints(2.0)
|
||||
waypoint_list = map.generate_waypoints(2.0)
|
||||
```
|
||||
|
||||
For routing purposes, it is also possible to retrieve a topology graph of the
|
||||
|
|
Loading…
Reference in New Issue