Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework ros2 support #7229

Open
wants to merge 72 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
1116b1c
Cleanup and harmonize Carla build
berndgassmann Feb 15, 2024
24d67ca
Remove deletion of Cdr.h until new ROS2 commit
berndgassmann Feb 15, 2024
9459d72
Revert not required changes in UE4 project settings
berndgassmann Feb 15, 2024
e3ad358
Merge branch 'dev' into berndgassmann/compile_ros2_against_unreal_dep…
berndgassmann Feb 28, 2024
3b411c0
Merge remote-tracking branch 'origin/dev' into berndgassmann/compile_…
berndgassmann Mar 11, 2024
7bdbe8f
Rework ROS2 support
berndgassmann Feb 28, 2024
cac1560
Use updated Cdr.h header by include ordering
berndgassmann Mar 11, 2024
aa2cde8
Add CarlaStatus publisher
berndgassmann Mar 11, 2024
92c71f1
Make MSVC happy
berndgassmann Mar 15, 2024
012077d
Merge branch 'dev' into berndgassmann/rework_ros2_support
berndgassmann Mar 15, 2024
16561ec
Merge remote-tracking branch 'origin/dev' into berndgassmann/rework_r…
berndgassmann Mar 19, 2024
d133082
Reflect MSVC changes in PythonAPI
berndgassmann Mar 19, 2024
02cd5a2
Added CarlaActorList publisher
berndgassmann Mar 19, 2024
ee7f1e9
Switch to carla-simulator/ros-carla-msgs
berndgassmann Mar 19, 2024
0362e9d
Fix DDS services and QoS settings
berndgassmann Mar 19, 2024
b9b55e3
Merge remote-tracking branch 'origin/dev' into berndgassmann/rework_r…
berndgassmann Mar 19, 2024
31bd246
Merge remote-tracking branch 'origin/dev' into berndgassmann/compile_…
berndgassmann Mar 21, 2024
426dc9a
Merge branch 'berndgassmann/compile_ros2_against_unreal_dependencies'…
berndgassmann Mar 21, 2024
b176e85
Merge branch 'dev' into berndgassmann/compile_ros2_against_unreal_dep…
Blyron Mar 26, 2024
1e3168b
Update Linux Build instructions
berndgassmann Mar 27, 2024
c3cff03
Fix of docu
berndgassmann Mar 27, 2024
46e99e0
Merge branch 'berndgassmann/compile_ros2_against_unreal_dependencies'…
berndgassmann Mar 27, 2024
19c55eb
Some cleanup
berndgassmann Mar 27, 2024
9bf02bc
Merge remote-tracking branch 'origin/dev' into berndgassmann/compile_…
berndgassmann Mar 27, 2024
71c4e95
Some cleanup
berndgassmann Mar 27, 2024
8198cab
Merge branch 'berndgassmann/compile_ros2_against_unreal_dependencies'…
berndgassmann Mar 27, 2024
937416c
remove carla_msgs submodule
berndgassmann Apr 4, 2024
92c89ff
Remove some left-over functions
berndgassmann Apr 4, 2024
334598e
Extend server-side synchronization interface
berndgassmann Apr 8, 2024
2c88010
Add CarlaSynchronizationSubscriber
berndgassmann Apr 15, 2024
e06708d
Merge remote-tracking branch 'origin/dev' into berndgassmann/compile_…
berndgassmann Apr 15, 2024
ec94119
Cleanup and fixes
berndgassmann Apr 15, 2024
6589498
Merge branch 'berndgassmann/compile_ros2_against_unreal_dependencies'…
berndgassmann Apr 15, 2024
a1749e8
Made fastdds one possible ROS2_MW in build files
berndgassmann Apr 15, 2024
18cdc78
(Re-)Added g++13 to build_linux.md
berndgassmann Apr 15, 2024
97fcbfe
Merge remote-tracking branch 'origin/berndgassmann/compile_ros2_again…
berndgassmann Apr 15, 2024
d8fc257
Fix CarlaSynchronizationWindowSubscriber
berndgassmann Apr 16, 2024
4813b3b
Fix Windows build
berndgassmann Apr 18, 2024
cb2dc8a
Merge branch 'dev' into berndgassmann/compile_ros2_against_unreal_dep…
Blyron Apr 18, 2024
cdd9970
Squashed commit of the following:
berndgassmann Apr 18, 2024
34036ac
Merge remote-tracking branch 'origin/berndgassmann/compile_ros2_again…
berndgassmann Apr 18, 2024
1374a9b
Merge branch 'dev' into berndgassmann/rework_ros2_support
berndgassmann Apr 30, 2024
843dde9
Merge branch 'dev' into berndgassmann/compile_ros2_against_unreal_dep…
berndgassmann Apr 30, 2024
e738fb6
Merge branch 'dev' into berndgassmann/rework_ros2_support
berndgassmann May 2, 2024
940271a
Merge branch 'dev' into berndgassmann/compile_ros2_against_unreal_dep…
berndgassmann May 2, 2024
966fe1b
Merge branch 'berndgassmann/compile_ros2_against_unreal_dependencies'…
berndgassmann May 6, 2024
0bf7421
Merge remote-tracking branch 'origin/dev' into berndgassmann/rework_r…
berndgassmann May 6, 2024
e5f9053
enforce UE libc and ld on sysroot build
berndgassmann May 17, 2024
d4195c9
next trial to fix linking
berndgassmann May 21, 2024
187dfc8
fix boost rebuild check
berndgassmann May 22, 2024
b724214
Fix Radar publisher
berndgassmann May 22, 2024
5d62e47
Use native clang compilation
berndgassmann May 23, 2024
59387be
Fixed client test build
berndgassmann May 23, 2024
2e8de1a
Merge branch 'dev' into berndgassmann/rework_ros2_support
berndgassmann May 29, 2024
c6b513c
Revert removal of "EnableForROS()" feature
berndgassmann May 29, 2024
5f21e7a
Support EnableForRos() for all Actors
berndgassmann Jun 4, 2024
b03906d
Merge remote-tracking branch 'origin/dev' into berndgassmann/rework_r…
berndgassmann Jun 12, 2024
5f1e58d
Some Major Fixes
berndgassmann Jun 14, 2024
38f1918
Enable vehicles and walkers as synchronization participants
berndgassmann Jun 14, 2024
68f3ffd
Add V2XCustom Sensor to ROS2 interface
berndgassmann Jun 14, 2024
54414c5
fix make clean call
berndgassmann Jun 14, 2024
ac23a07
Update CHANGELOG.md
berndgassmann Jun 16, 2024
96f0e5c
Windows build
berndgassmann Jun 17, 2024
88191eb
Add Eigen C++20 patches
berndgassmann Jun 17, 2024
49805b0
Fix DVSCameraPublisher
berndgassmann Jun 17, 2024
23ad811
Reenable Unreal sysroot usage
berndgassmann Jun 17, 2024
4fa3fbc
Enforce ansimalloc on startup if compiled with ROS2
berndgassmann Jun 18, 2024
1031584
Fix MsgPack packed data types
berndgassmann Jun 18, 2024
f5a90a2
Fix build with ALLOW_UNSAFE_GEOM_MATRIX_ACCESS=1
berndgassmann Jun 18, 2024
50b3a8f
Use only UnrealSysroot clang
berndgassmann Jun 19, 2024
d2b59ed
Fix make PythonAPI.rss
berndgassmann Jun 24, 2024
835b88f
Fix ROS2 services
berndgassmann Jun 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@
* Added functions to get actor' sockets transforms
* make PythonAPI Windows: Fixed incompatibility issue with Anaconda due `py` command.
* Added function to get actor' sockets names
* Fixed bug in python agents when vehicle list was empty causing a check on all vehicles (BasicAgent.py) and detected pedestrians as vehicles if no pedestrains are present (BehaviourAgent.py)
* Fixed bug in python agents when vehicle list was empty causing a check on all vehicles (BasicAgent.py) and detected pedestrians as vehicles if no pedestrains are present (BehaviourAgent.py)
* Extended debug drawing functions to allow drawing primitives on HUD layer
* Added possibility to change gravity variable in imui sensor for the accelerometer
* Fixed ROS2 native extension build error when ROS2 is installed in the system.
* ROS2Native: Force fast-dds dependencies download to avoid build crash when boost_asio and tinyxml2 are not installed in Linux.
* Added API function `get_telemetry_data` to the vehicle actor.
* PythonAPI `Sensor.is_listening` was defined twice (property and method), cleaned and clarified it as a method.
* Added V2X sensors for cooperative awareness message and custom user-defined messages to support vehicle-to-vehicle communication
* Added named tuples for BasicAgent.py's detection result to allow for type-hints and better semantics.

