UE-side build system progress + disable PhysX preemtively.

This commit is contained in:
Marcel Pi 2023-11-24 17:35:38 +01:00
parent 19680dcc1d
commit fb3d37fc50
18 changed files with 921 additions and 747 deletions

View File

@ -133,7 +133,7 @@ endif ()
if (BUILD_LIBCARLA_SERVER)
project (libcarla-server)
project (carla-server)
set (LIBCARLA_SERVER_INCLUDE_PATHS
${LIBCARLA_SOURCE_PATH}
@ -141,73 +141,107 @@ if (BUILD_LIBCARLA_SERVER)
${RPCLIB_INCLUDE_PATH}
)
file(GLOB LIBCARLA_SERVER_SOURCES
${LIBCARLA_SOURCE_PATH}/carla/*.h
file (
GLOB
LIBCARLA_SERVER_SOURCES
${LIBCARLA_SOURCE_PATH}/carla/Buffer.cpp
${LIBCARLA_SOURCE_PATH}/carla/Exception.cpp
${LIBCARLA_SOURCE_PATH}/carla/geom/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/geom/*.h
${LIBCARLA_SOURCE_PATH}/carla/opendrive/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/opendrive/*.h
${LIBCARLA_SOURCE_PATH}/carla/opendrive/parser/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/opendrive/parser/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/element/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/element/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/general/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/general/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/object/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/object/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/signal/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/signal/*.h
${LIBCARLA_SOURCE_PATH}/carla/rpc/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/sensor/s11n/SensorHeaderSerializer.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/tcp/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/multigpu/*.cpp
)
file (
GLOB
LIBCARLA_SERVER_SOURCES_THIRD_PARTY
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/moodycamel/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.cpp
)
file (
GLOB
LIBCARLA_SERVER_HEADERS
${LIBCARLA_SOURCE_PATH}/carla/*.h
${LIBCARLA_SOURCE_PATH}/carla/geom/*.h
${LIBCARLA_SOURCE_PATH}/carla/opendrive/*.h
${LIBCARLA_SOURCE_PATH}/carla/opendrive/parser/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/element/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/general/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/object/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/signal/*.h
${LIBCARLA_SOURCE_PATH}/carla/rpc/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/s11n/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/s11n/SensorHeaderSerializer.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/tcp/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/low_level/*.h
${LIBCARLA_SOURCE_PATH}/carla/multigpu/*.h
${LIBCARLA_SOURCE_PATH}/carla/multigpu/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.h
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/moodycamel/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/moodycamel/*.h
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.hpp
)
file (
GLOB
LIBCARLA_SERVER_HEADERS_THIRD_PARTY
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.h
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/moodycamel/*.h
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.hpp
)
add_library (
libcarla-server STATIC ${LIBCARLA_SERVER_SOURCES}
carla-server STATIC
${LIBCARLA_SERVER_HEADERS}
${LIBCARLA_SERVER_SOURCES}
${LIBCARLA_SERVER_HEADERS_THIRD_PARTY}
${LIBCARLA_SERVER_SOURCES_THIRD_PARTY}
)
target_compile_options (
libcarla-server PRIVATE /EHsc
carla-server PRIVATE
/EHsc
)
target_include_directories (
libcarla-server PRIVATE ${LIBCARLA_SERVER_INCLUDE_PATHS}
carla-server PRIVATE
${LIBCARLA_SERVER_INCLUDE_PATHS}
)
target_compile_definitions (
libcarla-server PRIVATE
carla-server PRIVATE
${CARLA_COMMON_DEFINITIONS}
)
install (TARGETS carla-server DESTINATION lib)
foreach (HEADER ${LIBCARLA_SERVER_HEADERS})
cmake_path (GET HEADER PARENT_PATH HEADER_PARENT)
cmake_path (RELATIVE_PATH HEADER_PARENT BASE_DIRECTORY ${LIBCARLA_SOURCE_PATH}/carla OUTPUT_VARIABLE HEADER_RELATIVE)
install (FILES ${HEADER} DESTINATION include/carla/${HEADER_RELATIVE})
endforeach ()
endif ()
if (BUILD_LIBCARLA_CLIENT)
project (libcarla-client)
project (carla-client)
set (LIBCARLA_CLIENT_INCLUDE_PATHS
set (
LIBCARLA_CLIENT_INCLUDE_PATHS
${LIBCARLA_SOURCE_PATH}
${BOOST_INCLUDE_PATH}
${RPCLIB_INCLUDE_PATH}
@ -215,80 +249,109 @@ if (BUILD_LIBCARLA_CLIENT)
${LIBPNG_INCLUDE_PATH}
)
file (GLOB LIBCARLA_CLIENT_SOURCES
file (
GLOB
LIBCARLA_CLIENT_HEADERS
${LIBCARLA_SOURCE_PATH}/carla/*.h
${LIBCARLA_SOURCE_PATH}/carla/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/client/*.h
${LIBCARLA_SOURCE_PATH}/carla/client/*.cpp
${LIBCARLA_SOURCE_PATH}carla/client/detail/*.cpp
${LIBCARLA_SOURCE_PATH}carla/client/detail/*.h
${LIBCARLA_SOURCE_PATH}carla/geom/*.cpp
${LIBCARLA_SOURCE_PATH}carla/geom/*.h
${LIBCARLA_SOURCE_PATH}carla/image/*.cpp
${LIBCARLA_SOURCE_PATH}carla/image/*.h
${LIBCARLA_SOURCE_PATH}carla/nav/*.cpp
${LIBCARLA_SOURCE_PATH}carla/nav/*.h
${LIBCARLA_SOURCE_PATH}carla/opendrive/*.cpp
${LIBCARLA_SOURCE_PATH}carla/opendrive/*.h
${LIBCARLA_SOURCE_PATH}carla/opendrive/parser/*.cpp
${LIBCARLA_SOURCE_PATH}carla/opendrive/parser/*.h
${LIBCARLA_SOURCE_PATH}carla/pointcloud/*.cpp
${LIBCARLA_SOURCE_PATH}carla/pointcloud/*.h
${LIBCARLA_SOURCE_PATH}carla/profiler/*.h
${LIBCARLA_SOURCE_PATH}carla/road/*.cpp
${LIBCARLA_SOURCE_PATH}carla/road/*.h
${LIBCARLA_SOURCE_PATH}carla/road/element/*.cpp
${LIBCARLA_SOURCE_PATH}carla/road/element/*.h
${LIBCARLA_SOURCE_PATH}carla/road/general/*.cpp
${LIBCARLA_SOURCE_PATH}carla/road/general/*.h
${LIBCARLA_SOURCE_PATH}carla/road/object/*.cpp
${LIBCARLA_SOURCE_PATH}carla/road/object/*.h
${LIBCARLA_SOURCE_PATH}carla/road/signal/*.cpp
${LIBCARLA_SOURCE_PATH}carla/road/signal/*.h
${LIBCARLA_SOURCE_PATH}carla/rpc/*.cpp
${LIBCARLA_SOURCE_PATH}carla/rpc/*.h
${LIBCARLA_SOURCE_PATH}carla/rss/*.cpp
${LIBCARLA_SOURCE_PATH}carla/rss/*.h
${LIBCARLA_SOURCE_PATH}carla/sensor/*.cpp
${LIBCARLA_SOURCE_PATH}carla/sensor/*.h
${LIBCARLA_SOURCE_PATH}carla/sensor/data/*.cpp
${LIBCARLA_SOURCE_PATH}carla/sensor/data/*.h
${LIBCARLA_SOURCE_PATH}carla/sensor/s11n/*.cpp
${LIBCARLA_SOURCE_PATH}carla/sensor/s11n/*.h
${LIBCARLA_SOURCE_PATH}carla/streaming/*.cpp
${LIBCARLA_SOURCE_PATH}carla/streaming/*.h
${LIBCARLA_SOURCE_PATH}carla/streaming/detail/*.cpp
${LIBCARLA_SOURCE_PATH}carla/streaming/detail/*.h
${LIBCARLA_SOURCE_PATH}carla/streaming/detail/tcp/*.cpp
${LIBCARLA_SOURCE_PATH}carla/streaming/detail/tcp/*.h
${LIBCARLA_SOURCE_PATH}carla/streaming/low_level/*.cpp
${LIBCARLA_SOURCE_PATH}carla/streaming/low_level/*.h
${LIBCARLA_SOURCE_PATH}carla/multigpu/*.cpp
${LIBCARLA_SOURCE_PATH}carla/multigpu/*.h
${LIBCARLA_SOURCE_PATH}carla/trafficmanager/*.cpp
${LIBCARLA_SOURCE_PATH}carla/trafficmanager/*.h
${LIBCARLA_SOURCE_PATH}/carla/client/detail/*.h
${LIBCARLA_SOURCE_PATH}/carla/geom/*.h
${LIBCARLA_SOURCE_PATH}/carla/image/*.h
${LIBCARLA_SOURCE_PATH}/carla/nav/*.h
${LIBCARLA_SOURCE_PATH}/carla/opendrive/*.h
${LIBCARLA_SOURCE_PATH}/carla/opendrive/parser/*.h
${LIBCARLA_SOURCE_PATH}/carla/pointcloud/*.h
${LIBCARLA_SOURCE_PATH}/carla/profiler/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/element/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/general/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/object/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/signal/*.h
${LIBCARLA_SOURCE_PATH}/carla/rpc/*.h
${LIBCARLA_SOURCE_PATH}/carla/rss/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/data/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/s11n/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/tcp/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/low_level/*.h
${LIBCARLA_SOURCE_PATH}/carla/multigpu/*.h
${LIBCARLA_SOURCE_PATH}/carla/trafficmanager/*.h
)
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.cpp
file (
GLOB
LIBCARLA_CLIENT_HEADERS_THIRD_PARTY
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.h
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/moodycamel/*.h
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.hpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.h
)
file (
GLOB
LIBCARLA_CLIENT_SOURCES
${LIBCARLA_SOURCE_PATH}/carla/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/client/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/client/detail/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/geom/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/image/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/nav/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/opendrive/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/opendrive/parser/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/pointcloud/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/element/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/general/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/object/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/signal/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/rpc/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/rss/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/sensor/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/sensor/data/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/sensor/s11n/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/tcp/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/low_level/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/multigpu/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/trafficmanager/*.cpp
)
file (
GLOB
LIBCARLA_CLIENT_SOURCES_THIRD_PARTY
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.cpp
)
add_library (
libcarla-client STATIC ${LIBCARLA_CLIENT_SOURCES}
carla-client STATIC
${LIBCARLA_CLIENT_HEADERS}
${LIBCARLA_CLIENT_SOURCES}
${LIBCARLA_CLIENT_HEADERS_THIRD_PARTY}
${LIBCARLA_CLIENT_SOURCES_THIRD_PARTY}
)
target_include_directories (
libcarla-client PRIVATE ${LIBCARLA_CLIENT_INCLUDE_PATHS}
carla-client PRIVATE
${LIBCARLA_CLIENT_INCLUDE_PATHS}
)
target_compile_definitions (
libcarla-client PRIVATE
carla-client PRIVATE
${CARLA_COMMON_DEFINITIONS}
)
install (TARGETS carla-client DESTINATION lib)
foreach (HEADER ${LIBCARLA_CLIENT_HEADERS})
cmake_path (GET HEADER PARENT_PATH HEADER_PARENT)
cmake_path (RELATIVE_PATH HEADER_PARENT BASE_DIRECTORY ${LIBCARLA_SOURCE_PATH}/carla OUTPUT_VARIABLE HEADER_RELATIVE)
install (FILES ${HEADER} DESTINATION include/carla/${HEADER_RELATIVE})
endforeach ()
endif ()

View File

@ -4,6 +4,7 @@ import subprocess, tarfile, zipfile, argparse, requests, psutil, shutil, glob, j
# Constants:
EXE_EXT = '.exe' if os.name == 'nt' else ''
LIB_PREFIX = '' if os.name == 'nt' else 'lib'
LIB_EXT = '.lib' if os.name == 'nt' else '.a'
OBJ_EXT = '.obj' if os.name == 'nt' else '.o'
SHELL_EXT = '.bat' if os.name == 'nt' else ''
@ -153,6 +154,15 @@ AddDirective(
AddDirective(
'chrono',
'Whether to enable Chrono.')
AddDirective(
'carsim',
'Whether to enable CarSim')
AddDirective(
'ros2',
'Whether to enable ROS2')
AddDirective(
'unity-build',
'Whether to enable Unity Build for Unreal Engine projects.')
AddDirective(
'osm2odr',
'Whether to enable OSM2ODR.')
@ -229,7 +239,6 @@ def SyncArgs():
ARGV = SyncArgs()
SEQUENTIAL = ARGV.configure_sequential
ENABLE_CHRONO = ARGV.chrono
ENABLE_OSM2ODR = ARGV.osm2odr or ARGV.python_api
ENABLE_OSM_WORLD_RENDERER = ARGV.osm_world_renderer
ENABLE_PYTHON_API = ARGV.python_api
@ -240,7 +249,14 @@ ENABLE_LIBCARLA = any([
ENABLE_LIBCARLA_CLIENT,
ENABLE_LIBCARLA_SERVER,
])
ENABLE_CARSIM = ARGV.carsim
ENABLE_CHRONO = ARGV.chrono
ENABLE_ROS2 = ARGV.ros2
ENABLE_UNITY_BUILD = ARGV.unity_build
ENABLE_NVIDIA_OMNIVERSE = ARGV.nv_omniverse
ENABLE_RSS = ARGV.rss
UPDATE_DEPENDENCIES = ARGV.update_deps
BUILD_DEPENDENCIES = ARGV.build_deps
PARALLELISM = ARGV.parallelism
@ -249,8 +265,8 @@ CARLA_VERSION_STRING = ARGV.version
BUILD_PATH = Path(ARGV.build_path)
LOG_PATH = BUILD_PATH / 'BuildLogs'
DEPENDENCIES_PATH = BUILD_PATH / 'Dependencies'
LIBCARLA_BUILD_PATH = BUILD_PATH / 'libcarla-build'
LIBCARLA_INSTALL_PATH = BUILD_PATH / 'libcarla-install'
LIBCARLA_BUILD_PATH = BUILD_PATH / 'LibCarla'
LIBCARLA_INSTALL_PATH = WORKSPACE_PATH / 'Install' / 'LibCarla'
# Language options
C_COMPILER = ARGV.c_compiler
CPP_COMPILER = ARGV.cpp_compiler
@ -302,7 +318,7 @@ ZLIB_BUILD_PATH = DEPENDENCIES_PATH / 'zlib-build'
ZLIB_INSTALL_PATH = DEPENDENCIES_PATH / 'zlib-install'
ZLIB_INCLUDE_PATH = ZLIB_INSTALL_PATH / 'include'
ZLIB_LIBRARY_PATH = ZLIB_INSTALL_PATH / 'lib'
ZLIB_LIB_PATH = ZLIB_LIBRARY_PATH / f'zlib{LIB_EXT}'
ZLIB_LIB_PATH = ZLIB_LIBRARY_PATH / f'{LIB_PREFIX}zlib{LIB_EXT}'
# LibPNG
LIBPNG_SOURCE_PATH = DEPENDENCIES_PATH / 'libpng-source'
LIBPNG_BUILD_PATH = DEPENDENCIES_PATH / 'libpng-build'
@ -314,7 +330,7 @@ SQLITE_SOURCE_PATH = DEPENDENCIES_PATH / 'sqlite-source'
SQLITE_BUILD_PATH = DEPENDENCIES_PATH / 'sqlite-build'
SQLITE_LIBRARY_PATH = SQLITE_BUILD_PATH
SQLITE_INCLUDE_PATH = SQLITE_SOURCE_PATH
SQLITE_LIB_PATH = SQLITE_BUILD_PATH / f'sqlite{LIB_EXT}'
SQLITE_LIB_PATH = SQLITE_BUILD_PATH / f'{LIB_PREFIX}sqlite{LIB_EXT}'
SQLITE_EXE_PATH = SQLITE_BUILD_PATH / f'sqlite{EXE_EXT}'
# Proj
PROJ_SOURCE_PATH = DEPENDENCIES_PATH / 'proj-source'
@ -361,7 +377,13 @@ SUMO_LIBRARY_PATH = SUMO_INSTALL_PATH / 'lib'
# Nvidia Omniverse
NV_OMNIVERSE_PLUGIN_PATH = UNREAL_ENGINE_PATH / 'Engine' / 'Plugins' / 'Marketplace' / 'NVIDIA' / 'Omniverse'
NV_OMNIVERSE_PATCH_PATH = PATCHES_PATH / 'omniverse_4.26'
ENABLE_RSS = ARGV.rss
CARLA_UE_OPTIONAL_MODULES = (
f'CarSim {"ON" if ENABLE_CARSIM else "OFF"}\n'
f'Chrono {"ON" if ENABLE_CHRONO else "OFF"}\n'
f'Ros2 {"ON" if ENABLE_ROS2 else "OFF"}\n'
f'Unity {"ON" if ENABLE_UNITY_BUILD else "OFF"}\n'
)
# Basic IO functions:
@ -784,23 +806,6 @@ def BuildLibCarlaMain(task_graph : TaskGraph):
LIBCARLA_BUILD_PATH,
LIBCARLA_INSTALL_PATH))
def BuildCarlaUEMain():
assert UNREAL_ENGINE_PATH.exists()
if os.name == 'nt':
LaunchSubprocessImmediate([
UNREAL_ENGINE_PATH / 'Engine' / 'Build' / 'BatchFiles' / 'Build.bat',
'CarlaUE4', 'Win64', 'Development', '-WaitMutex', '-FromMsBuild',
CARLA_UE_PATH / 'CarlaUE4.uproject'
])
else:
pass
def BuildCarlaUE(task_graph : TaskGraph):
Log('Building Carla Unreal Engine Editor')
if ENABLE_NVIDIA_OMNIVERSE:
task_graph.Add(Task('install-nv-omniverse', [], InstallNVIDIAOmniverse))
task_graph.Add(Task('build-carla-ue', [], BuildCarlaUEMain))
def BuildPythonAPIMain():
content = ''
with open(PYTHON_API_PATH / 'setup.py.in', 'r') as file:
@ -818,7 +823,47 @@ def BuildPythonAPI(task_graph : TaskGraph):
task_graph.Add(Task('build-python-api', [ 'install-libcarla' ], BuildPythonAPIMain))
def SetupUnrealEngine(task_graph : TaskGraph):
Log('Setting up Unreal Engine.')
pass
def BuildCarlaUEMain():
assert UNREAL_ENGINE_PATH.exists()
unreal_build_tool_args = []
if ENABLE_CARSIM:
unreal_build_tool_args.append('-carsim')
if ENABLE_CHRONO:
unreal_build_tool_args.append('-chrono')
if ENABLE_ROS2:
unreal_build_tool_args.append('-ros2')
if ENABLE_UNITY_BUILD:
unreal_build_tool_args.append('-unity-build')
if ENABLE_NVIDIA_OMNIVERSE:
unreal_build_tool_args.append('-nv-omniverse')
if os.name == 'nt':
LaunchSubprocessImmediate([
UNREAL_ENGINE_PATH / 'Engine' / 'Build' / 'BatchFiles' / 'Build.bat',
'CarlaUE4Editor',
'Win64',
'Development',
'-WaitMutex',
'-FromMsBuild',
CARLA_UE_PATH / 'CarlaUE4.uproject',
], log_name = 'build-carla-ue-editor')
LaunchSubprocessImmediate([
UNREAL_ENGINE_PATH / 'Engine' / 'Build' / 'BatchFiles' / 'Build.bat',
'CarlaUE4',
'Win64',
'Development',
'-WaitMutex',
'-FromMsBuild',
CARLA_UE_PATH / 'CarlaUE4.uproject',
], log_name = 'build-carla-ue')
else:
pass
def BuildCarlaUE(task_graph : TaskGraph):
if ENABLE_NVIDIA_OMNIVERSE:
task_graph.Add(Task('install-nv-omniverse', [], InstallNVIDIAOmniverse))
task_graph.Add(Task('build-carla-ue', [ 'build-python-api' ], BuildCarlaUEMain))
def InstallNVIDIAOmniverse():
filename = 'USDCarlaInterface'
@ -967,7 +1012,7 @@ def BuildSQLite():
LaunchSubprocessImmediate(cmd, log_name = 'build-sqlite-lib')
def FindXercesC():
return glob.glob(f'{XERCESC_INSTALL_PATH}/**/xerces-c*{LIB_EXT}', recursive=True)[0]
return glob.glob(f'{XERCESC_INSTALL_PATH}/**/{LIB_PREFIX}xerces-c*{LIB_EXT}', recursive=True)[0]
def ConfigureSUMO():
cmd = Task.CreateCMakeConfigureDefaultCommandLine(
@ -979,7 +1024,7 @@ def ConfigureSUMO():
f'-DZLIB_INCLUDE_DIR={ZLIB_INCLUDE_PATH}',
f'-DZLIB_LIBRARY={ZLIB_LIBRARY_PATH}',
f'-DPROJ_INCLUDE_DIR={PROJ_INSTALL_PATH}/include',
f'-DPROJ_LIBRARY={PROJ_INSTALL_PATH}/lib/proj{LIB_EXT}',
f'-DPROJ_LIBRARY={PROJ_INSTALL_PATH}/lib/{LIB_PREFIX}proj{LIB_EXT}',
f'-DXercesC_INCLUDE_DIR={XERCESC_INSTALL_PATH}/include',
f'-DXercesC_LIBRARY={FindXercesC()}',
'-DSUMO_LIBRARIES=OFF',

View File

@ -1,4 +1,5 @@
*.egg-info
setup.py
build
dependencies
dist

View File

@ -1,6 +1,6 @@
{
"FileVersion": 3,
"EngineAssociation": "4.26",
"EngineAssociation": "{503B4C24-4B4B-4C8C-53F3-8AB2AC13D07B}",
"Category": "",
"Description": "",
"Modules": [
@ -10,7 +10,7 @@
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine",
"PhysXVehicles",
"ChaosVehicles",
"Carla",
"CoreUObject"
]
@ -126,4 +126,4 @@
"Enabled": true
}
]
}
}

View File

@ -98,7 +98,7 @@ MaxSubstepDeltaTime=0.010000
MaxSubsteps=10
SyncSceneSmoothingFactor=0.000000
InitialAverageFrameRate=0.016667
PhysXTreeRebuildRate=10
# PhysXTreeRebuildRate=10
DefaultBroadphaseSettings=(bUseMBPOnClient=False,bUseMBPOnServer=False,MBPBounds=(Min=(X=0.000000,Y=0.000000,Z=0.000000),Max=(X=0.000000,Y=0.000000,Z=0.000000),IsValid=0),MBPNumSubdivs=2)
[/Script/WindowsTargetPlatform.WindowsTargetSettings]

View File

@ -13,19 +13,22 @@
"CanContainContent": true,
"IsBetaVersion": true,
"Installed": true,
"Modules": [
"Modules":
[
{
"Name": "Carla",
"Type": "Runtime",
"LoadingPhase": "PreDefault",
"AdditionalDependencies": [
"AdditionalDependencies":
[
"Engine"
]
}
],
"Plugins": [
"Plugins":
[
{
"Name": "PhysXVehicles",
"Name": "ChaosVehicles",
"Enabled": true
},
{

View File

@ -2,353 +2,425 @@
using System;
using System.IO;
using System.Linq;
using UnrealBuildTool;
using EpicGames.Core;
using System.Diagnostics;
public class Carla : ModuleRules
public class Carla :
ModuleRules
{
bool UsingCarSim = false;
bool UsingChrono = false;
bool UsingPytorch = false;
bool UsingRos2 = false;
private bool IsWindows(ReadOnlyTargetRules Target)
{
return (Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32);
}
[CommandLine("-carsim")]
bool EnableCarSim = false;
public Carla(ReadOnlyTargetRules Target) : base(Target)
{
PrivatePCHHeaderFile = "Carla.h";
[CommandLine("-chrono")]
bool EnableChrono = false;
if (IsWindows(Target))
[CommandLine("-pytorch")]
bool EnablePytorch = false;
[CommandLine("-ros2")]
bool EnableRos2 = false;
[CommandLine("-carla-install-path")]
string CarlaInstallPath = null;
[CommandLine("-carla-dependencies-path")]
string CarlaDependenciesPath = null;
public static string FindLibrary(string SearchPath, params string[] Patterns)
{
foreach (var Pattern in Patterns)
{
var Candidates = Directory.GetFiles(SearchPath, Pattern);
if (Candidates.Length == 0)
continue;
Array.Sort(Candidates);
return Candidates[0];
}
return null;
}
public Carla(ReadOnlyTargetRules Target) :
base(Target)
{
bEnableExceptions = true;
var DirectoryInfo = new DirectoryInfo(ModuleDirectory);
for (int i = 0; i != 6; ++i)
DirectoryInfo = DirectoryInfo.Parent;
var WorkspacePath = DirectoryInfo.ToString();
Debug.Assert(Directory.Exists(WorkspacePath));
if (CarlaInstallPath == null)
{
Console.WriteLine("-carla-install-path was not specified, inferring...");
CarlaInstallPath = Path.Combine(WorkspacePath, "Install", "libcarla");
Debug.Assert(Directory.Exists(CarlaInstallPath), "Could not infer CARLA install directory.");
}
if (CarlaDependenciesPath == null)
{
Console.WriteLine("-carla-dependencies-path was not specified, inferring...");
CarlaDependenciesPath = Path.Combine(WorkspacePath, "Build", "Dependencies");
Debug.Assert(Directory.Exists(CarlaDependenciesPath), "Could not infer CARLA dependencies directory.");
}
bool IsWindows = Target.Platform == UnrealTargetPlatform.Win64;
bEnableExceptions = bEnableExceptions || IsWindows;
PrivatePCHHeaderFile = "Carla.h";
if (EnableCarSim)
{
PublicDefinitions.Add("WITH_CARSIM");
PrivateDefinitions.Add("WITH_CARSIM");
}
if (EnableChrono)
{
PublicDefinitions.Add("WITH_CHRONO");
PrivateDefinitions.Add("WITH_CHRONO");
}
if (EnablePytorch)
{
PublicDefinitions.Add("WITH_PYTORCH");
PrivateDefinitions.Add("WITH_PYTORCH");
}
if (EnableRos2)
{
PublicDefinitions.Add("WITH_ROS2");
PrivateDefinitions.Add("WITH_ROS2");
}
// PublicIncludePaths.AddRange(new string[] { });
// PrivateIncludePaths.AddRange(new string[] { });
PublicDependencyModuleNames.AddRange(new string[]
{
"Core",
"RenderCore",
"RHI",
"Renderer",
"ProceduralMeshComponent",
"MeshDescription"
});
if (EnableCarSim)
{
PublicDependencyModuleNames.Add("CarSim");
}
if (Target.Type == TargetType.Editor)
{
PublicDependencyModuleNames.Add("UnrealEd");
}
PrivateDependencyModuleNames.AddRange(new string[]
{
"AIModule",
"AssetRegistry",
"CoreUObject",
"Engine",
"Foliage",
"HTTP",
"StaticMeshDescription",
"ImageWriteQueue",
"Json",
"JsonUtilities",
"Landscape",
"Chaos",
"ChaosVehicles",
"ChaosVehicleLib",
"Slate",
"SlateCore",
"PhysicsCore"
});
if (EnableCarSim)
{
PrivateDependencyModuleNames.Add("CarSim");
PrivateIncludePathModuleNames.Add("CarSim");
}
// DynamicallyLoadedModuleNames.AddRange(new string[] { });
var LibraryPrefix = IsWindows ? "" : "lib";
var LibrarySuffix = IsWindows ? ".lib" : ".a";
Func<string, string> GetLibraryName = name =>
{
return LibraryPrefix + name + LibrarySuffix;
};
var LibCarlaInstallPath = CarlaInstallPath;
var DependenciesInstallPath = CarlaDependenciesPath;
// LibCarla
var LibCarlaIncludePath = Path.Combine(LibCarlaInstallPath, "include");
var LibCarlaLibPath = Path.Combine(LibCarlaInstallPath, "lib");
var LibCarlaServerPath = Path.Combine(LibCarlaLibPath, GetLibraryName("carla-server"));
var LibCarlaClientPath = Path.Combine(LibCarlaLibPath, GetLibraryName("carla-client"));
// Boost
var BoostInstallPath = Path.Combine(DependenciesInstallPath, "boost-install");
var BoostLibPath = Path.Combine(BoostInstallPath, "lib");
var BoostLibraryPatterns = new string[]
{
GetLibraryName("*boost_asio*"),
GetLibraryName("*boost_python*"),
};
var BoostLibraries =
from Pattern in BoostLibraryPatterns
select FindLibrary(BoostLibPath, Pattern);
// Chrono
var ChronoInstallPath = Path.Combine(DependenciesInstallPath, "chrono-install");
var ChronoLibPath = Path.Combine(ChronoInstallPath, "lib");
var ChronoLibraryNames = new string[]
{
"ChronoEngine",
"ChronoEngine_vehicle",
"ChronoModels_vehicle",
"ChronoModels_robot",
};
var ChronoLibraries =
from Name in ChronoLibraryNames
select FindLibrary(Name);
// SQLite
var SQLiteBuildPath = Path.Combine(DependenciesInstallPath, "sqlite-build");
var SQLiteLibrary = FindLibrary(SQLiteBuildPath, GetLibraryName("sqlite*"));
// RPCLib
var RPCLibInstallPath = Path.Combine(DependenciesInstallPath, "rpclib-install");
var RPCLibPath = Path.Combine(RPCLibInstallPath, "lib");
var RPCLibraryPath = FindLibrary(RPCLibPath, "rpc");
// Xerces-C
var XercesCInstallPath = Path.Combine(DependenciesInstallPath, "xercesc-install");
var XercesCLibPath = Path.Combine(XercesCInstallPath, "lib");
var XercesCLibrary = FindLibrary(XercesCLibPath, "xercesc*");
// Proj
var ProjInstallPath = Path.Combine(DependenciesInstallPath, "proj-install");
var ProjLibPath = Path.Combine(ProjInstallPath, "lib");
var ProjLibrary = FindLibrary(ProjLibPath, "proj*");
// SUMO (OSM2ODR)
var SUMOInstallPath = Path.Combine(DependenciesInstallPath, "sumo-install");
var SUMOLibPath = Path.Combine(SUMOInstallPath, "lib");
var SUMOLibrary = FindLibrary(SUMOLibPath, "sumo*");
// ZLib
var ZLibInstallPath = Path.Combine(DependenciesInstallPath, "zlib-install");
var ZLibLibPath = Path.Combine(ZLibInstallPath, "lib");
var ZLibLibrary = FindLibrary(ZLibLibPath, "zlib*");
PublicAdditionalLibraries.AddRange(BoostLibraries);
PublicAdditionalLibraries.AddRange(ChronoLibraries);
PublicAdditionalLibraries.AddRange(new string[]
{
SQLiteLibrary,
RPCLibraryPath,
XercesCLibrary,
ProjLibrary,
SUMOLibrary,
ZLibLibrary,
});
PublicIncludePaths.Add(LibCarlaIncludePath);
PrivateIncludePaths.Add(LibCarlaIncludePath);
PublicDefinitions.Add("BOOST_DISABLE_ABI_HEADERS");
PublicDefinitions.Add("BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY");
if (!bEnableExceptions)
{
PublicDefinitions.Add("ASIO_NO_EXCEPTIONS");
PublicDefinitions.Add("BOOST_NO_EXCEPTIONS");
PublicDefinitions.Add("LIBCARLA_NO_EXCEPTIONS");
PublicDefinitions.Add("PUGIXML_NO_EXCEPTIONS");
}
}
// Read config about carsim
string CarlaPluginPath = Path.GetFullPath( ModuleDirectory );
string ConfigDir = Path.GetFullPath(Path.Combine(CarlaPluginPath, "../../../../Config/"));
string OptionalModulesFile = Path.Combine(ConfigDir, "OptionalModules.ini");
string[] text = System.IO.File.ReadAllLines(OptionalModulesFile);
foreach (string line in text)
{
if (line.Contains("CarSim ON"))
{
Console.WriteLine("Enabling carsim");
UsingCarSim = true;
PublicDefinitions.Add("WITH_CARSIM");
PrivateDefinitions.Add("WITH_CARSIM");
}
if (line.Contains("Chrono ON"))
{
Console.WriteLine("Enabling chrono");
UsingChrono = true;
PublicDefinitions.Add("WITH_CHRONO");
PrivateDefinitions.Add("WITH_CHRONO");
}
if (line.Contains("Pytorch ON"))
{
Console.WriteLine("Enabling pytorch");
UsingPytorch = true;
PublicDefinitions.Add("WITH_PYTORCH");
PrivateDefinitions.Add("WITH_PYTORCH");
}
#if false
private void AddDynamicLibrary(string library)
{
PublicAdditionalLibraries.Add(library);
RuntimeDependencies.Add(library);
PublicDelayLoadDLLs.Add(library);
}
if (line.Contains("Ros2 ON"))
{
Console.WriteLine("Enabling ros2");
UsingRos2 = true;
PublicDefinitions.Add("WITH_ROS2");
PrivateDefinitions.Add("WITH_ROS2");
}
}
private void AddDllDependency(string PathToFolder, string DllName)
{
string Source = Path.Combine(PathToFolder, DllName);
string Destination = Path.Combine("$(BinaryOutputDir)", DllName);
RuntimeDependencies.Add(Destination, Source);
}
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
private void AddCarlaServerDependency(ReadOnlyTargetRules Target)
{
string LibCarlaInstallPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "../../CarlaDependencies"));
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
// Link dependencies.
if (IsWindows)
{
foreach (string file in Directory.GetFiles(Path.Combine(LibCarlaInstallPath, "lib"), "*boost*.lib"))
PublicAdditionalLibraries.Add(file);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"RenderCore",
"RHI",
"Renderer",
"ProceduralMeshComponent",
"MeshDescription"
// ... add other public dependencies that you statically link with here ...
}
);
if (UsingCarSim)
{
PublicDependencyModuleNames.AddRange(new string[] { "CarSim" });
}
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("rpc")));
if (Target.Type == TargetType.Editor)
{
PublicDependencyModuleNames.AddRange(new string[] { "UnrealEd" });
}
if (UseDebugLibs(Target))
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server_debug")));
}
else
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server")));
}
if (EnableChrono)
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("ChronoEngine")));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("ChronoEngine_vehicle")));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("ChronoModels_vehicle")));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("ChronoModels_robot")));
AddDllDependency(Path.Combine(LibCarlaInstallPath, "dll"), "ChronoEngine.dll");
AddDllDependency(Path.Combine(LibCarlaInstallPath, "dll"), "ChronoEngine_vehicle.dll");
AddDllDependency(Path.Combine(LibCarlaInstallPath, "dll"), "ChronoModels_vehicle.dll");
AddDllDependency(Path.Combine(LibCarlaInstallPath, "dll"), "ChronoModels_robot.dll");
bUseRTTI = true;
}
PrivateDependencyModuleNames.AddRange(
new string[]
{
"AIModule",
"AssetRegistry",
"CoreUObject",
"Engine",
"Foliage",
"HTTP",
"StaticMeshDescription",
"ImageWriteQueue",
"Json",
"JsonUtilities",
"Landscape",
"PhysX",
"PhysXVehicles",
"PhysXVehicleLib",
"Slate",
"SlateCore",
"PhysicsCore"
// ... add private dependencies that you statically link with here ...
}
);
if (UsingCarSim)
{
PrivateDependencyModuleNames.AddRange(new string[] { "CarSim" });
PrivateIncludePathModuleNames.AddRange(new string[] { "CarSim" });
}
//OsmToODR
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "sqlite3.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "xerces-c_3.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "proj.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "osm2odr.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "zlibstatic.lib"));
}
else
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("rpc")));
if (UseDebugLibs(Target))
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server_debug")));
}
else
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server")));
}
if (EnableChrono)
{
AddDynamicLibrary(Path.Combine(LibCarlaInstallPath, "lib", "libChronoEngine.so"));
AddDynamicLibrary(Path.Combine(LibCarlaInstallPath, "lib", "libChronoEngine_vehicle.so"));
AddDynamicLibrary(Path.Combine(LibCarlaInstallPath, "lib", "libChronoModels_vehicle.so"));
AddDynamicLibrary(Path.Combine(LibCarlaInstallPath, "lib", "libChronoModels_robot.so"));
bUseRTTI = true;
}
if (EnablePytorch)
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_pytorch")));
string LibTorchPath = LibCarlaInstallPath;
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libonnx_proto.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libfbgemm.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgloo.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libXNNPACK.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libprotobuf-lite.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libprotobuf.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libasmjit.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libcpuinfo_internals.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libclog.a"));
// PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libbreakpad_common.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libbenchmark.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libtensorpipe.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libpytorch_qnnpack.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libtensorpipe_cuda.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libnnpack_reference_layers.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgmock.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libdnnl.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libpthreadpool.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libcpuinfo.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libqnnpack.a"));
// PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libbreakpad.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libkineto.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libprotoc.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgtest.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgmock_main.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgtest_main.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libbenchmark_main.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libfmt.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libtensorpipe_uv.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libfoxi_loader.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgloo_cuda.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libnnpack.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libcaffe2_protos.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libonnx.a"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libnnapi_backend.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libbackend_with_compiler.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libcaffe2_nvrtc.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch_cuda_cpp.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libc10_cuda.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorchbind_test.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libjitbackend_test.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libc10.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch_cuda.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch_global_deps.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch_cpu.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libshm.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch_cuda_cu.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorchscatter.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorchcluster.so"));
// AddDynamicLibrary("/usr/local/cuda/lib64/stubs/libcuda.so");
// AddDynamicLibrary("/usr/local/cuda/lib64/libnvrtc.so");
// AddDynamicLibrary("/usr/local/cuda/lib64/libnvToolsExt.so");
// AddDynamicLibrary("/usr/local/cuda/lib64/libcudart.so");
// AddDynamicLibrary("/usr/lib/llvm-10/lib/libgomp.so");
PublicAdditionalLibraries.Add("/usr/local/cuda/lib64/stubs/libcuda.so");
PublicAdditionalLibraries.Add("/usr/local/cuda/lib64/libnvrtc.so");
PublicAdditionalLibraries.Add("/usr/local/cuda/lib64/libnvToolsExt.so");
PublicAdditionalLibraries.Add("/usr/local/cuda/lib64/libcudart.so");
PublicAdditionalLibraries.Add("/usr/lib/llvm-10/lib/libgomp.so");
RuntimeDependencies.Add(Path.Combine(LibTorchPath, "lib", "libcudart-a7b20f20.so.11.0"));
RuntimeDependencies.Add(Path.Combine(LibTorchPath, "lib", "libgomp-a34b3233.so.1"));
RuntimeDependencies.Add(Path.Combine(LibTorchPath, "lib", "libnvrtc-builtins-4730a239.so.11.3"));
RuntimeDependencies.Add(Path.Combine(LibTorchPath, "lib", "libnvrtc-1ea278b5.so.11.2"));
RuntimeDependencies.Add(Path.Combine(LibTorchPath, "lib", "libnvToolsExt-24de1d56.so.1"));
PublicAdditionalLibraries.Add("stdc++");
PublicAdditionalLibraries.Add("/usr/lib/x86_64-linux-gnu/libpython3.9.so");
}
if (EnableRos2)
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_fastdds")));
string LibFastDDSPath = LibCarlaInstallPath;
AddDynamicLibrary(Path.Combine(LibFastDDSPath, "lib", "libfoonathan_memory-0.7.3.so"));
AddDynamicLibrary(Path.Combine(LibFastDDSPath, "lib", "libfastcdr.so"));
AddDynamicLibrary(Path.Combine(LibFastDDSPath, "lib", "libfastrtps.so"));
PublicAdditionalLibraries.Add("stdc++");
}
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
//OsmToODR
PublicAdditionalLibraries.Add("/usr/lib/x86_64-linux-gnu/libc.so");
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libsqlite3.so"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libxerces-c.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libproj.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libosm2odr.a"));
AddCarlaServerDependency(Target);
}
}
bEnableExceptions = true;
private bool UseDebugLibs(ReadOnlyTargetRules Target)
{
if (IsWindows(Target))
{
// In Windows, Unreal uses the Release C++ Runtime (CRT) even in debug
// mode, so unless we recompile the engine we cannot link the debug
// libraries.
return false;
}
else
{
return false;
}
}
// Include path.
string LibCarlaIncludePath = Path.Combine(LibCarlaInstallPath, "include");
private void AddDynamicLibrary(string library)
{
PublicAdditionalLibraries.Add(library);
RuntimeDependencies.Add(library);
PublicDelayLoadDLLs.Add(library);
}
private void AddDllDependency(string PathToFolder, string DllName)
{
string Source = Path.Combine(PathToFolder, DllName);
string Destination = Path.Combine("$(BinaryOutputDir)", DllName);
RuntimeDependencies.Add(Destination, Source);
}
PublicIncludePaths.Add(LibCarlaIncludePath);
PrivateIncludePaths.Add(LibCarlaIncludePath);
delegate string ADelegate(string s);
private void AddBoostLibs(string LibPath)
{
string [] files = Directory.GetFiles(LibPath, "*boost*.lib");
foreach (string file in files) PublicAdditionalLibraries.Add(file);
}
private void AddCarlaServerDependency(ReadOnlyTargetRules Target)
{
string LibCarlaInstallPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "../../CarlaDependencies"));
ADelegate GetLibName = (string BaseName) => {
if (IsWindows(Target))
{
return BaseName + ".lib";
}
else
{
return "lib" + BaseName + ".a";
}
};
// Link dependencies.
if (IsWindows(Target))
{
AddBoostLibs(Path.Combine(LibCarlaInstallPath, "lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("rpc")));
if (UseDebugLibs(Target))
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server_debug")));
}
else
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server")));
}
if (UsingChrono)
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("ChronoEngine")));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("ChronoEngine_vehicle")));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("ChronoModels_vehicle")));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("ChronoModels_robot")));
AddDllDependency(Path.Combine(LibCarlaInstallPath, "dll"), "ChronoEngine.dll");
AddDllDependency(Path.Combine(LibCarlaInstallPath, "dll"), "ChronoEngine_vehicle.dll");
AddDllDependency(Path.Combine(LibCarlaInstallPath, "dll"), "ChronoModels_vehicle.dll");
AddDllDependency(Path.Combine(LibCarlaInstallPath, "dll"), "ChronoModels_robot.dll");
bUseRTTI = true;
}
//OsmToODR
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "sqlite3.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "xerces-c_3.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "proj.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "osm2odr.lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "zlibstatic.lib"));
}
else
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("rpc")));
if (UseDebugLibs(Target))
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server_debug")));
}
else
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server")));
}
if (UsingChrono)
{
AddDynamicLibrary(Path.Combine(LibCarlaInstallPath, "lib", "libChronoEngine.so"));
AddDynamicLibrary(Path.Combine(LibCarlaInstallPath, "lib", "libChronoEngine_vehicle.so"));
AddDynamicLibrary(Path.Combine(LibCarlaInstallPath, "lib", "libChronoModels_vehicle.so"));
AddDynamicLibrary(Path.Combine(LibCarlaInstallPath, "lib", "libChronoModels_robot.so"));
bUseRTTI = true;
}
if (UsingPytorch)
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_pytorch")));
string LibTorchPath = LibCarlaInstallPath;
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libonnx_proto.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libfbgemm.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgloo.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libXNNPACK.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libprotobuf-lite.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libprotobuf.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libasmjit.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libcpuinfo_internals.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libclog.a"));
// PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libbreakpad_common.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libbenchmark.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libtensorpipe.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libpytorch_qnnpack.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libtensorpipe_cuda.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libnnpack_reference_layers.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgmock.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libdnnl.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libpthreadpool.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libcpuinfo.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libqnnpack.a"));
// PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libbreakpad.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libkineto.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libprotoc.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgtest.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgmock_main.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgtest_main.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libbenchmark_main.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libfmt.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libtensorpipe_uv.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libfoxi_loader.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libgloo_cuda.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libnnpack.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libcaffe2_protos.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibTorchPath, "lib", "libonnx.a"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libnnapi_backend.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libbackend_with_compiler.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libcaffe2_nvrtc.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch_cuda_cpp.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libc10_cuda.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorchbind_test.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libjitbackend_test.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libc10.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch_cuda.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch_global_deps.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch_cpu.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libshm.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorch_cuda_cu.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorchscatter.so"));
AddDynamicLibrary(Path.Combine(LibTorchPath, "lib", "libtorchcluster.so"));
// AddDynamicLibrary("/usr/local/cuda/lib64/stubs/libcuda.so");
// AddDynamicLibrary("/usr/local/cuda/lib64/libnvrtc.so");
// AddDynamicLibrary("/usr/local/cuda/lib64/libnvToolsExt.so");
// AddDynamicLibrary("/usr/local/cuda/lib64/libcudart.so");
// AddDynamicLibrary("/usr/lib/llvm-10/lib/libgomp.so");
PublicAdditionalLibraries.Add("/usr/local/cuda/lib64/stubs/libcuda.so");
PublicAdditionalLibraries.Add("/usr/local/cuda/lib64/libnvrtc.so");
PublicAdditionalLibraries.Add("/usr/local/cuda/lib64/libnvToolsExt.so");
PublicAdditionalLibraries.Add("/usr/local/cuda/lib64/libcudart.so");
PublicAdditionalLibraries.Add("/usr/lib/llvm-10/lib/libgomp.so");
RuntimeDependencies.Add(Path.Combine(LibTorchPath, "lib", "libcudart-a7b20f20.so.11.0"));
RuntimeDependencies.Add(Path.Combine(LibTorchPath, "lib", "libgomp-a34b3233.so.1"));
RuntimeDependencies.Add(Path.Combine(LibTorchPath, "lib", "libnvrtc-builtins-4730a239.so.11.3"));
RuntimeDependencies.Add(Path.Combine(LibTorchPath, "lib", "libnvrtc-1ea278b5.so.11.2"));
RuntimeDependencies.Add(Path.Combine(LibTorchPath, "lib", "libnvToolsExt-24de1d56.so.1"));
PublicAdditionalLibraries.Add("stdc++");
PublicAdditionalLibraries.Add("/usr/lib/x86_64-linux-gnu/libpython3.9.so");
}
if (UsingRos2)
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_fastdds")));
string LibFastDDSPath = LibCarlaInstallPath;
AddDynamicLibrary(Path.Combine(LibFastDDSPath, "lib", "libfoonathan_memory-0.7.3.so"));
AddDynamicLibrary(Path.Combine(LibFastDDSPath, "lib", "libfastcdr.so"));
AddDynamicLibrary(Path.Combine(LibFastDDSPath, "lib", "libfastrtps.so"));
PublicAdditionalLibraries.Add("stdc++");
}
//OsmToODR
PublicAdditionalLibraries.Add("/usr/lib/x86_64-linux-gnu/libc.so");
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libsqlite3.so"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libxerces-c.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libproj.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", "libosm2odr.a"));
}
bEnableExceptions = true;
// Include path.
string LibCarlaIncludePath = Path.Combine(LibCarlaInstallPath, "include");
PublicIncludePaths.Add(LibCarlaIncludePath);
PrivateIncludePaths.Add(LibCarlaIncludePath);
PublicDefinitions.Add("ASIO_NO_EXCEPTIONS");
PublicDefinitions.Add("BOOST_NO_EXCEPTIONS");
PublicDefinitions.Add("LIBCARLA_NO_EXCEPTIONS");
PublicDefinitions.Add("PUGIXML_NO_EXCEPTIONS");
PublicDefinitions.Add("BOOST_DISABLE_ABI_HEADERS");
PublicDefinitions.Add("BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY");
}
PublicDefinitions.Add("ASIO_NO_EXCEPTIONS");
PublicDefinitions.Add("BOOST_NO_EXCEPTIONS");
PublicDefinitions.Add("LIBCARLA_NO_EXCEPTIONS");
PublicDefinitions.Add("PUGIXML_NO_EXCEPTIONS");
PublicDefinitions.Add("BOOST_DISABLE_ABI_HEADERS");
PublicDefinitions.Add("BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY");
}
#endif
}

View File

@ -13,8 +13,7 @@
#include "DrawDebugHelpers.h"
#include "Kismet/KismetSystemLibrary.h"
#include "PhysXPublic.h"
#include "PhysXVehicleManager.h"
#if 0 // @CARLAUE5
#include "TireConfig.h"
#include "VehicleWheel.h"
@ -1134,3 +1133,4 @@ void ACarlaWheeledVehicle::SetPhysicsConstraintAngle(
{
Component->ConstraintInstance.AngularRotationOffset = NewAngle;
}
#endif

View File

@ -6,14 +6,12 @@
#include "WheeledVehicleMovementComponentNW.h"
#include "PhysicsPublic.h"
#include "PhysXPublic.h"
#include "PhysXVehicleManager.h"
#include "Components/PrimitiveComponent.h"
#include "Logging/MessageLog.h"
UWheeledVehicleMovementComponentNW::UWheeledVehicleMovementComponentNW(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
// grab default values from physx
#if 0 // @CARLAUE5
PxVehicleEngineData DefEngineData;
EngineSetup.MOI = DefEngineData.mMOI;
EngineSetup.MaxRPM = OmegaToRPM(DefEngineData.mMaxOmega);
@ -65,11 +63,13 @@ UWheeledVehicleMovementComponentNW::UWheeledVehicleMovementComponentNW(const FOb
DifferentialSetup.SetNum(NbrWheels);
IdleBrakeInput = 10;
#endif
}
#if WITH_EDITOR
void UWheeledVehicleMovementComponentNW::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
{
#if 0 // @CARLAUE5
Super::PostEditChangeProperty(PropertyChangedEvent);
const FName PropertyName = PropertyChangedEvent.Property ? PropertyChangedEvent.Property->GetFName() : NAME_None;
@ -99,9 +99,11 @@ void UWheeledVehicleMovementComponentNW::PostEditChangeProperty(struct FProperty
SteeringCurve.GetRichCurve()->UpdateOrAddKey(SteerKeys[KeyIdx].Time, NewValue);
}
}
#endif
}
#endif
#if 0 // @CARLAUE5
static void GetVehicleDifferentialNWSetup(const TArray<FVehicleNWWheelDifferentialData>& Setup, PxVehicleDifferentialNWData& PxSetup)
{
for (int32 i = 0; i < Setup.Num(); ++i)
@ -109,9 +111,11 @@ static void GetVehicleDifferentialNWSetup(const TArray<FVehicleNWWheelDifferenti
PxSetup.setDrivenWheel(i, Setup[i].bDriven);
}
}
#endif
float FVehicleNWEngineData::FindPeakTorque() const
{
#if 0 // @CARLAUE5
// Find max torque
float PeakTorque = 0.0f;
TArray<FRichCurveKey> TorqueKeys = TorqueCurve.GetRichCurveConst()->GetCopyOfKeys();
@ -121,8 +125,10 @@ float FVehicleNWEngineData::FindPeakTorque() const
PeakTorque = FMath::Max(PeakTorque, Key.Value);
}
return PeakTorque;
#endif
}
#if 0 // @CARLAUE5
static void GetVehicleEngineSetup(const FVehicleNWEngineData& Setup, PxVehicleEngineData& PxSetup)
{
PxSetup.mMOI = M2ToCm2(Setup.MOI);
@ -169,12 +175,18 @@ static void GetVehicleAutoBoxSetup(const FVehicleNWTransmissionData& Setup, PxVe
PxSetup.setLatency(Setup.GearAutoBoxLatency);
}
#endif
int32 UWheeledVehicleMovementComponentNW::GetCustomGearBoxNumForwardGears() const
{
#if 0 // @CARLAUE5
return TransmissionSetup.ForwardGears.Num();
#else
return 0;
#endif
}
#if 0 // @CARLAUE5
void SetupDriveHelper(const UWheeledVehicleMovementComponentNW* VehicleData, const PxVehicleWheelsSimData* PWheelsSimData, PxVehicleDriveSimDataNW& DriveData)
{
PxVehicleDifferentialNWData DifferentialSetup;
@ -198,9 +210,11 @@ void SetupDriveHelper(const UWheeledVehicleMovementComponentNW* VehicleData, con
GetVehicleAutoBoxSetup(VehicleData->TransmissionSetup, AutoBoxSetup);
DriveData.setAutoBoxData(AutoBoxSetup);
}
#endif
void UWheeledVehicleMovementComponentNW::SetupVehicle()
{
#if 0 // @CARLAUE5
if (!UpdatedPrimitive)
{
return;
@ -267,11 +281,12 @@ void UWheeledVehicleMovementComponentNW::SetupVehicle()
PVehicleDrive = PVehicleDriveNW;
SetUseAutoGears(TransmissionSetup.bUseGearAutoBox);
#endif
}
void UWheeledVehicleMovementComponentNW::UpdateSimulation(float DeltaTime)
{
#if 0 // @CARLAUE5
if (PVehicleDrive == nullptr)
return;
@ -309,10 +324,12 @@ void UWheeledVehicleMovementComponentNW::UpdateSimulation(float DeltaTime)
PxVehicleDriveNW* PVehicleDriveNW = (PxVehicleDriveNW*)PVehicleDrive;
PxVehicleDriveNWSmoothAnalogRawInputsAndSetAnalogInputs(SmoothData, SpeedSteerLookup, RawInputData, DeltaTime, false, *PVehicleDriveNW);
});
#endif
}
void UWheeledVehicleMovementComponentNW::UpdateEngineSetup(const FVehicleNWEngineData& NewEngineSetup)
{
#if 0 // @CARLAUE5
if (PVehicleDrive)
{
PxVehicleEngineData EngineData;
@ -321,10 +338,12 @@ void UWheeledVehicleMovementComponentNW::UpdateEngineSetup(const FVehicleNWEngin
PxVehicleDriveNW* PVehicleDriveNW = (PxVehicleDriveNW*)PVehicleDrive;
PVehicleDriveNW->mDriveSimData.setEngineData(EngineData);
}
#endif
}
void UWheeledVehicleMovementComponentNW::UpdateDifferentialSetup(const TArray<FVehicleNWWheelDifferentialData>& NewDifferentialSetup)
{
#if 0 // @CARLAUE5
if (PVehicleDrive)
{
PxVehicleDifferentialNWData DifferentialData;
@ -333,10 +352,12 @@ void UWheeledVehicleMovementComponentNW::UpdateDifferentialSetup(const TArray<FV
PxVehicleDriveNW* PVehicleDriveNW = (PxVehicleDriveNW*)PVehicleDrive;
PVehicleDriveNW->mDriveSimData.setDiffData(DifferentialData);
}
#endif
}
void UWheeledVehicleMovementComponentNW::UpdateTransmissionSetup(const FVehicleNWTransmissionData& NewTransmissionSetup)
{
#if 0 // @CARLAUE5
if (PVehicleDrive)
{
PxVehicleGearsData GearData;
@ -349,8 +370,10 @@ void UWheeledVehicleMovementComponentNW::UpdateTransmissionSetup(const FVehicleN
PVehicleDriveNW->mDriveSimData.setGearsData(GearData);
PVehicleDriveNW->mDriveSimData.setAutoBoxData(AutoBoxData);
}
#endif
}
#if 0 // @CARLAUE5
void BackwardsConvertCm2ToM2NW(float& val, float defaultValue)
{
if (val != defaultValue)
@ -358,9 +381,11 @@ void BackwardsConvertCm2ToM2NW(float& val, float defaultValue)
val = Cm2ToM2(val);
}
}
#endif
void UWheeledVehicleMovementComponentNW::Serialize(FArchive& Ar)
{
#if 0 // @CARLAUE5
Super::Serialize(Ar);
if (Ar.IsLoading() && Ar.UE4Ver() < VER_UE4_VEHICLES_UNIT_CHANGE)
{
@ -383,14 +408,18 @@ void UWheeledVehicleMovementComponentNW::Serialize(FArchive& Ar)
BackwardsConvertCm2ToM2NW(EngineSetup.MOI, DefEngineData.mMOI);
BackwardsConvertCm2ToM2NW(TransmissionSetup.ClutchStrength, DefClutchData.mStrength);
}
#endif
}
void UWheeledVehicleMovementComponentNW::ComputeConstants()
{
Super::ComputeConstants();
#if 0 // @CARLAUE5
MaxEngineRPM = EngineSetup.MaxRPM;
#endif
}
#if 0 // @CARLAUE5
const void* UWheeledVehicleMovementComponentNW::GetTireData(physx::PxVehicleWheels* InWheels, UVehicleWheel* InWheel)
{
const void* realShaderData = &InWheels->mWheelsSimData.getTireData((PxU32)InWheel->WheelIndex);
@ -408,3 +437,4 @@ const physx::PxVehicleWheelData UWheeledVehicleMovementComponentNW::GetWheelData
const physx::PxVehicleWheelData WheelData = InWheels->mWheelsSimData.getWheelData((physx::PxU32)InWheel);
return WheelData;
}
#endif

View File

@ -9,11 +9,6 @@
#include "Curves/CurveFloat.h"
#include "WheeledVehicleMovementComponentNW.generated.h"
namespace physx
{
class PxVehicleWheelData;
}
USTRUCT()
struct FVehicleNWWheelDifferentialData
{
@ -145,9 +140,11 @@ class CARLA_API UWheeledVehicleMovementComponentNW : public UWheeledVehicleMovem
protected:
#if 0 // @CARLAUE5
virtual const void* GetTireData(physx::PxVehicleWheels* Wheels, UVehicleWheel* Wheel);
virtual const int32 GetWheelShapeMapping(physx::PxVehicleWheels* Wheels, uint32 Wheel);
virtual const physx::PxVehicleWheelData GetWheelData(physx::PxVehicleWheels* Wheels, uint32 Wheel);
#endif
/** Allocate and setup the PhysX vehicle */
virtual void SetupVehicle() override;

View File

@ -6,58 +6,37 @@
using UnrealBuildTool;
public class CarlaExporter : ModuleRules
public class CarlaExporter :
ModuleRules
{
public CarlaExporter(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
public CarlaExporter(ReadOnlyTargetRules Target) :
base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
// PublicIncludePaths.AddRange(new string[] { });
// PrivateIncludePaths.AddRange(new string[] { });
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(new string[]
{
"Core",
});
PrivateDependencyModuleNames.AddRange(new string[]
{
"Projects",
"InputCore",
"UnrealEd",
"LevelEditor",
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"Chaos",
"EditorStyle",
});
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Projects",
"InputCore",
"UnrealEd",
"LevelEditor",
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"Physx",
"EditorStyle"
// ... add private dependencies that you statically link with here ...
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
}
// DynamicallyLoadedModuleNames.AddRange(new string[] { });
}
}

View File

@ -15,14 +15,9 @@
#include "Components/InstancedStaticMeshComponent.h"
#include "PhysicsEngine/BodySetup.h"
#include "PhysicsEngine/ConvexElem.h"
#include "PxTriangleMesh.h"
#include "PxVec3.h"
#include "LevelEditor.h"
#include "EngineUtils.h"
#include "PhysXPublic.h"
#include "PhysicsPublic.h"
#include "PhysXIncludes.h"
#include "PxSimpleTypes.h"
#include <fstream>
#include <sstream>

View File

@ -31,7 +31,7 @@
"Enabled": true
},
{
"Name": "PhysXVehicles",
"Name": "ChaosVehicles",
"Enabled": true
},
{

View File

@ -3,209 +3,208 @@
using System;
using System.IO;
using UnrealBuildTool;
using EpicGames.Core;
using System.Linq;
using System.Diagnostics;
public class CarlaTools : ModuleRules
public class CarlaTools :
ModuleRules
{
bool UsingHoudini = true;
bool bUsingOmniverseConnector = false;
private bool IsWindows(ReadOnlyTargetRules Target)
{
return (Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32);
}
[CommandLine("-houdini")]
bool EnableHoudini = false;
public CarlaTools(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
[CommandLine("-nv-omniverse")]
bool EnableNVIDIAOmniverse = false;
// PrivatePCHHeaderFile = "Carla.h";
[CommandLine("-carla-install-path")]
string CarlaInstallPath = null;
if (IsWindows(Target))
[CommandLine("-carla-dependencies-install-path")]
string CarlaDependenciesPath = null;
public static string FindLibrary(string SearchPath, params string[] Patterns)
{
bEnableExceptions = true;
}
string CarlaPluginPath = Path.GetFullPath( ModuleDirectory );
string ConfigDir = Path.GetFullPath(Path.Combine(CarlaPluginPath, "../../../../Config/"));
string OptionalModulesFile = Path.Combine(ConfigDir, "OptionalModules.ini");
string[] text = System.IO.File.ReadAllLines(OptionalModulesFile);
foreach (string line in text)
{
if (line.Contains("Omniverse ON"))
{
Console.WriteLine("Enabling OmniverseConnector");
bUsingOmniverseConnector = true;
PublicDefinitions.Add("WITH_OMNIVERSE");
PrivateDefinitions.Add("WITH_OMNIVERSE");
}
}
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"ProceduralMeshComponent",
"MeshDescription",
"RawMesh",
"AssetTools"
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"UnrealEd",
"Blutility",
"UMG",
"EditorScriptingUtilities",
"Landscape",
"Foliage",
"FoliageEdit",
"MeshMergeUtilities",
"Carla",
"StaticMeshDescription",
"PhysXVehicles",
"Json",
"JsonUtilities",
"Networking",
"Sockets",
"HTTP",
"RHI",
"RenderCore",
"MeshMergeUtilities",
"StreetMapImporting",
"StreetMapRuntime"
// ... add private dependencies that you statically link with here ...
}
);
if(UsingHoudini)
{
PrivateDependencyModuleNames.AddRange(
new string[]
foreach (var Pattern in Patterns)
{
"HoudiniEngine",
"HoudiniEngineEditor",
"HoudiniEngineRuntime"
});
var Candidates = Directory.GetFiles(SearchPath, Pattern);
if (Candidates.Length == 0)
continue;
Array.Sort(Candidates);
return Candidates[0];
}
return null;
}
if(bUsingOmniverseConnector)
public CarlaTools(ReadOnlyTargetRules Target) :
base(Target)
{
PrivateDependencyModuleNames.AddRange(
new string[]
bool IsWindows = Target.Platform == UnrealTargetPlatform.Win64;
var DirectoryInfo = new DirectoryInfo(ModuleDirectory);
for (int i = 0; i != 6; ++i)
DirectoryInfo = DirectoryInfo.Parent;
var WorkspacePath = DirectoryInfo.ToString();
Debug.Assert(Directory.Exists(WorkspacePath));
if (CarlaInstallPath == null)
{
"OmniverseUSD",
"OmniverseRuntime"
});
}
Console.WriteLine("-carla-install-path was not specified, inferring...");
CarlaInstallPath = Path.Combine(WorkspacePath, "Install", "libcarla");
Debug.Assert(Directory.Exists(CarlaInstallPath), "Could not infer CARLA install directory.");
}
DynamicallyLoadedModuleNames.AddRange(
new string[]
if (CarlaDependenciesPath == null)
{
Console.WriteLine("-carla-dependencies-path was not specified, inferring...");
CarlaDependenciesPath = Path.Combine(WorkspacePath, "Build", "Dependencies");
Debug.Assert(Directory.Exists(CarlaDependenciesPath), "Could not infer CARLA dependencies directory.");
}
bEnableExceptions = bEnableExceptions || IsWindows;
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
// PrivatePCHHeaderFile = "Carla.h";
// PublicIncludePaths.AddRange(new string[] { });
// PrivateIncludePaths.AddRange(new string[] { });
PublicDependencyModuleNames.AddRange(new string[]
{
"Core",
"ProceduralMeshComponent",
"MeshDescription",
"RawMesh",
"AssetTools"
});
PrivateDependencyModuleNames.AddRange(new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"UnrealEd",
"Blutility",
"UMG",
"EditorScriptingUtilities",
"Landscape",
"Foliage",
"FoliageEdit",
"MeshMergeUtilities",
"Carla",
"StaticMeshDescription",
"ChaosVehicles",
"Json",
"JsonUtilities",
"Networking",
"Sockets",
"HTTP",
"RHI",
"RenderCore",
"MeshMergeUtilities",
"StreetMapImporting",
"StreetMapRuntime"
});
if (EnableHoudini)
{
PrivateDependencyModuleNames.AddRange(new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
AddCarlaServerDependency(Target);
}
"HoudiniEngine",
"HoudiniEngineEditor",
"HoudiniEngineRuntime"
});
}
private bool UseDebugLibs(ReadOnlyTargetRules Target)
{
if (IsWindows(Target))
{
// In Windows, Unreal uses the Release C++ Runtime (CRT) even in debug
// mode, so unless we recompile the engine we cannot link the debug
// libraries.
return false;
}
else
{
return false;
}
}
delegate string ADelegate(string s);
private void AddBoostLibs(string LibPath)
{
string [] files = Directory.GetFiles(LibPath, "*boost*.lib");
foreach (string file in files)
{
PublicAdditionalLibraries.Add(file);
}
}
private void AddCarlaServerDependency(ReadOnlyTargetRules Target)
{
string LibCarlaInstallPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "../../../Carla/CarlaDependencies"));
ADelegate GetLibName = (string BaseName) => {
if (IsWindows(Target))
if (EnableNVIDIAOmniverse)
{
PrivateDependencyModuleNames.AddRange(new string[]
{
return BaseName + ".lib";
}
else
{
return "lib" + BaseName + ".a";
}
};
"OmniverseUSD",
"OmniverseRuntime"
});
}
// Link dependencies.
if (IsWindows(Target))
{
AddBoostLibs(Path.Combine(LibCarlaInstallPath, "lib"));
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("rpc")));
// DynamicallyLoadedModuleNames.AddRange(new string[] { });
if (UseDebugLibs(Target))
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server_debug")));
}
else
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server")));
}
var LibraryPrefix = IsWindows ? "" : "lib";
var LibrarySuffix = IsWindows ? ".lib" : ".a";
Func<string, string> GetLibraryName = name =>
{
return LibraryPrefix + name + LibrarySuffix;
};
var LibCarlaInstallPath = CarlaInstallPath;
var DependenciesInstallPath = CarlaDependenciesPath;
// LibCarla
var LibCarlaIncludePath = Path.Combine(LibCarlaInstallPath, "include");
var LibCarlaLibPath = Path.Combine(LibCarlaInstallPath, "lib");
var LibCarlaServerPath = Path.Combine(LibCarlaLibPath, GetLibraryName("carla-server"));
var LibCarlaClientPath = Path.Combine(LibCarlaLibPath, GetLibraryName("carla-client"));
// Boost
var BoostInstallPath = Path.Combine(DependenciesInstallPath, "boost-install");
var BoostLibPath = Path.Combine(BoostInstallPath, "lib");
var BoostLibraryPatterns = new string[]
{
GetLibraryName("*boost_asio*"),
GetLibraryName("*boost_python*"),
};
var BoostLibraries =
from Pattern in BoostLibraryPatterns
select FindLibrary(BoostLibPath, Pattern);
// Chrono
var ChronoInstallPath = Path.Combine(DependenciesInstallPath, "chrono-install");
var ChronoLibPath = Path.Combine(ChronoInstallPath, "lib");
var ChronoLibraryNames = new string[]
{
"ChronoEngine",
"ChronoEngine_vehicle",
"ChronoModels_vehicle",
"ChronoModels_robot",
};
var ChronoLibraries =
from Name in ChronoLibraryNames
select FindLibrary(Name);
// SQLite
var SQLiteBuildPath = Path.Combine(DependenciesInstallPath, "sqlite-build");
var SQLiteLibrary = FindLibrary(SQLiteBuildPath, GetLibraryName("sqlite*"));
// RPCLib
var RPCLibInstallPath = Path.Combine(DependenciesInstallPath, "rpclib-install");
var RPCLibPath = Path.Combine(RPCLibInstallPath, "lib");
var RPCLibraryPath = FindLibrary(RPCLibPath, "rpc");
// Xerces-C
var XercesCInstallPath = Path.Combine(DependenciesInstallPath, "xercesc-install");
var XercesCLibPath = Path.Combine(XercesCInstallPath, "lib");
var XercesCLibrary = FindLibrary(XercesCLibPath, "xercesc*");
// Proj
var ProjInstallPath = Path.Combine(DependenciesInstallPath, "proj-install");
var ProjLibPath = Path.Combine(ProjInstallPath, "lib");
var ProjLibrary = FindLibrary(ProjLibPath, "proj*");
// SUMO (OSM2ODR)
var SUMOInstallPath = Path.Combine(DependenciesInstallPath, "sumo-install");
var SUMOLibPath = Path.Combine(SUMOInstallPath, "lib");
var SUMOLibrary = FindLibrary(SUMOLibPath, "sumo*");
// ZLib
var ZLibInstallPath = Path.Combine(DependenciesInstallPath, "zlib-install");
var ZLibLibPath = Path.Combine(ZLibInstallPath, "lib");
var ZLibLibrary = FindLibrary(ZLibLibPath, "zlib*");
PublicAdditionalLibraries.Add(LibCarlaServerPath);
PublicAdditionalLibraries.Add(LibCarlaClientPath);
PublicAdditionalLibraries.Add(RPCLibraryPath);
PublicAdditionalLibraries.AddRange(BoostLibraries);
PublicIncludePaths.Add(LibCarlaIncludePath);
PublicDefinitions.Add("BOOST_DISABLE_ABI_HEADERS");
PublicDefinitions.Add("BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY");
if (!bEnableExceptions)
{
PublicDefinitions.Add("ASIO_NO_EXCEPTIONS");
PublicDefinitions.Add("BOOST_NO_EXCEPTIONS");
PublicDefinitions.Add("PUGIXML_NO_EXCEPTIONS");
PublicDefinitions.Add("LIBCARLA_NO_EXCEPTIONS");
}
}
else
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("rpc")));
if (UseDebugLibs(Target))
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server_debug")));
}
else
{
PublicAdditionalLibraries.Add(Path.Combine(LibCarlaInstallPath, "lib", GetLibName("carla_server")));
}
}
// Include path.
string LibCarlaIncludePath = Path.Combine(LibCarlaInstallPath, "include");
PublicIncludePaths.Add(LibCarlaIncludePath);
PrivateIncludePaths.Add(LibCarlaIncludePath);
PublicDefinitions.Add("ASIO_NO_EXCEPTIONS");
PublicDefinitions.Add("BOOST_NO_EXCEPTIONS");
// PublicDefinitions.Add("LIBCARLA_NO_EXCEPTIONS");
PublicDefinitions.Add("PUGIXML_NO_EXCEPTIONS");
PublicDefinitions.Add("BOOST_DISABLE_ABI_HEADERS");
PublicDefinitions.Add("BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY");
}
}

