Merge master into win_auto_rebuild
This commit is contained in:
commit
4c5fe773d5
|
@ -11,13 +11,13 @@ Fixed time-step
|
|||
|
||||
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 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.
|
||||
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.
|
||||
|
||||
CARLA can be run in both modes.
|
||||
|
||||
|
@ -43,4 +43,43 @@ simulator since this is actually a feature of Unreal Engine.
|
|||
Synchronous vs Asynchronous mode
|
||||
--------------------------------
|
||||
|
||||
> TODO
|
||||
The client-simulator communication can be synchronized by using the _synchronous
|
||||
mode_. The synchronous mode enables two things
|
||||
|
||||
* The simulator waits for the sensor data to be ready before sending the
|
||||
measurements.
|
||||
* The simulator halts each frame until a control message is received.
|
||||
|
||||
This is very useful when dealing with slow client applications, as the
|
||||
simulation is halted until the client is ready to continue. This also ensures
|
||||
that the generated data of every sensor is received every frame by the client.
|
||||
As opposed to _asynchronous mode_, in which the sensor data may arrive a couple
|
||||
of frames later or even be lost if the client is not fast enough.
|
||||
|
||||
However, there are a couple of caveats to bear in mind when using the
|
||||
synchronous mode. First of all, **it is very important to run the simulator at
|
||||
fixed time-step when using the synchronous mode**. Otherwise the physics engine
|
||||
will try to recompute at once all the time spent waiting for the client, this
|
||||
usually results in inconsistent or not very realistic physics.
|
||||
|
||||
Secondly, the synchronous mode imposes a significant performance penalty. There
|
||||
is a price in waiting for the render thread to have the images ready and halting
|
||||
the simulation when the client is slow. There is a trade-off in using the
|
||||
synchronous mode.
|
||||
|
||||
The synchronous mode can be enabled at the beginning of each episode both in the
|
||||
INI file or the Python API
|
||||
|
||||
**Python**
|
||||
|
||||
```py
|
||||
settings = CarlaSettings()
|
||||
settings.set(SynchronousMode=True)
|
||||
```
|
||||
|
||||
**CarlaSettings.ini**
|
||||
|
||||
```ini
|
||||
[CARLA/Server]
|
||||
SynchronousMode=true
|
||||
```
|
||||
|
|
12
Docs/faq.md
12
Docs/faq.md
|
@ -104,10 +104,14 @@ UseNetworking=false
|
|||
How can I create a binary version of CARLA?
|
||||
</h4></summary>
|
||||
|
||||
To compile a binary (packaged) version of CARLA, open the CarlaUE4 project with
|
||||
Unreal Editor, go to the menu "File -> Package Project", and select your
|
||||
platform. This takes a while, but in the end it should generate a packaged
|
||||
version of CARLA to execute without Unreal Editor.
|
||||
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.
|
||||
|
||||
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
|
||||
select your platform. This takes a while, but in the end it should generate a
|
||||
packaged version of CARLA to execute without Unreal Editor.
|
||||
|
||||
</details>
|
||||
|
||||
|
|
|
@ -47,7 +47,8 @@ Note that the `master` branch contains the latest fixes and features, for the
|
|||
latest stable code may be best to switch to the latest release tag.
|
||||
|
||||
Run the setup script to download the content and build all dependencies. It
|
||||
takes a while
|
||||
takes a while (you can speed up the process by parallelizing the script with the
|
||||
`--jobs=8` flag)
|
||||
|
||||
$ ./Setup.sh
|
||||
|
||||
|
|
|
@ -27,17 +27,18 @@ time-stamp keeps the actual time elapsed.
|
|||
Player measurements
|
||||
-------------------
|
||||
|
||||
Key | Type | Units | Description
|
||||
-------------------------- | --------- | ------ | ------------
|
||||
transform | Transform | | World transform of the player (contains a locations and a rotation).
|
||||
acceleration | Vector3D | m/s^2 | Current acceleration of the player.
|
||||
forward_speed | float | m/s | Forward speed of the player.
|
||||
collision_vehicles | float | kg*m/s | Collision intensity with other vehicles.
|
||||
collision_pedestrians | float | kg*m/s | Collision intensity with pedestrians.
|
||||
collision_other | float | kg*m/s | General collision intensity (everything else but pedestrians and vehicles).
|
||||
intersection_otherlane | float | | Percentage of the car invading other lanes.
|
||||
intersection_offroad | float | | Percentage of the car off-road.
|
||||
autopilot_control | Control | | Vehicle's autopilot control that would apply this frame.
|
||||
Key | Type | Units | Description
|
||||
-------------------------- | ----------- | ------ | ------------
|
||||
transform | Transform | | World transform of the player (contains a locations and a rotation) respect the vehicle's mesh pivot.
|
||||
bounding_box | BoundingBox | | Bounding box of the player.
|
||||
acceleration | Vector3D | m/s^2 | Current acceleration of the player.
|
||||
forward_speed | float | m/s | Forward speed of the player.
|
||||
collision_vehicles | float | kg*m/s | Collision intensity with other vehicles.
|
||||
collision_pedestrians | float | kg*m/s | Collision intensity with pedestrians.
|
||||
collision_other | float | kg*m/s | General collision intensity (everything else but pedestrians and vehicles).
|
||||
intersection_otherlane | float | | Percentage of the vehicle invading other lanes.
|
||||
intersection_offroad | float | | Percentage of the vehicle off-road.
|
||||
autopilot_control | Control | | Vehicle's autopilot control that would apply this frame.
|
||||
|
||||
<h4>Transform</h4>
|
||||
|
||||
|
@ -49,6 +50,15 @@ location | Vector3D | m | World location.
|
|||
orientation *[deprecated]* | Vector3D | | Orientation in Cartesian coordinates.
|
||||
rotation | Rotation3D | degrees | Pitch, roll, and yaw.
|
||||
|
||||
<h4>BoundingBox</h4>
|
||||
|
||||
Contains the transform and extent of a bounding box.
|
||||
|
||||
Key | Type | Units | Description
|
||||
-------------------------- | ---------- | ------- | ------------
|
||||
transform | Transform | | Transform of the bounding box relative to the vehicle.
|
||||
extent | Vector3D | m | Radii dimensions of the bounding box (half-box).
|
||||
|
||||
<h4>Collision</h4>
|
||||
|
||||
Collision variables keep an accumulation of all the collisions occurred during
|
||||
|
@ -150,7 +160,7 @@ for agent in measurements.non_player_agents:
|
|||
Key | Type | Description
|
||||
------------------------------- | --------- | ------------
|
||||
id | uint32 | Agent ID
|
||||
vehicle.forward_speed | float | Forward speed of the vehicle in m/s
|
||||
vehicle.forward_speed | float | Forward speed of the vehicle in m/s, is the linear speed projected to the forward vector of the chassis of the vehicle
|
||||
vehicle.transform | Transform | Agent-to-world transform
|
||||
vehicle.bounding_box.transform | Transform | Transform of the bounding box relative to the vehicle
|
||||
vehicle.bounding_box.extent | Vector3D | Radii dimensions of the bounding box in meters
|
||||
|
|
|
@ -13,7 +13,7 @@ pipeline {
|
|||
|
||||
stage('Setup') {
|
||||
steps {
|
||||
sh './Setup.sh'
|
||||
sh './Setup.sh --jobs=12'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
61
Setup.sh
61
Setup.sh
|
@ -16,6 +16,43 @@
|
|||
|
||||
set -e
|
||||
|
||||
DOC_STRING="Download and compile CARLA content and dependencies."
|
||||
|
||||
USAGE_STRING="Usage: $0 [-h|--help] [-s|--skip-download] [--jobs=N]"
|
||||
|
||||
# ==============================================================================
|
||||
# -- Parse arguments -----------------------------------------------------------
|
||||
# ==============================================================================
|
||||
|
||||
UPDATE_SCRIPT_FLAGS=
|
||||
NUMBER_OF_ASYNC_JOBS=1
|
||||
|
||||
OPTS=`getopt -o hs --long help,skip-download,jobs:: -n 'parse-options' -- "$@"`
|
||||
|
||||
if [ $? != 0 ] ; then echo "$USAGE_STRING" ; exit 2 ; fi
|
||||
|
||||
eval set -- "$OPTS"
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
-s | --skip-download )
|
||||
UPDATE_SCRIPT_FLAGS=--skip-download;
|
||||
shift ;;
|
||||
--jobs)
|
||||
case "$2" in
|
||||
"") NUMBER_OF_ASYNC_JOBS=4 ; shift 2 ;;
|
||||
*) NUMBER_OF_ASYNC_JOBS=$2 ; shift 2 ;;
|
||||
esac ;;
|
||||
-h | --help )
|
||||
echo "$DOC_STRING"
|
||||
echo "$USAGE_STRING"
|
||||
exit 1
|
||||
;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# ==============================================================================
|
||||
# -- Set up environment --------------------------------------------------------
|
||||
# ==============================================================================
|
||||
|
@ -61,10 +98,10 @@ cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} \
|
|||
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="../llvm-install" \
|
||||
../llvm-source
|
||||
|
||||
make cxx
|
||||
make -j $NUMBER_OF_ASYNC_JOBS cxx
|
||||
|
||||
#install libc++ locally in llvm-install folder
|
||||
make install-libcxx install-libcxxabi
|
||||
make -j $NUMBER_OF_ASYNC_JOBS install-libcxx install-libcxxabi
|
||||
|
||||
popd >/dev/null
|
||||
|
||||
|
@ -89,10 +126,13 @@ BOOST_TOOLSET="clang-3.9"
|
|||
BOOST_CFLAGS="-fPIC -std=c++1y -stdlib=libc++ -I../llvm-install/include/c++/v1"
|
||||
BOOST_LFLAGS="-stdlib=libc++ -L../llvm-install/lib"
|
||||
|
||||
./bootstrap.sh --with-toolset=clang --prefix=../boost-install
|
||||
./bootstrap.sh \
|
||||
--with-toolset=clang \
|
||||
--prefix=../boost-install \
|
||||
--with-libraries=system
|
||||
./b2 clean
|
||||
./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" linkflags="${BOOST_LFLAGS}" --prefix="../boost-install" -j 4 stage release
|
||||
./b2 install toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" linkflags="${BOOST_LFLAGS}" --prefix="../boost-install"
|
||||
./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" linkflags="${BOOST_LFLAGS}" --prefix="../boost-install" -j $NUMBER_OF_ASYNC_JOBS stage release
|
||||
./b2 install toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" linkflags="${BOOST_LFLAGS}" --prefix="../boost-install" -j $NUMBER_OF_ASYNC_JOBS
|
||||
|
||||
popd >/dev/null
|
||||
|
||||
|
@ -103,7 +143,7 @@ popd >/dev/null
|
|||
# Get protobuf source
|
||||
if [[ ! -d "protobuf-source" ]]; then
|
||||
echo "Retrieving protobuf..."
|
||||
git clone --depth=1 -b v3.3.0 https://github.com/google/protobuf.git protobuf-source
|
||||
git clone --depth=1 -b v3.3.0 --recurse-submodules https://github.com/google/protobuf.git protobuf-source
|
||||
else
|
||||
echo "Folder protobuf-source already exists, skipping git clone..."
|
||||
fi
|
||||
|
@ -118,9 +158,10 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD/../llvm-install/lib/"
|
|||
CXX="clang++-3.9" \
|
||||
CXXFLAGS="-fPIC -stdlib=libc++ -I$PWD/../llvm-install/include/c++/v1" \
|
||||
LDFLAGS="-stdlib=libc++ -L$PWD/../llvm-install/lib/" \
|
||||
--prefix="$PWD/../protobuf-install"
|
||||
make
|
||||
make install
|
||||
--prefix="$PWD/../protobuf-install" \
|
||||
--disable-shared
|
||||
make -j $NUMBER_OF_ASYNC_JOBS
|
||||
make -j $NUMBER_OF_ASYNC_JOBS install
|
||||
|
||||
popd >/dev/null
|
||||
|
||||
|
@ -171,7 +212,7 @@ fi
|
|||
# ==============================================================================
|
||||
|
||||
echo
|
||||
./Update.sh $@
|
||||
./Update.sh $UPDATE_SCRIPT_FLAGS
|
||||
|
||||
# ==============================================================================
|
||||
# -- ...and we are done --------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue