Remove boost from ROS2 (#7670)
This commit is contained in:
parent
298d44b31b
commit
2bbe3c5e8b
|
@ -82,7 +82,6 @@ if (BUILD_OSM_WORLD_RENDERER)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (ENABLE_ROS2)
|
if (ENABLE_ROS2)
|
||||||
set (BOOST_INCLUDE_PATH ${CMAKE_BINARY_DIR}/_deps/boost-src/libs)
|
|
||||||
add_subdirectory (Ros2Native)
|
add_subdirectory (Ros2Native)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -6,16 +6,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#pragma warning(push)
|
|
||||||
#pragma warning(disable:4583)
|
|
||||||
#pragma warning(disable:4582)
|
|
||||||
#include <boost/variant2/variant.hpp>
|
|
||||||
#pragma warning(pop)
|
|
||||||
#else
|
|
||||||
#include <boost/variant2/variant.hpp>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <variant>
|
#include <variant>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
@ -38,8 +28,8 @@ namespace ros2 {
|
||||||
const char* message;
|
const char* message;
|
||||||
};
|
};
|
||||||
|
|
||||||
using ROS2CallbackData = boost::variant2::variant<VehicleControl>;
|
using ROS2CallbackData = std::variant<VehicleControl>;
|
||||||
using ROS2MessageCallbackData = boost::variant2::variant<MessageControl>;
|
using ROS2MessageCallbackData = std::variant<MessageControl>;
|
||||||
|
|
||||||
using ActorCallback = std::function<void(void *actor, ROS2CallbackData data)>;
|
using ActorCallback = std::function<void(void *actor, ROS2CallbackData data)>;
|
||||||
using ActorMessageCallback = std::function<void(void *actor, ROS2MessageCallbackData data)>;
|
using ActorMessageCallback = std::function<void(void *actor, ROS2MessageCallbackData data)>;
|
||||||
|
|
|
@ -33,7 +33,7 @@ ExternalProject_Add (
|
||||||
carla-ros2-native-lib
|
carla-ros2-native-lib
|
||||||
DEPENDS fastdds
|
DEPENDS fastdds
|
||||||
SOURCE_DIR ${PROJECT_SOURCE_DIR}/LibCarlaRos2Native
|
SOURCE_DIR ${PROJECT_SOURCE_DIR}/LibCarlaRos2Native
|
||||||
CMAKE_ARGS ${PROJECT_CMAKE_FLAGS} -DBOOST_INCLUDE_PATH=${BOOST_INCLUDE_PATH}
|
CMAKE_ARGS ${PROJECT_CMAKE_FLAGS}
|
||||||
)
|
)
|
||||||
|
|
||||||
set (CARLA_PLUGIN_BINARY_PATH ${CMAKE_SOURCE_DIR}/Unreal/CarlaUnreal/Plugins/Carla/Binaries/Linux)
|
set (CARLA_PLUGIN_BINARY_PATH ${CMAKE_SOURCE_DIR}/Unreal/CarlaUnreal/Plugins/Carla/Binaries/Linux)
|
||||||
|
|
|
@ -32,10 +32,6 @@ add_library (
|
||||||
target_include_directories (carla-ros2-native SYSTEM PRIVATE
|
target_include_directories (carla-ros2-native SYSTEM PRIVATE
|
||||||
${LIBCARLA_SOURCE_PATH}
|
${LIBCARLA_SOURCE_PATH}
|
||||||
${CMAKE_INSTALL_PREFIX}/include
|
${CMAKE_INSTALL_PREFIX}/include
|
||||||
${BOOST_INCLUDE_PATH}/variant2/include
|
|
||||||
${BOOST_INCLUDE_PATH}/mp11/include
|
|
||||||
${BOOST_INCLUDE_PATH}/assert/include
|
|
||||||
${BOOST_INCLUDE_PATH}/config/include
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_definitions (carla-ros2-native PUBLIC
|
target_compile_definitions (carla-ros2-native PUBLIC
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include <compiler/disable-ue4-macros.h>
|
#include <compiler/disable-ue4-macros.h>
|
||||||
#include "carla/ros2/ROS2.h"
|
#include "carla/ros2/ROS2.h"
|
||||||
#include <compiler/enable-ue4-macros.h>
|
#include <compiler/enable-ue4-macros.h>
|
||||||
|
#include <variant>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void UActorDispatcher::Bind(FActorDefinition Definition, SpawnFunctionType Functor)
|
void UActorDispatcher::Bind(FActorDefinition Definition, SpawnFunctionType Functor)
|
||||||
|
@ -213,14 +214,14 @@ FCarlaActor* UActorDispatcher::RegisterActor(
|
||||||
{
|
{
|
||||||
AActor *UEActor = reinterpret_cast<AActor *>(Actor);
|
AActor *UEActor = reinterpret_cast<AActor *>(Actor);
|
||||||
ActorROS2Handler Handler(UEActor, RosName);
|
ActorROS2Handler Handler(UEActor, RosName);
|
||||||
boost::variant2::visit(Handler, Data);
|
std::visit(Handler, Data);
|
||||||
});
|
});
|
||||||
|
|
||||||
ROS2->AddBasicSubscriberCallback(static_cast<void*>(&Actor), RosName, [RosName](void *Actor, carla::ros2::ROS2MessageCallbackData Data) -> void
|
ROS2->AddBasicSubscriberCallback(static_cast<void*>(&Actor), RosName, [RosName](void *Actor, carla::ros2::ROS2MessageCallbackData Data) -> void
|
||||||
{
|
{
|
||||||
AActor *UEActor = reinterpret_cast<AActor *>(Actor);
|
AActor *UEActor = reinterpret_cast<AActor *>(Actor);
|
||||||
ActorROS2Handler Handler(UEActor, RosName);
|
ActorROS2Handler Handler(UEActor, RosName);
|
||||||
boost::variant2::visit(Handler, Data);
|
std::visit(Handler, Data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue