diff --git a/.travis.yml b/.travis.yml
index 43c7f26b4..605906bc4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,10 +13,10 @@ matrix:
apt:
sources:
- ubuntu-toolchain-r-test
- - llvm-toolchain-trusty-5.0
+ - llvm-toolchain-trusty-6.0
packages:
- g++-7 # we need this one for the libstdc++.
- - clang-5.0
+ - clang-6.0
- ninja-build
- python
- python-pip
@@ -38,18 +38,6 @@ matrix:
after_failure:
- tail --lines=2000 build.log
- - env: TEST="Pylint 2"
- addons:
- apt:
- packages:
- - python
- - python-pip
- install:
- - pip2 install -q --user -r Deprecated/PythonClient/requirements.txt
- - pip2 install -q --user pylint
- script:
- - pylint --disable=R,C --rcfile=Deprecated/PythonClient/.pylintrc Deprecated/PythonClient/carla Deprecated/PythonClient/*.py
-
- env: TEST="MkDocs"
install:
- pip install -q --user mkdocs
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b5615db8a..7e2469355 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,20 @@
-## Latest Release Version
+## Latest changes
- * Added point transformation functionality for LibCarla and PythonAPI.
+ * Upgraded to Unreal Engine 4.21
+ * Upgraded Boost to 1.69.0
+ * Added point transformation functionality for LibCarla and PythonAPI
+ * Added "sensor_tick" attribute to sensors (cameras and lidars) to specify the capture rate in seconds
+ * Added "get_forward_vector()" to rotation and transform, retrieves the unit vector on the rotation's X-axis
+ * Added support for Deepin in PythonAPI's setup.py
+ * Added support for spawning and controlling walkers (pedestrians)
+ * Renamed vehicle.get_vehicle_control() to vehicle.get_control() to be consistent with walkers
+ * Added a few methods to manage an actor:
+ - set_velocity: for setting the linear velocity
+ - set_angular_velocity: for setting the angular velocity
+ - get_angular_velocity: for getting the angular velocity
+ - add_impulse: for applying an impulse (in world axis)
+ * Added support for gnss_sensor
+ * OpenDriveActor has been rewritten using the Waypoint API, this has fixed some bugs
## CARLA 0.9.2
diff --git a/Docs/build_system.md b/Docs/build_system.md
index 21c13f8d4..b3fe24ab4 100644
--- a/Docs/build_system.md
+++ b/Docs/build_system.md
@@ -11,7 +11,7 @@ process.
![modules](img/modules.png)
-In Linux, we compile CARLA and all the dependencies with clang-5.0 and C++14
+In Linux, we compile CARLA and all the dependencies with clang-6.0 and C++14
standard. We however link against different runtime C++ libraries depending on
where the code going to be used, since all the code that is going to be linked
with Unreal Engine needs to be compiled using `libc++`.
@@ -26,9 +26,9 @@ make setup
Get and compile dependencies
- * llvm-5.0 (libc++ and libc++abi)
+ * llvm-6.0 (libc++ and libc++abi)
* rpclib-2.2.1 (twice, with libstdc++ and libc++)
- * boost-1.67 (headers only)
+ * boost-1.69 (headers only)
* googletest-1.8.0 (with libc++)
#### LibCarla
@@ -53,7 +53,7 @@ Two configurations:
#### CarlaUE4 and Carla plugin
-Both compiled at the same step with Unreal Engine 4.19 build tool. They require
+Both compiled at the same step with Unreal Engine 4.21 build tool. They require
the `UE4_ROOT` environment variable set.
Command
diff --git a/Docs/cameras_and_sensors.md b/Docs/cameras_and_sensors.md
index 48b56b1aa..7d3360344 100644
--- a/Docs/cameras_and_sensors.md
+++ b/Docs/cameras_and_sensors.md
@@ -18,6 +18,8 @@ blueprint = world.get_blueprint_library().find('sensor.camera.rgb')
blueprint.set_attribute('image_size_x', '1920')
blueprint.set_attribute('image_size_y', '1080')
blueprint.set_attribute('fov', '110')
+# Set the time in seconds between sensor captures
+blueprint.set_attribute('sensor_tick', '1.0')
# Provide the position of the sensor relative to the vehicle.
transform = carla.Transform(carla.Location(x=0.8, z=1.7))
# Tell the world to spawn the sensor, don't forget to attach it to your vehicle actor.
@@ -58,6 +60,9 @@ The "RGB" camera acts as a regular camera capturing images from the scene.
| `image_size_y` | int | 600 | Image height in pixels |
| `fov` | float | 90.0 | Field of view in degrees |
| `enable_postprocess_effects` | bool | True | Whether the post-process effect in the scene affect the image |
+| `sensor_tick` | float | 0.0 | Seconds between sensor captures (ticks) |
+
+`sensor_tick` tells how fast we want the sensor to capture the data. A value of 1.5 means that we want the sensor to capture data each second and a half. By default a value of 0.0 means as fast as possible.
If `enable_postprocess_effects` is enabled, a set of post-process effects is
applied to the image to create a more realistic feel
@@ -95,6 +100,7 @@ pixel to the camera (also known as **depth buffer** or **z-buffer**).
| `image_size_x` | int | 800 | Image width in pixels |
| `image_size_y` | int | 600 | Image height in pixels |
| `fov` | float | 90.0 | Field of view in degrees |
+| `sensor_tick` | float | 0.0 | Seconds between sensor captures (ticks) |
This sensor produces [`carla.Image`](python_api.md#carlaimagecarlasensordata)
objects.
@@ -132,6 +138,7 @@ pedestrians appear in a different color than vehicles.
| `image_size_x` | int | 800 | Image width in pixels |
| `image_size_y` | int | 600 | Image height in pixels |
| `fov` | float | 90.0 | Field of view in degrees |
+| `sensor_tick` | float | 0.0 | Seconds between sensor captures (ticks) |
This sensor produces [`carla.Image`](python_api.md#carlaimagecarlasensordata)
objects.
@@ -197,6 +204,7 @@ supposed to generate this frame; `points_per_second / (FPS * channels)`.
| `rotation_frequency` | float | 10.0 | Lidar rotation frequency |
| `upper_fov` | float | 10.0 | Angle in degrees of the upper most laser |
| `lower_fov` | float | -30.0 | Angle in degrees of the lower most laser |
+| `sensor_tick` | float | 0.0 | Seconds between sensor captures (ticks) |
This sensor produces
[`carla.LidarMeasurement`](python_api.md#carlalidarmeasurementcarlasensordata)
@@ -277,3 +285,23 @@ object for each lane marking crossed by the actor
| `transform` | carla.Transform | Transform in world coordinates of the sensor at the time of the measurement |
| `actor` | carla.Actor | Actor that invaded another lane ("self" actor) |
| `crossed_lane_markings` | carla.LaneMarking list | List of lane markings that have been crossed |
+
+sensor.other.gnss
+-----------------
+
+This sensor, when attached to an actor, reports its current gnss position.
+The gnss position is internally calculated by adding the metric position to
+an initial geo reference location defined within the OpenDRIVE map definition.
+
+This sensor produces
+[`carla.GnssEvent`](python_api.md#carlagnsseventcarlasensordata)
+objects.
+
+| Sensor data attribute | Type | Description |
+| ---------------------- | ----------- | ----------- |
+| `frame_number` | int | Frame count when the measurement took place |
+| `transform` | carla.Transform | Transform in world coordinates of the sensor at the time of the measurement |
+| `latitude` | double | Latitude position of the actor |
+| `longitude` | double | Longitude position of the actor |
+| `altitude` | double | Altitude of the actor |
+
diff --git a/Docs/coding_standard.md b/Docs/coding_standard.md
index d8bcb483e..b2ebc12cd 100644
--- a/Docs/coding_standard.md
+++ b/Docs/coding_standard.md
@@ -27,7 +27,7 @@ C++
* Comments should not exceed 80 columns, code may exceed this limit a bit in
rare occasions if it results in clearer code.
* Compilation should not give any error or warning
- (`clang++ -Wall -Wextra -std=C++14 -Wno-missing-braces`).
+ (`clang++-6.0 -Wall -Wextra -std=C++14 -Wno-missing-braces`).
* Unreal C++ code (CarlaUE4 and Carla plugin) follow the
[Unreal Engine's Coding Standard][ue4link] with the exception of using
spaces instead of tabs.
diff --git a/Docs/how_to_build_on_linux.md b/Docs/how_to_build_on_linux.md
index 504b55880..82b62d2dc 100644
--- a/Docs/how_to_build_on_linux.md
+++ b/Docs/how_to_build_on_linux.md
@@ -8,20 +8,20 @@ Install the build tools and dependencies
```
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
-sudo apt-get install build-essential clang-5.0 lld-5.0 g++-7 cmake ninja-build python python-pip python-dev python3-dev python3-pip libpng16-dev libtiff5-dev libjpeg-dev tzdata sed curl wget unzip autoconf libtool
+sudo apt-get install build-essential clang-6.0 lld-6.0 g++-7 cmake ninja-build python python-pip python-dev python3-dev python3-pip libpng16-dev libtiff5-dev libjpeg-dev tzdata sed curl wget unzip autoconf libtool
pip2 install --user setuptools nose2
pip3 install --user setuptools nose2
```
To avoid compatibility issues between Unreal Engine and the CARLA dependencies,
the best configuration is to compile everything with the same compiler version
-and C++ runtime library. We use clang 5.0 and LLVM's libc++. We recommend to
+and C++ runtime library. We use clang 6.0 and LLVM's libc++. We recommend to
change your default clang version to compile Unreal Engine and the CARLA
dependencies
```sh
-sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-5.0/bin/clang++ 101
-sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-5.0/bin/clang 101
+sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-6.0/bin/clang++ 102
+sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-6.0/bin/clang 102
```
Build Unreal Engine
@@ -32,13 +32,13 @@ Build Unreal Engine
need to add your GitHub username when you sign up at
[www.unrealengine.com](https://www.unrealengine.com).
-Download and compile Unreal Engine 4.19. Here we will assume you install it at
-`~/UnrealEngine_4.19", but you can install it anywhere, just replace the path
+Download and compile Unreal Engine 4.21. Here we will assume you install it at
+`~/UnrealEngine_4.21", but you can install it anywhere, just replace the path
where necessary.
```sh
-git clone --depth=1 -b 4.19 https://github.com/EpicGames/UnrealEngine.git ~/UnrealEngine_4.19
-cd ~/UnrealEngine_4.19
+git clone --depth=1 -b 4.21 https://github.com/EpicGames/UnrealEngine.git ~/UnrealEngine_4.21
+cd ~/UnrealEngine_4.21
./Setup.sh && ./GenerateProjectFiles.sh && make
```
@@ -71,7 +71,7 @@ For CARLA to find your Unreal Engine's installation folder you need to set the
following environment variable
```sh
-export UE4_ROOT=~/UnrealEngine_4.19
+export UE4_ROOT=~/UnrealEngine_4.21
```
You can also add this variable to your `~/.bashrc` or `~/.profile`.
diff --git a/Docs/how_to_build_on_windows.md b/Docs/how_to_build_on_windows.md
index fa3499b62..76ffe78dd 100644
--- a/Docs/how_to_build_on_windows.md
+++ b/Docs/how_to_build_on_windows.md
@@ -15,7 +15,7 @@
Also:
-- [Unreal Engine](https://www.unrealengine.com/download) (v4.19.x)
+- [Unreal Engine](https://www.unrealengine.com/download) (v4.21.x)
- [Visual Studio](https://www.visualstudio.com/downloads/) (2017)
Environment Setup
diff --git a/Docs/how_to_make_a_new_map.md b/Docs/how_to_make_a_new_map.md
index ed396ddfb..b667eac22 100644
--- a/Docs/how_to_make_a_new_map.md
+++ b/Docs/how_to_make_a_new_map.md
@@ -1,4 +1,4 @@
-How to make a new map in CARLA with RoadRunner
+How to make a new map with RoadRunner
![Town03](img/create_map_01.jpg)
@@ -7,7 +7,7 @@
RoadRunner is a powerful software from Vector Zero to create 3D scenes. Using RoadRunner is easy, in a few steps you will be able to create an impressive scene. You can download
a trial of RoadRunner at:
-![vectorzero](img/logo_vectorzero.jpg) https://www.vectorzero.io/
+![vectorzero](img/logo_vectorzero.jpg) [https://www.vectorzero.io/](https://www.vectorzero.io/)
Step 1 - Create your map in RoadRunner:
@@ -84,7 +84,7 @@ and save it inside Game/Carla/Maps/
Once everything is loaded up you should end with several staticMeshes in the folder
you have selected. Drag them all to the level and you will have
-your map in Unreal! Congratulations!.
+your map in Unreal! Congratulations!.
The time taken by the loading process will depend on how many pieces you cut the map into. Be patient! All the pieces share the same center pivot, so if they are positioned
in the same place they should fit as they did in the RoadRunner Editor. When
@@ -143,8 +143,8 @@ for the meshes the last one was referencing.
Setting up the traffic based on OpenDrive:
!!! Note
- the current version of CARLA needs a CarlaMapGenerator spawned in order to use the server autopilot functionality. From the current version it is also to drive all vehicles using the new client nvaigation stack. However, if you still want to use the server autopilot you will need to create a CarlaMapGenerator for your city --never above or under it.
-
+ the current version of CARLA needs a CarlaMapGenerator spawned in order to use the server autopilot functionality. From the current version it is also to drive all vehicles using the new client nvaigation stack. However, if you still want to use the server autopilot you will need to create a CarlaMapGenerator for your city --never above or under it.
+
* You will need to place points for the vehicles to spawn. The actor that sets the
spawn position of the vehicles is called VehicleSpawnPoint. CARLA vehicles
must overlap with one of the RoutePlanner's trigger box for them to be
@@ -161,7 +161,7 @@ for the meshes the last one was referencing.
* Traffic lights must be placed in every crossing in whitch vehicles might
conflict. theese are the childs of "TrafficLightBase" and are stored inside
Game/Carla/Static/TrafficSigns/Streetlights_01.
-
+
Again, remember this is just needed to use the server autopilot. We recommend to start using new the client driving stack provided from 0.9.2 version.
Working with BP_TrafficLight and BP_TrafficLightGroups:
diff --git a/Docs/index.md b/Docs/index.md
index 609982360..dbbea3d97 100644
--- a/Docs/index.md
+++ b/Docs/index.md
@@ -24,6 +24,7 @@
* [Python API reference](python_api.md)
* [Running without display and selecting GPUs](carla_headless.md)
* [Running in a Docker](carla_docker.md)
+ * [How to make a new map with RoadRunner](how_to_make_a_new_map.md)
* [How to link Epic's Automotive Materials](epic_automotive_materials.md)
Contributing
diff --git a/Docs/python_api.md b/Docs/python_api.md
index 20d87d571..381c42b9d 100644
--- a/Docs/python_api.md
+++ b/Docs/python_api.md
@@ -106,7 +106,7 @@
- `bounding_box`
- `apply_control(vehicle_control)`
-- `get_vehicle_control()`
+- `get_control()`
- `set_autopilot(enabled=True)`
## `carla.TrafficLight(carla.Actor)`
@@ -160,6 +160,12 @@
- `actor`
- `crossed_lane_markings`
+## `carla.GnssEvent(carla.SensorData)`
+
+- `latitude`
+- `longitude`
+- `altitude`
+
## `carla.VehicleControl`
- `throttle`
@@ -243,6 +249,7 @@ Static presets
- `pitch`
- `yaw`
- `roll`
+- `get_forward_vector()`
- `__eq__(other)`
- `__ne__(other)`
@@ -250,10 +257,10 @@ Static presets
- `location`
- `rotation`
+- `transform(geom_object)`
+- `get_forward_vector()`
- `__eq__(other)`
- `__ne__(other)`
-- `transform_point`
-- `transform_point_list`
## `carla.BoundingBox`
diff --git a/Jenkinsfile b/Jenkinsfile
index 8180d158f..bc106bac0 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -2,7 +2,7 @@ pipeline {
agent any
environment {
- UE4_ROOT = '/var/lib/jenkins/UnrealEngine_4.19'
+ UE4_ROOT = '/var/lib/jenkins/UnrealEngine_4.21'
}
options {
diff --git a/LibCarla/source/carla/PythonUtil.h b/LibCarla/source/carla/PythonUtil.h
index 528bf8470..b667feca9 100644
--- a/LibCarla/source/carla/PythonUtil.h
+++ b/LibCarla/source/carla/PythonUtil.h
@@ -9,7 +9,14 @@
#include "carla/NonCopyable.h"
#ifdef LIBCARLA_WITH_PYTHON_SUPPORT
-# include
+# if defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wdeprecated-register"
+# endif
+# include
+# if defined(__clang__)
+# pragma clang diagnostic pop
+# endif
#endif // LIBCARLA_WITH_PYTHON_SUPPORT
namespace carla {
diff --git a/LibCarla/source/carla/client/Actor.cpp b/LibCarla/source/carla/client/Actor.cpp
index 8235d11fd..e66732f7b 100644
--- a/LibCarla/source/carla/client/Actor.cpp
+++ b/LibCarla/source/carla/client/Actor.cpp
@@ -24,6 +24,14 @@ namespace client {
return GetEpisode().Lock()->GetActorVelocity(*this);
}
+ geom::Vector3D Actor::GetAngularVelocity() const {
+ return GetEpisode().Lock()->GetActorAngularVelocity(*this);
+ }
+
+ void Actor::SetAngularVelocity(const geom::Vector3D &vector) {
+ GetEpisode().Lock()->SetActorAngularVelocity(*this, vector);
+ }
+
geom::Vector3D Actor::GetAcceleration() const {
return GetEpisode().Lock()->GetActorAcceleration(*this);
}
@@ -36,6 +44,14 @@ namespace client {
GetEpisode().Lock()->SetActorTransform(*this, transform);
}
+ void Actor::SetVelocity(const geom::Vector3D &vector) {
+ GetEpisode().Lock()->SetActorVelocity(*this, vector);
+ }
+
+ void Actor::AddImpulse(const geom::Vector3D &vector) {
+ GetEpisode().Lock()->AddActorImpulse(*this, vector);
+ }
+
void Actor::SetSimulatePhysics(const bool enabled) {
GetEpisode().Lock()->SetActorSimulatePhysics(*this, enabled);
}
diff --git a/LibCarla/source/carla/client/Actor.h b/LibCarla/source/carla/client/Actor.h
index a985e8d2e..0a1cfa73c 100644
--- a/LibCarla/source/carla/client/Actor.h
+++ b/LibCarla/source/carla/client/Actor.h
@@ -46,6 +46,12 @@ namespace client {
/// velocity received in the last tick.
geom::Vector3D GetVelocity() const;
+ /// Return the current 3D angular velocity of the actor.
+ ///
+ /// @note This function does not call the simulator, it returns the
+ /// angular velocity received in the last tick.
+ geom::Vector3D GetAngularVelocity() const;
+
/// Return the current 3D acceleration of the actor.
///
/// @note This function does not call the simulator, it returns the
@@ -58,9 +64,18 @@ namespace client {
/// Teleport and rotate the actor to @a transform.
void SetTransform(const geom::Transform &transform);
+ /// Set the actor velocity.
+ void SetVelocity(const geom::Vector3D &vector);
+
+ /// Add impulse to the actor.
+ void AddImpulse(const geom::Vector3D &vector);
+
/// Enable or disable physics simulation on this actor.
void SetSimulatePhysics(bool enabled = true);
+ /// Set the angular velocity of the actor
+ void SetAngularVelocity(const geom::Vector3D &vector);
+
/// @warning This method only checks whether this instance of Actor has
/// called the Destroy() method, it does not check whether the actor is
/// actually alive in the simulator.
diff --git a/LibCarla/source/carla/client/GnssSensor.cpp b/LibCarla/source/carla/client/GnssSensor.cpp
new file mode 100644
index 000000000..d5e3fdd2d
--- /dev/null
+++ b/LibCarla/source/carla/client/GnssSensor.cpp
@@ -0,0 +1,160 @@
+// Copyright (c) 2019 Intel Labs.
+//
+// This work is licensed under the terms of the MIT license.
+// For a copy, see .
+
+#include "carla/client/GnssSensor.h"
+
+#include "carla/Logging.h"
+#include "carla/client/Map.h"
+#include "carla/client/detail/Simulator.h"
+#include "carla/geom/Math.h"
+#include "carla/sensor/data/GnssEvent.h"
+#include "carla/StringUtil.h"
+
+#include
+#include
+#include
+#include
+
+#if defined(_WIN32) && !defined(_USE_MATH_DEFINES)
+#define _USE_MATH_DEFINES
+#include // cmath is not enough for MSVC
+#endif
+
+namespace carla {
+namespace client {
+
+ const double EARTH_RADIUS_EQUA = 6378137.0;// earth radius at equator [m]
+
+ // inlined functions to avoid multiple definitions
+
+ /// @brief convert latitude to scale, which is needed by mercator transformations
+ /// @param lat latitude in degrees (DEG)
+ /// @return scale factor
+ /// @note when converting from lat/lon -> mercator and back again,
+ /// or vice versa, use the same scale in both transformations!
+ inline double LatToScale (double lat) {
+ return cos(lat * geom::Math::pi() / 180.0);
+ }
+
+ /// @brief converts lat/lon/scale to mx/my (mx/my in meters if correct scale is given)
+ ///
+ template
+ inline void LatLonToMercator (double lat, double lon, double scale, float_type &mx, float_type &my) {
+ mx = scale * lon * geom::Math::pi() * EARTH_RADIUS_EQUA / 180.0;
+ my = scale * EARTH_RADIUS_EQUA * log( tan((90.0+lat) * geom::Math::pi() / 360.0) );
+ }
+
+ /// @brief converts mx/my/scale to lat/lon (mx/my in meters if correct scale is given)
+ inline void MercatorToLatLon (double mx, double my, double scale, double &lat, double &lon) {
+ lon = mx * 180.0 / (geom::Math::pi() * EARTH_RADIUS_EQUA * scale);
+ lat = 360.0 * atan( exp(my/(EARTH_RADIUS_EQUA * scale)) ) / geom::Math::pi() - 90.0;
+ }
+
+ /// @brief adds meters dx/dy to given lat/lon and returns new lat/lon
+ inline void LatLonAddMeters (double lat_start, double lon_start, double dx, double dy, double &lat_end, double &lon_end) {
+ double scale = LatToScale (lat_start);
+ double mx,my;
+ LatLonToMercator (lat_start, lon_start, scale, mx, my);
+ mx += dx;
+ my += dy;
+ MercatorToLatLon (mx, my, scale, lat_end, lon_end);
+ }
+
+ GnssSensor::~GnssSensor() = default;
+
+ void GnssSensor::Listen(CallbackFunctionType callback) {
+ if (_is_listening) {
+ log_error(GetDisplayId(), ": already listening");
+ return;
+ }
+
+ if (GetParent() == nullptr) {
+ throw std::runtime_error(GetDisplayId() + ": not attached to vehicle");
+ return;
+ }
+
+ SharedPtr