carla/LibCarla/cmake/fast_dds/CMakeLists.txt

57 lines
2.2 KiB
CMake
Raw Permalink Normal View History

Ros2 (#6862) * Adding ROS2 manager * Trying to compile fastDDS in windows, but have problems with dependencies * Camera sensors connected to ROS2, dependencies disabled temporaly * Including enum with sensors list * adding GNSS sensor capture * adding IMU sensor capture * adding DVS sensor capture * adding Lidar sensor capture * adding SemanticLidar and Radar capture * adding ObstacleDetector and some fixes * modify cmakelists, failed to find libatomic * fixed libatomic * compile fast-dds with libc++ * fixed compliation fast dds with libcxx * linked carla with fastdds * Fixed Fast-DDS lib Now its compiled to a intermediate lib with a bridge so libstdc++ can be used * moved all ros2 deps to ros2 folder renamed types from .cxx to .cpp * Finally FastDDS compiled and working inside CARLA * exposed publish function for testing * fixed code style * make ros2 optional * make ros2 optional * Added defines to compile ROS2 code * ros image publisher working * deleted some buffer copies * Added more topics and ROS2 types * Adding sensor Transform as argument, and add function to send buffer or serialize and send buffer * Removing empty buffer from DVS sensor * fixed lidar publisher * fixed lidar publisher * Fix buffer of RGB in ROS2 * adding timestamp of each frame into ROS2 manager * sending timestamps with frame to ROS2 * put apart timestamp from frame counter call * adding BufferView to share buffers * adding BufferView to share buffers * adding ros_name attribute to all actors * mapping ros_name for each actor * ROS2 is now published in a different thread Publishers now can be created on demand and be reused Added subscriber for ego vehicle Fixed build scripts * forgot to add this fix * add ros2 to windows scripts * fixed default ros topic names * fix topic name duplication * Adding functions for enable/disable sensors publishing without listen to it * Added Camera info and ROI types RGB Camera now publishes in both topics * move camera info immutable data to the constructor * Publish transform for all topics Create Camera DVS subtopics Fixed bug with Lidar * Added flip Y to semantic lidar * Adding callbacks for subscribers from Unreal * Adding camera info to ROS2 (resolution and FOV) * Finished ROS2 naming from python * Fixed bug with ros names * Delete topics when deleting the sensors * setting the rosname same as default no longer rewrites it * ROS transform fix * Added all camera topics with the image and camera info Added vehicle control Added clock publisher * Change ros2 topic names for vehicle subscriber and clock publisher * Rename vehicle control ros2 topic name * rename subscriber type to CarlaEgoVehicleControl * Fix semantic lidar default ros name Fix sizeof the semantic lidar data buffer * Changed controller stored as string to pointer * Back to previous version for default hero ros name Removed debug prints * Remvoe callback when ego publisher disconnects * Serializing DVS data before sending to ROS * dvs camera image and lidar * DVS Pointcloud publishing * Remove unnecessary fields * Send local transforms to ros * avoid transform recalculation if not needed * Optical Flow Camera fixed * Set fixed branch for Fast-DDS to avoid cmake version change issues * Finally Working on package * Fix style from FastDDS auto generated files * Added ros2 to ubuntu in jenkins * removed ros2 from jenkins, test * restore ros2 in jenkins * fix copy shareds, and removed server dependency from libcarla * test installing the fastdds dependencies in jenkins * move installing deps to separate stage * removed install deps * Fixing test_benchmark_streaming * Fixed imu orientation and camera info data * Fixing test_benchmark_streaming.cpp with BufferView * Removing DEBUG_ONLY() * publish collision sensor * Fixing unit-tests with the new BufferView * camera info is set once * Fix echo camera info * fix transform rotation * Fixing ros_name attribute creation * fixed camera info and region of interest publish * fix IMU compass * Forgot to add ros2 flag to jenkins package --------- Co-authored-by: bernatx <bernatx@gmail.com>
2023-11-06 19:34:07 +08:00
cmake_minimum_required(VERSION 3.5.1)
project(libcarla_fastdds)
# Install headers.
file(GLOB libcarla_carla_fastdds_headers
"${libcarla_source_path}/carla/ros2/publishers/*.h"
"${libcarla_source_path}/carla/ros2/subscribers/*.h"
"${libcarla_source_path}/carla/ros2/listeners/*.h"
"${libcarla_source_path}/carla/ros2/types/*.h"
)
install(FILES ${libcarla_carla_fastdds_headers} DESTINATION include/carla/ros2)
file(GLOB fast_dds_dependencies "${FASTDDS_LIB_PATH}/*.so*")
install(FILES ${fast_dds_dependencies} DESTINATION lib)
file(GLOB libcarla_fastdds_sources
"${libcarla_source_path}/carla/ros2/publishers/*.cpp"
"${libcarla_source_path}/carla/ros2/subscribers/*.cpp"
"${libcarla_source_path}/carla/ros2/listeners/*.cpp"
"${libcarla_source_path}/carla/ros2/types/*.cpp")
set(FASTDDS_CPP_STD_INCLUDES "/usr/include/c++/7")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -I${FASTDDS_CPP_STD_INCLUDES}" CACHE STRING "" FORCE)
# ==============================================================================
# Create targets for debug and release in the same build type.
# ==============================================================================
if (LIBCARLA_BUILD_RELEASE)
add_library(carla_fastdds STATIC ${libcarla_fastdds_sources})
target_include_directories(carla_fastdds SYSTEM PRIVATE
"${BOOST_INCLUDE_PATH}"
"${RPCLIB_INCLUDE_PATH}")
target_include_directories(carla_fastdds PRIVATE "${FASTDDS_INCLUDE_PATH}")
target_include_directories(carla_fastdds PRIVATE "${libcarla_source_path}/carla/ros2")
target_link_libraries(carla_fastdds fastrtps fastcdr "${FAST_DDS_LIBRARIES}")
install(TARGETS carla_fastdds DESTINATION lib)
set_target_properties(carla_fastdds PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}")
endif()
if (LIBCARLA_BUILD_DEBUG)
add_library(carla_fastdds_debug STATIC ${libcarla_fastdds_sources})
target_include_directories(carla_fastdds_debug SYSTEM PRIVATE
"${BOOST_INCLUDE_PATH}"
"${RPCLIB_INCLUDE_PATH}")
install(TARGETS carla_fastdds_debug DESTINATION lib)
set_target_properties(carla_fastdds_debug PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}")
target_compile_definitions(carla_fastdds_debug PUBLIC -DBOOST_ASIO_ENABLE_BUFFER_DEBUGGING)
endif()