From 0e1de325cdf97b91d6006b426f172b90efdd17d7 Mon Sep 17 00:00:00 2001 From: Nikola Jovicic Date: Thu, 23 Mar 2023 15:45:32 +0100 Subject: [PATCH] Ubuntu 22.04, ros humble fixes --- build.sh | 10 +++++----- cmake/cmake-modules/CommonSetup.cmake | 2 +- ros2/src/airsim_ros_pkgs/CMakeLists.txt | 12 ++++++++++++ ros2/src/airsim_ros_pkgs/package.xml | 4 ++++ setup.sh | 4 ++-- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 8b45d64ba1..4dac1e7cea 100755 --- a/build.sh +++ b/build.sh @@ -64,11 +64,11 @@ if [ "$(uname)" == "Darwin" ]; then export CXX="$(brew --prefix)/opt/llvm/bin/clang++" else if $gcc; then - export CC="gcc-8" - export CXX="g++-8" + export CC="gcc-11" + export CXX="g++-11" else - export CC="clang-8" - export CXX="clang++-8" + export CC="clang-11" + export CXX="clang++-11" fi fi @@ -117,7 +117,7 @@ pushd $build_dir >/dev/null # final linking of the binaries can fail due to a missing libc++abi library # (happens on Fedora, see https://bugzilla.redhat.com/show_bug.cgi?id=1332306). # So we only build the libraries here for now -make -j"$(nproc)" +make -lc++fs -j"$(nproc)" popd >/dev/null mkdir -p AirLib/lib/x64/$folder_name diff --git a/cmake/cmake-modules/CommonSetup.cmake b/cmake/cmake-modules/CommonSetup.cmake index 11d0c9bcb2..e5c6cfbb3b 100644 --- a/cmake/cmake-modules/CommonSetup.cmake +++ b/cmake/cmake-modules/CommonSetup.cmake @@ -59,7 +59,7 @@ macro(CommonSetup) if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") set(CMAKE_CXX_FLAGS "-stdlib=libc++ -Wno-documentation -Wno-unknown-warning-option ${CMAKE_CXX_FLAGS}") find_package(LLVM REQUIRED CONFIG) - set(CXX_EXP_LIB "-L${LLVM_LIBRARY_DIRS} -lc++fs -ferror-limit=10") + set(CXX_EXP_LIB "-L${LLVM_LIBRARY_DIRS} -ferror-limit=10") else() set(CXX_EXP_LIB "-lstdc++fs -fmax-errors=10 -Wnoexcept -Wstrict-null-sentinel") endif () diff --git a/ros2/src/airsim_ros_pkgs/CMakeLists.txt b/ros2/src/airsim_ros_pkgs/CMakeLists.txt index 6d961a430f..e4fee5265b 100644 --- a/ros2/src/airsim_ros_pkgs/CMakeLists.txt +++ b/ros2/src/airsim_ros_pkgs/CMakeLists.txt @@ -59,6 +59,9 @@ ament_target_dependencies(pd_position_controller_simple nav_msgs geometry_msgs airsim_interfaces + tf2 + tf2_ros + tf2_geometry_msgs ) add_library(airsim_ros src/airsim_ros_wrapper.cpp) @@ -72,6 +75,11 @@ ament_target_dependencies(airsim_ros tf2_ros cv_bridge airsim_interfaces + mavros_msgs + std_srvs + tf2_geometry_msgs + tf2_sensor_msgs + tf2 ) add_executable(airsim_node src/airsim_node.cpp) @@ -86,6 +94,10 @@ target_link_libraries(pd_position_controller_simple_node pd_position_controller_simple airsim_ros AirLib) ament_target_dependencies(pd_position_controller_simple_node rclcpp + mavros_msgs + tf2 + tf2_ros + tf2_geometry_msgs ) # rosidl_target_interfaces(airsim_node diff --git a/ros2/src/airsim_ros_pkgs/package.xml b/ros2/src/airsim_ros_pkgs/package.xml index 74d1f44f20..4669e931c4 100644 --- a/ros2/src/airsim_ros_pkgs/package.xml +++ b/ros2/src/airsim_ros_pkgs/package.xml @@ -12,6 +12,10 @@ rosidl_interface_packages + tf2 + tf2_ros + tf2_geometry_msgs + geometry_msgs image_transport message_runtime diff --git a/setup.sh b/setup.sh index c2818fb006..3efc768c45 100755 --- a/setup.sh +++ b/setup.sh @@ -50,7 +50,7 @@ else #linux software-properties-common \ wget \ libvulkan1 \ - vulkan-utils + vulkan-tools #install clang and build tools VERSION=$(lsb_release -rs | cut -d. -f1) @@ -60,7 +60,7 @@ else #linux wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-get update fi - sudo apt-get install -y clang-8 clang++-8 libc++-8-dev libc++abi-8-dev + sudo apt-get install -y clang-11 clang++-11 libc++-11-dev libc++abi-11-dev fi if ! which cmake; then