View File

@ -4,32 +4,24 @@ using UnrealBuildTool;
using System.Collections.Generic;
using System;
using System.IO;
using EpicGames.Core;
public class CarlaUE4Target : TargetRules
public class CarlaUE4Target :
TargetRules
{
public CarlaUE4Target(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
ExtraModuleNames.Add("CarlaUE4");
[CommandLine("-unity-build")]
bool EnableUnityBuild = false;
string ConfigDir = Path.GetDirectoryName(ProjectFile.ToString()) + "/Config/";
string OptionalModulesFile = Path.Combine(ConfigDir, "OptionalModules.ini");
string[] text = System.IO.File.ReadAllLines(OptionalModulesFile);
public CarlaUE4Target(TargetInfo Target) :
base(Target)
{
Type = TargetType.Game;
ExtraModuleNames.Add("CarlaUE4");
bool UnityOn = true;
foreach (string line in text) {
if (line.Contains("Unity OFF"))
{
UnityOn = false;
}
Console.WriteLine("Unity build is disabled.");
bUseUnityBuild = EnableUnityBuild;
bForceUnityBuild = EnableUnityBuild;
bUseAdaptiveUnityBuild = EnableUnityBuild;
}
if (!UnityOn) {
Console.WriteLine("Disabling unity");
bUseUnityBuild = false;
bForceUnityBuild = false;
bUseAdaptiveUnityBuild = false;
}
}
}

View File

@ -6,14 +6,18 @@ public class CarlaUE4 : ModuleRules
{
public CarlaUE4(ReadOnlyTargetRules Target) : base(Target)
{
PrivatePCHHeaderFile = "CarlaUE4.h";
PrivatePCHHeaderFile = "CarlaUE4.h";
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PublicDependencyModuleNames.AddRange(new string[]
{
"Core",
"CoreUObject",
"Engine",
"InputCore"
});
if (Target.Type == TargetType.Editor)
{
PublicDependencyModuleNames.AddRange(new string[] { "UnrealEd" });
}
PublicDependencyModuleNames.Add("UnrealEd");
PrivateDependencyModuleNames.AddRange(new string[] { });

View File

@ -4,32 +4,24 @@ using UnrealBuildTool;
using System.Collections.Generic;
using System;
using System.IO;
using EpicGames.Core;
public class CarlaUE4EditorTarget : TargetRules
public class CarlaUE4EditorTarget :
TargetRules
{
public CarlaUE4EditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
ExtraModuleNames.Add("CarlaUE4");
[CommandLine("-unity-build")]
bool EnableUnityBuild = false;
string ConfigDir = Path.GetDirectoryName(ProjectFile.ToString()) + "/Config/";
string OptionalModulesFile = Path.Combine(ConfigDir, "OptionalModules.ini");
string[] text = System.IO.File.ReadAllLines(OptionalModulesFile);
public CarlaUE4EditorTarget(TargetInfo Target) :
base(Target)
{
Type = TargetType.Editor;
bool UnityOn = true;
ExtraModuleNames.Add("CarlaUE4");
foreach (string line in text) {
if (line.Contains("Unity OFF"))
{
UnityOn = false;
}
}
if (!UnityOn) {
Console.WriteLine("Disabling unity");
bUseUnityBuild = false;
bForceUnityBuild = false;
bUseAdaptiveUnityBuild = false;
}
}
Console.WriteLine("Unity build is disabled.");
bUseUnityBuild = EnableUnityBuild;
bForceUnityBuild = EnableUnityBuild;
bUseAdaptiveUnityBuild = EnableUnityBuild;
}
}

View File

@ -53,6 +53,7 @@ TArray<FUSDCARLALight> UUSDCARLAInterface::GetUSDLights(const FString& Path)
TArray<FUSDCARLAWheelData> UUSDCARLAInterface::GetUSDWheelData(const FString& Path)
{
#if 0 // @CARLAUE5
pxr::UsdStageRefPtr Stage =
FOmniverseUSDHelper::LoadUSDStageFromPath(Path);
@ -171,4 +172,5 @@ TArray<FUSDCARLAWheelData> UUSDCARLAInterface::GetUSDWheelData(const FString& Pa
ParseWheelData("wheel_3", Wheel3);
return {Wheel0, Wheel1, Wheel2, Wheel3};
#endif
}