* Cleaned up the client/server build and respective naming
* ROS2Native: Integrated ROS2 native extension

## CARLA 0.9.15

Expand Down
38 changes: 11 additions & 27 deletions Docs/build_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CARLA requires many different kinds of software to run. Some are built during th
sudo apt-get update &&
sudo apt-get install wget software-properties-common &&
sudo add-apt-repository ppa:ubuntu-toolchain-r/test &&
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add
sudo apt-get update
```

!!! Warning
Expand All @@ -50,53 +50,37 @@ To avoid compatibility issues between Unreal Engine and the CARLA dependencies,

__Ubuntu 22.04__.
```sh
sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu focal main universe"
sudo apt-get update
sudo apt-get install build-essential clang-10 lld-10 g++-7 cmake ninja-build libvulkan1 python python3 python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git git-lfs
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-10/bin/clang++ 180 &&
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-10/bin/clang 180 &&
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 180
sudo apt-get install build-essential g++-13 cmake ninja-build libvulkan1 python python3 python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git git-lfs
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 180
```

__Ubuntu 20.04__.
```sh
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main"
sudo apt-get update
sudo apt-get install build-essential clang-10 lld-10 g++-7 cmake ninja-build libvulkan1 python python-dev python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-10/bin/clang++ 180 &&
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-10/bin/clang 180
sudo apt-get install build-essential g++-13 cmake ninja-build libvulkan1 python python-dev python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 180
```

__Ubuntu 18.04__.

```sh
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main"
sudo apt-get update
sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-8/bin/clang++ 180 &&
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-8/bin/clang 180
sudo apt-get install build-essential g++-13 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 180
```

__Ubuntu 16.04__.

```sh
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main" &&
sudo apt-get update
sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng16-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-8/bin/clang++ 180 &&
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-8/bin/clang 180
sudo apt-get install build-essential g++-13 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng16-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 180
```

__Previous Ubuntu versions__.

We strongly advise using Ubuntu 18.04 or later to build CARLA. However, you may attempt to build CARLA on older versions of Ubuntu with the following commands:

```sh
sudo apt-add-repository "deb http://apt.llvm.org/<code_name>/ llvm-toolchain-<code_name>-8 main" &&
sudo apt-get update
sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng16-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-8/bin/clang++ 180 &&
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-8/bin/clang 180
sudo apt-get install build-essential g++-13 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng16-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 180
```

__All Ubuntu systems__.
Expand Down
2 changes: 1 addition & 1 deletion Docs/ref_sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ The function the user has to call every time to send a message. This function ne
- **Parameters:**
- `data` (_function_) - The called function with one argument containing the sensor data.

The custom V2X message sensor works a little bit different than other sensors, because it has the *send* function in addition to the *listen* function, that needs to be called, before another sensor of this type will receive anything. The transmission of a custom message is only triggered, when *send* is called. Each message given to the *send* function is only transmitted once to all Custom V2X Message sensors currently spawned.
The custom V2X message sensor works a little bit different than other sensors, because it has the *send* function in addition to the *listen* function, that needs to be called, before another sensor of this type will receive anything. The transmission of a custom message is only triggered, when *send* is called. Each message given to the *send* function is only transmitted once to all Custom V2X Message sensors currently spawned. Independent communcation channels can be created by the sensors 'role_name' attribute. Only sensors having the same 'role_name' are communicating with each other. This allows to create different sender/receiver groups within the system.

Example:

Expand Down
4 changes: 2 additions & 2 deletions Examples/CppClient/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ BINDIR=$(CURDIR)/bin
INSTALLDIR=$(CURDIR)/libcarla-install
TOOLCHAIN=$(CURDIR)/ToolChain.cmake

CC=/usr/bin/gcc-7
CXX=/usr/bin/g++-7
CC=/usr/bin/gcc-13
CXX=/usr/bin/g++-13
CXXFLAGS=-std=c++14 -pthread -fPIC -O3 -DNDEBUG -Werror -Wall -Wextra

define log
Expand Down
8 changes: 4 additions & 4 deletions LibCarla/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ project(libcarla)
option(LIBCARLA_BUILD_DEBUG "Build debug configuration" ON)
option(LIBCARLA_BUILD_RELEASE "Build release configuration" ON)
option(LIBCARLA_BUILD_TEST "Build unit tests" ON)
option(LIBCARLA_USE_ROS "Build ROS variant" OFF)

message(STATUS "Build debug: ${LIBCARLA_BUILD_DEBUG}")
message(STATUS "Build release: ${LIBCARLA_BUILD_RELEASE}")
message(STATUS "Build test: ${LIBCARLA_BUILD_TEST}")
message(STATUS "Enable ROS: ${LIBCARLA_USE_ROS}")

set(libcarla_source_path "${PROJECT_SOURCE_DIR}/../source")
set(libcarla_source_thirdparty_path "${libcarla_source_path}/third-party")
Expand All @@ -24,14 +26,12 @@ if (CMAKE_BUILD_TYPE STREQUAL "Client")
elseif (CMAKE_BUILD_TYPE STREQUAL "Server")
add_subdirectory("server")
elseif (CMAKE_BUILD_TYPE STREQUAL "Pytorch")
add_subdirectory("pytorch")
elseif (CMAKE_BUILD_TYPE STREQUAL "ros2")
add_subdirectory("fast_dds")
add_subdirectory("pytorch")
else ()
message(FATAL_ERROR "Unknown build type '${CMAKE_BUILD_TYPE}'")
endif ()

# GTest is not compiled on Windows.
if ((LIBCARLA_BUILD_TEST) AND (NOT WIN32) AND (NOT (CMAKE_BUILD_TYPE STREQUAL "Pytorch")) AND (NOT (CMAKE_BUILD_TYPE STREQUAL "ros2")))
if ((LIBCARLA_BUILD_TEST) AND (NOT WIN32) AND (NOT (CMAKE_BUILD_TYPE STREQUAL "Pytorch")))
add_subdirectory("test")
endif()
16 changes: 8 additions & 8 deletions LibCarla/cmake/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ if (BUILD_RSS_VARIANT)
install(FILES ${spdlog_file} DESTINATION lib)
list(APPEND ADRSS_LIBS ${spdlog_file})

set(proj_include_dir ${ADRSS_INSTALL_DIR}/../../proj-install/include)
set(proj_lib ${ADRSS_INSTALL_DIR}/../../proj-install/lib/libproj.a)
set(proj_include_dir ${PROJ_INCLUDE_PATH})
set(proj_lib ${PROJ_LIBPATH}/libproj.a)
install(DIRECTORY ${proj_include_dir} DESTINATION include/system)
list(APPEND ADRSS_INCLUDE_DIRS ${proj_include_dir})
install(FILES ${proj_lib} DESTINATION lib)
Expand Down Expand Up @@ -98,6 +98,12 @@ file(GLOB libcarla_carla_sources
set(libcarla_sources "${libcarla_sources};${libcarla_carla_sources}")
install(FILES ${libcarla_carla_sources} DESTINATION include/carla)

file(GLOB libcarla_carla_actors_sources
"${libcarla_source_path}/carla/actors/*.cpp"
"${libcarla_source_path}/carla/actors/*.h")
set(libcarla_sources "${libcarla_sources};${libcarla_carla_actors_sources}")
install(FILES ${libcarla_carla_actors_sources} DESTINATION include/carla/actors)

file(GLOB libcarla_carla_client_sources
"${libcarla_source_path}/carla/client/*.cpp"
"${libcarla_source_path}/carla/client/*.h")
Expand Down Expand Up @@ -266,12 +272,6 @@ file(GLOB libcarla_carla_trafficmanager_sources
set(libcarla_sources "${libcarla_sources};${libcarla_carla_trafficmanager_sources}")
install(FILES ${libcarla_carla_trafficmanager_sources} DESTINATION include/carla/trafficmanager)

file(GLOB libcarla_carla_ros2_sources
"${libcarla_source_path}/carla/ros2/*.cpp"
"${libcarla_source_path}/carla/ros2/*.h")
set(libcarla_sources "${libcarla_sources};${libcarla_carla_ros2_sources}")
install(FILES ${libcarla_carla_ros2_sources} DESTINATION include/carla/ros2)

# ==============================================================================
# Create targets for debug and release in the same build type.
# ==============================================================================
Expand Down
56 changes: 0 additions & 56 deletions LibCarla/cmake/fast_dds/CMakeLists.txt

This file was deleted.

Loading