Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions CMake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,17 @@ carla_dependency_option (BOOST_LOCALE_WITH_ICU OFF)
carla_dependency_option (BOOST_LOCALE_WITH_ICONV OFF)
carla_dependency_option (BOOST_GIL_BUILD_EXAMPLES OFF)
carla_dependency_option (BOOST_GIL_BUILD_HEADER_TESTS OFF)
carla_dependency_option (BOOST_GIL_USE_BOOST_FILESYSTEM OFF)

set (BOOST_URL_SUFIX)
if (${CARLA_BOOST_VERSION} VERSION_GREATER 1.84.0)
set (BOOST_URL_SUFIX -cmake)
endif ()

carla_dependency_add(
boost
${CARLA_BOOST_TAG}
https://github.com/boostorg/boost/releases/download/${CARLA_BOOST_TAG}/${CARLA_BOOST_TAG}.zip
https://github.com/boostorg/boost/releases/download/${CARLA_BOOST_TAG}/${CARLA_BOOST_TAG}${BOOST_URL_SUFIX}.zip
https://github.com/boostorg/boost.git
)

Expand Down Expand Up @@ -216,8 +223,8 @@ carla_dependency_add (



# ==== PROJ ====
if (ENABLE_OSM2ODR)
# ==== PROJ ====
carla_dependency_option (BUILD_TESTING OFF)
carla_dependency_option (ENABLE_TIFF OFF)
carla_dependency_option (ENABLE_CURL OFF)
Expand All @@ -231,8 +238,8 @@ endif ()



# ==== XERCESC ====
if (ENABLE_OSM2ODR)
# ==== XERCESC ====
carla_dependency_add (
xercesc
${CARLA_XERCESC_TAG}
Expand All @@ -243,16 +250,20 @@ endif ()



# ==== LUNASVG ====
if (BUILD_OSM_WORLD_RENDERER)
# ==== LUNASVG ====
carla_dependency_add (
lunasvg
${CARLA_LUNASVG_TAG}
https://github.com/sammycage/lunasvg/archive/refs/tags/${CARLA_LUNASVG_TAG}.zip
https://github.com/sammycage/lunasvg.git
)
endif ()

# ==== LIBOSMSCOUT ====


# ==== LIBOSMSCOUT ====
if (BUILD_OSM_WORLD_RENDERER)
carla_dependency_add (
libosmscout
${CARLA_LIBOSMSCOUT_TAG}
Expand All @@ -263,8 +274,8 @@ endif ()



# ==== STREETMAP ====
if (BUILD_CARLA_UNREAL AND ENABLE_STREETMAP)
# ==== STREETMAP ====
carla_dependency_add (
StreetMap
${CARLA_STREETMAP_TAG}
Expand Down
2 changes: 1 addition & 1 deletion CMake/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ carla_string_option (
carla_string_option (
CARLA_BOOST_VERSION
"Target boost version."
1.84.0
1.87.0
)

carla_string_option (
Expand Down
5 changes: 1 addition & 4 deletions LibCarla/source/carla/ThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace carla {
class ThreadPool : private NonCopyable {
public:

ThreadPool() : _work_to_do(_io_context) {}
ThreadPool() = default;

/// Stops the ThreadPool and joins all its threads.
~ThreadPool() {
Expand Down Expand Up @@ -83,9 +83,6 @@ namespace carla {
private:

boost::asio::io_context _io_context;

boost::asio::io_context::work _work_to_do;

ThreadGroup _workers;
};

Expand Down
2 changes: 1 addition & 1 deletion LibCarla/source/carla/multigpu/listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace multigpu {
_acceptor.cancel();
_acceptor.close();
_io_context.stop();
_io_context.reset();
_io_context.restart();
}

void Listener::OpenSession(
Expand Down
2 changes: 1 addition & 1 deletion LibCarla/source/carla/multigpu/router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void Router::Stop() {
Router::Router(uint16_t port) :
_next(0) {

_endpoint = boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string("0.0.0.0"), port);
_endpoint = boost::asio::ip::tcp::endpoint(boost::asio::ip::make_address("0.0.0.0"), port);
_listener = std::make_shared<carla::multigpu::Listener>(_pool.io_context(), _endpoint);
}

Expand Down
2 changes: 1 addition & 1 deletion LibCarla/source/carla/multigpu/secondary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace multigpu {
_connection_timer(_pool.io_context()),
_buffer_pool(std::make_shared<BufferPool>()) {

boost::asio::ip::address ip_address = boost::asio::ip::address::from_string(ip);
boost::asio::ip::address ip_address = boost::asio::ip::make_address(ip);
_endpoint = boost::asio::ip::tcp::endpoint(ip_address, port);
_commander.set_callback(callback);
}
Expand Down
2 changes: 1 addition & 1 deletion LibCarla/source/carla/rpc/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace rpc {
TRACE_CPUPROFILER_EVENT_SCOPE_STR(__FUNCTION__);
#include <util/disable-ue4-macros.h>
#endif // LIBCARLA_INCLUDED_FROM_UE4
_sync_io_context.reset();
_sync_io_context.restart();
_sync_io_context.run_for(duration.to_chrono());
}

Expand Down
25 changes: 15 additions & 10 deletions LibCarla/source/carla/streaming/EndPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <boost/asio/ip/address.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ip/udp.hpp>
#include <boost/asio/ip/basic_resolver_query.hpp>

namespace carla {
namespace streaming {
Expand Down Expand Up @@ -72,17 +73,21 @@ namespace detail {
return boost::asio::ip::make_address("127.0.0.1");
}

static inline auto make_address(const std::string &address) {
static inline auto make_address(
const std::string &address)
{
using protocol_type = boost::asio::ip::tcp;
using resolver_type = boost::asio::ip::tcp::resolver;

boost::asio::io_context io_context;
boost::asio::ip::tcp::resolver resolver(io_context);
boost::asio::ip::tcp::resolver::query query(boost::asio::ip::tcp::v4(), address, "", boost::asio::ip::tcp::resolver::query::canonical_name);
boost::asio::ip::tcp::resolver::iterator iter = resolver.resolve(query);
boost::asio::ip::tcp::resolver::iterator end;
while (iter != end)
{
boost::asio::ip::tcp::endpoint endpoint = *iter++;
return endpoint.address();
}
resolver_type resolver(io_context);
auto result = resolver.resolve(
protocol_type::v4(),
address,
std::string_view(),
resolver_type::canonical_name);
for (auto& e : result)
return e.endpoint().address();
return boost::asio::ip::make_address(address);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void UMapPreviewUserWidget::CreateTexture()
void UMapPreviewUserWidget::ConnectToSocket(FString DatabasePath, FString StylesheetPath, int Size)
{
const unsigned int PORT = 5000;
SocketPtr = std::make_unique<AsioSocket>(io_service);
SocketPtr = std::make_unique<AsioSocket>(io_context);
SocketPtr->connect(AsioEndpoint(AsioTCP::v4(), PORT));
if(!SocketPtr->is_open())
{
Expand Down Expand Up @@ -76,7 +76,7 @@ void UMapPreviewUserWidget::RenderMap(FString Latitude, FString Longitude, FStri
std::size_t BytesReceived =
Asio::read(*SocketPtr, Buffer, Asio::transfer_at_least(2));
TArray<uint8_t> ThisReceivedData;
const char* DataPtr = Asio::buffer_cast<const char*>(Buffer.data());
auto DataPtr = reinterpret_cast<const char*>(Buffer.data().data());
for (std::size_t i = 0; i < Buffer.size(); ++i)
{
ThisReceivedData.Add(DataPtr[i]);
Expand Down Expand Up @@ -119,7 +119,7 @@ FString UMapPreviewUserWidget::RecvCornersLatLonCoords()
AsioStreamBuf Buffer;
std::size_t BytesReceived =
Asio::read(*SocketPtr, Buffer, Asio::transfer_at_least(2));
std::string BytesStr = Asio::buffer_cast<const char*>(Buffer.data());
std::string BytesStr = reinterpret_cast<const char*>(Buffer.data().data());

FString CoordStr = FString(BytesStr.size(), UTF8_TO_TCHAR(BytesStr.c_str()));
UE_LOG(LogTemp, Log, TEXT("Received Coords %s"), *CoordStr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@
#include "Blueprint/UserWidget.h"
#include <util/ue-header-guard-end.h>

// This warning suppression avoids errors due to name collisions between a function's local variable and a concept named disposition.
#pragma warning(push)
#if defined(_MSVC_LANG) && !defined(__clang__)
#pragma warning(disable : 4459)
#endif
#include <util/disable-ue4-macros.h>
#include <boost/asio.hpp>
#include <util/enable-ue4-macros.h>
#pragma warning(pop)

#include <memory>

Expand All @@ -24,8 +30,9 @@ class CARLATOOLS_API UMapPreviewUserWidget : public UUserWidget
GENERATED_BODY()

private:
// Boost socket
boost::asio::io_service io_service;

boost::asio::io_context io_context;

std::unique_ptr<boost::asio::ip::tcp::socket> SocketPtr;


Expand Down