From b4b064beb3e8bd142da2d2fe299ed42486a16b2f Mon Sep 17 00:00:00 2001 From: Blyron Date: Mon, 30 Sep 2024 17:08:01 +0200 Subject: [PATCH 1/4] Fix crash when spawn car while recording --- .../Source/Carla/Recorder/CarlaRecorder.cpp | 18 ++++---- .../Carla/Vehicle/WheelPhysicsControl.h | 42 +++++++++++++++++++ 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp index 7cbe3186a..bfd150329 100644 --- a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp +++ b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp @@ -118,7 +118,7 @@ void ACarlaRecorder::Ticking(float DeltaSeconds) AddActorPosition(View); AddVehicleAnimation(View); AddVehicleLight(View); - AddVehicleWheelsAnimation(View); + //AddVehicleWheelsAnimation(View); if (bAdditionalData) { AddActorKinematics(View); @@ -308,11 +308,15 @@ void ACarlaRecorder::AddVehicleLight(FCarlaActor *CarlaActor) void ACarlaRecorder::AddVehicleDoor(const ACarlaWheeledVehicle &Vehicle, const EVehicleDoor SDoors, bool bIsOpen) { - CarlaRecorderDoorVehicle DoorVehicle; - DoorVehicle.DatabaseId = Episode->GetActorRegistry().FindCarlaActor(&Vehicle)->GetActorId(); - DoorVehicle.Doors = static_cast(SDoors); - DoorVehicle.bIsOpen = bIsOpen; - AddDoorVehicle(DoorVehicle); + const FCarlaActor* LocalCarlaActor = Episode->GetActorRegistry().FindCarlaActor(&Vehicle); + if (LocalCarlaActor != nullptr) + { + CarlaRecorderDoorVehicle DoorVehicle; + DoorVehicle.DatabaseId = LocalCarlaActor->GetActorId(); + DoorVehicle.Doors = static_cast(SDoors); + DoorVehicle.bIsOpen = bIsOpen; + AddDoorVehicle(DoorVehicle); + } } void ACarlaRecorder::AddActorKinematics(FCarlaActor *CarlaActor) @@ -431,7 +435,7 @@ std::string ACarlaRecorder::Start(std::string Name, FString MapName, bool Additi std::string Filename = GetRecorderFilename(Name); // binary file - File.open(Filename, std::ios::binary); + File.open(Filename, std::ios::out); if (!File.is_open()) { return ""; diff --git a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/WheelPhysicsControl.h b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/WheelPhysicsControl.h index bd1b183e9..10dba6a19 100644 --- a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/WheelPhysicsControl.h +++ b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Vehicle/WheelPhysicsControl.h @@ -13,6 +13,48 @@ struct CARLA_API FWheelPhysicsControl { GENERATED_BODY() + FWheelPhysicsControl() : + AxleType(EAxleType::Undefined), + Offset(FVector(0.0f, 0.0f, 0.0f)), + WheelRadius(1.0f), + WheelWidth(1.0f), + WheelMass(1), + CorneringStiffness(1.0f), + FrictionForceMultiplier(1.0f), + SideSlipModifier(0.5f), + SlipThreshold(1.0f), + SkidThreshold(1.0f), + MaxSteerAngle(60.0f), + bAffectedBySteering(true), + bAffectedByBrake(true), + bAffectedByHandbrake(true), + bAffectedByEngine(true), + bABSEnabled(true), + bTractionControlEnabled(true), + MaxWheelspinRotation(1.0f), + ExternalTorqueCombineMethod(ETorqueCombineMethod::None), + LateralSlipGraph(FRichCurve()), + SuspensionAxis(FVector(0.0f, 0.0f, 1.0f)), + SuspensionForceOffset(1.0f), + SuspensionMaxRaise(1.0f), + SuspensionMaxDrop(1.0f), + SuspensionDampingRatio(0.5f), + WheelLoadRatio(0.5f), + SpringRate(1.0f), + SpringPreload(1.0f), + SuspensionSmoothing(5.0f), + RollbarScaling(0.0f), + SweepShape(ESweepShape::Spherecast), + SweepType(ESweepType::ComplexSweep), + MaxBrakeTorque(1.0f), + MaxHandBrakeTorque(1.0f), + WheelIndex(0), + Location(FVector(0.0f, 0.0f, 0.0f)), + OldLocation(FVector(0.0f, 0.0f, 0.0f)), + Velocity(FVector(0.0f, 0.0f, 0.0f)) + { + + } /** If left undefined then the bAffectedByEngine value is used, if defined then bAffectedByEngine is ignored and the differential setup on the vehicle defines which wheels get power from the engine */ UPROPERTY(EditAnywhere, Category = Wheel) EAxleType AxleType; From e5f7e79d09b4a0a40b0f36b210a8a0895a4ea881 Mon Sep 17 00:00:00 2001 From: Blyron Date: Mon, 30 Sep 2024 17:10:12 +0200 Subject: [PATCH 2/4] Revert open type --- .../Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp index bfd150329..a1e0e42c0 100644 --- a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp +++ b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp @@ -435,7 +435,7 @@ std::string ACarlaRecorder::Start(std::string Name, FString MapName, bool Additi std::string Filename = GetRecorderFilename(Name); // binary file - File.open(Filename, std::ios::out); + File.open(Filename, std::ios::binary); if (!File.is_open()) { return ""; From fb62780b584831e1b63c931fe387ec9ef094b3a4 Mon Sep 17 00:00:00 2001 From: MarcelPiNacy-CVC <169088301+MarcelPiNacy-CVC@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:08:27 +0200 Subject: [PATCH 3/4] Improve package folder layout. (#8229) * Improve package naming and build directory structure. * Fix recastbuilder path. * Remove co-simulation copy command + minor cleanup. --- CMakeLists.txt | 7 ++- Unreal/CMakeLists.txt | 52 ++++++++++++----- .../Carla/Source/Carla/Game/CarlaEpisode.cpp | 5 +- Unreal/Package/Compress.cmake | 42 +++++++++++--- Unreal/Package/CopyCarlaAdditionalFiles.cmake | 58 +++++++++---------- Unreal/Package/CreateCarlaVersionFile.cmake | 27 ++++++--- 6 files changed, 123 insertions(+), 68 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f181a0003..9602dc7bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,9 +56,14 @@ set ( ${CMAKE_CURRENT_SOURCE_DIR} ) +set ( + CARLA_BUILD_PATH + ${CMAKE_BINARY_DIR} +) + set ( CARLA_PACKAGE_PATH - ${CMAKE_BINARY_DIR}/Package + ${CARLA_BUILD_PATH}/Package ) set ( diff --git a/Unreal/CMakeLists.txt b/Unreal/CMakeLists.txt index d5932bb7e..0f1575309 100644 --- a/Unreal/CMakeLists.txt +++ b/Unreal/CMakeLists.txt @@ -14,11 +14,6 @@ carla_option ( ON ) -set ( - CARLA_BUILD_PATH - ${CARLA_WORKSPACE_PATH}/Build/ -) - set ( CARLA_UE_PATH ${CARLA_WORKSPACE_PATH}/Unreal/CarlaUnreal @@ -375,16 +370,38 @@ add_dependencies ( ${UE_DEPENDENCIES_ORDER_ONLY} ) + + function ( add_carla_ue_package_target PACKAGE_CONFIGURATION UE_BUILD_CONFIGURATION) set ( - CARLA_TARGET_PACKAGE_PATH - ${CARLA_PACKAGE_PATH}/${UE_SYSTEM_NAME} + CARLA_PACKAGE_NAME + Carla-${CARLA_VERSION}-${UE_SYSTEM_NAME}-${UE_BUILD_CONFIGURATION} ) + set ( + CARLA_CURRENT_PACKAGE_PATH + ${CARLA_PACKAGE_PATH}/${CARLA_PACKAGE_NAME} + ) + + set ( + CARLA_CURRENT_PACKAGE_ARCHIVE_PATH + ${CARLA_PACKAGE_PATH}/${CARLA_PACKAGE_NAME} + ) + + set ( + CARLA_PACKAGE_STAGING_PATH + ${CARLA_PACKAGE_PATH}/StagedBuilds/${CARLA_PACKAGE_NAME} + ) + + set ( + CARLA_PACKAGE_ARCHIVE_PATH + ${CARLA_CURRENT_PACKAGE_PATH} + ) + if (NOT "${PACKAGE_CONFIGURATION}" STREQUAL "") set (TARGET_NAME_SUFFIX -${PACKAGE_CONFIGURATION}) string (TOLOWER "${TARGET_NAME_SUFFIX}" TARGET_NAME_SUFFIX) @@ -422,7 +439,8 @@ function ( -Platform=${UE_SYSTEM_NAME} -prereqs -build - -archivedirectory=${CARLA_PACKAGE_PATH} + -stagingdirectory=${CARLA_PACKAGE_STAGING_PATH} + -archivedirectory=${CARLA_PACKAGE_ARCHIVE_PATH} USES_TERMINAL VERBATIM ) @@ -432,33 +450,35 @@ function ( POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE CREATING VERSION FILE UNREAL PACKAGE EXTRA FILES STARTED **********" COMMAND ${CMAKE_COMMAND} - -DCARLA_SOURCE_DIR=${CARLA_SOURCE_DIR} + -DCARLA_WORKSPACE_PATH=${CARLA_WORKSPACE_PATH} -DCARLA_UNREAL_ENGINE_PATH=${CARLA_UNREAL_ENGINE_PATH} - -DCARLA_PACKAGE_VERSION_FILE=${CARLA_TARGET_PACKAGE_PATH}/VERSION + -DCARLA_PACKAGE_VERSION_FILE=${CARLA_PACKAGE_ARCHIVE_PATH}/VERSION -P${CMAKE_CURRENT_SOURCE_DIR}/Package/CreateCarlaVersionFile.cmake COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE VERSION FILE UNREAL PACKAGE EXTRA FILES COMPLETED **********" COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE REMOVING UNREAL PACKAGE EXTRA FILES STARTED **********" COMMAND ${CMAKE_COMMAND} - -DCARLA_TARGET_PACKAGE_PATH=${CARLA_TARGET_PACKAGE_PATH} + -DCARLA_PACKAGE_ARCHIVE_PATH=${CARLA_PACKAGE_ARCHIVE_PATH} -P${CMAKE_CURRENT_SOURCE_DIR}/Package/RemoveUnrealPackageExtraFiles.cmake COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE REMOVING UNREAL PACKAGE EXTRA FILES COMPLETED **********" COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE COPYING CARLA ADDITIONAL FILES STARTED **********" COMMAND ${CMAKE_COMMAND} - -DCARLA_SOURCE_DIR=${CARLA_SOURCE_DIR} - -DCARLA_TARGET_PACKAGE_PATH=${CARLA_TARGET_PACKAGE_PATH} - -DCARLA_BINARY_DIR=${CARLA_BINARY_DIR} + -DCARLA_BUILD_PATH=${CARLA_BUILD_PATH} + -DCARLA_WORKSPACE_PATH=${CARLA_WORKSPACE_PATH} + -DCARLA_PACKAGE_ARCHIVE_PATH=${CARLA_PACKAGE_ARCHIVE_PATH} -P${CMAKE_CURRENT_SOURCE_DIR}/Package/CopyCarlaAdditionalFiles.cmake COMMAND ${CMAKE_COMMAND} -E echo "********** PACKAGE COPYING CARLA ADDITIONAL FILES COMPLETED **********" COMMAND ${CMAKE_COMMAND} -E echo "********** COMPRESSING PACKAGE STARTED **********" COMMAND ${CMAKE_COMMAND} -DCARLA_PACKAGE_PATH=${CARLA_PACKAGE_PATH} - -DCARLA_TARGET_PACKAGE_PATH=${CARLA_TARGET_PACKAGE_PATH} - -DTARGET_NAME_SUFFIX=${TARGET_NAME_SUFFIX} + -DCARLA_PACKAGE_ARCHIVE_PATH=${CARLA_PACKAGE_ARCHIVE_PATH} + -DCARLA_CURRENT_PACKAGE_PATH=${CARLA_CURRENT_PACKAGE_PATH} -P${CMAKE_CURRENT_SOURCE_DIR}/Package/Compress.cmake COMMAND ${CMAKE_COMMAND} -E echo "********** COMPRESSING PACKAGE COMPLETED **********" + USES_TERMINAL + VERBATIM ) add_dependencies ( diff --git a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp index ea5fd7da5..4aebca48b 100644 --- a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp +++ b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp @@ -31,10 +31,7 @@ #include "Misc/FileHelper.h" #include "Misc/Paths.h" -#define TO_STRING_EXPAND(s) #s -#define TO_STRING(s) TO_STRING_EXPAND(s) - -constexpr TCHAR DefaultRecastBuilderPath[] = TEXT(TO_STRING(RECASTBUILDER_PATH)); +constexpr TCHAR DefaultRecastBuilderPath[] = TEXT(RECASTBUILDER_PATH); static FString BuildRecastBuilderFile() { diff --git a/Unreal/Package/Compress.cmake b/Unreal/Package/Compress.cmake index c749c7cc7..39eb21515 100644 --- a/Unreal/Package/Compress.cmake +++ b/Unreal/Package/Compress.cmake @@ -1,12 +1,36 @@ -set (CARLA_PACKAGE_FILE_NAME_WITHOUT_EXTENSION ${CARLA_PACKAGE_PATH}/CARLA${TARGET_NAME_SUFFIX}) +file ( + GLOB + CARLA_PACKAGE_FILES + ${CARLA_PACKAGE_ARCHIVE_PATH}/* +) + if (WIN32) - set(CARLA_PACKAGE_FILE_NAME_AND_ARGS cvf ${CARLA_PACKAGE_FILE_NAME_WITHOUT_EXTENSION}.zip --format=zip) -else() - set(CARLA_PACKAGE_FILE_NAME_AND_ARGS cvfz ${CARLA_PACKAGE_FILE_NAME_WITHOUT_EXTENSION}.tar.gz) -endif() + set ( + COMPRESS_PACKAGE_COMMAND + ${CMAKE_COMMAND} + -E tar cvf + ${CARLA_CURRENT_PACKAGE_PATH}.zip + --format=zip + ${CARLA_PACKAGE_FILES} + ) +else () + set ( + COMPRESS_PACKAGE_COMMAND + ${CMAKE_COMMAND} + -E tar cvfz + ${CARLA_CURRENT_PACKAGE_PATH}.tar.gz + ${CARLA_PACKAGE_FILES} + ) +endif () -file(GLOB CARLA_PACKAGE_FILES ${CARLA_TARGET_PACKAGE_PATH}/*) +message ( + STATUS + "Running \"${COMPRESS_PACKAGE_COMMAND}\"" +) -execute_process( - COMMAND cmake -E tar ${CARLA_PACKAGE_FILE_NAME_AND_ARGS} ${CARLA_PACKAGE_FILES} - WORKING_DIRECTORY ${CARLA_TARGET_PACKAGE_PATH}) +execute_process ( + COMMAND + ${COMPRESS_PACKAGE_COMMAND} + WORKING_DIRECTORY + ${CARLA_PACKAGE_PATH} +) diff --git a/Unreal/Package/CopyCarlaAdditionalFiles.cmake b/Unreal/Package/CopyCarlaAdditionalFiles.cmake index 51430c2f0..381622d1c 100644 --- a/Unreal/Package/CopyCarlaAdditionalFiles.cmake +++ b/Unreal/Package/CopyCarlaAdditionalFiles.cmake @@ -1,41 +1,41 @@ -file (COPY_FILE ${CARLA_SOURCE_DIR}/LICENSE ${CARLA_TARGET_PACKAGE_PATH}/LICENSE) -file (COPY_FILE ${CARLA_SOURCE_DIR}/CHANGELOG.md ${CARLA_TARGET_PACKAGE_PATH}/CHANGELOG) -file (COPY_FILE ${CARLA_SOURCE_DIR}/Docs/release_readme.md ${CARLA_TARGET_PACKAGE_PATH}/README) +file (COPY_FILE ${CARLA_WORKSPACE_PATH}/LICENSE ${CARLA_PACKAGE_ARCHIVE_PATH}/LICENSE) +file (COPY_FILE ${CARLA_WORKSPACE_PATH}/CHANGELOG.md ${CARLA_PACKAGE_ARCHIVE_PATH}/CHANGELOG) +file (COPY_FILE ${CARLA_WORKSPACE_PATH}/Docs/release_readme.md ${CARLA_PACKAGE_ARCHIVE_PATH}/README) if (WIN32) set (EXE_EXT .exe) else () set (EXE_EXT) endif () -make_directory (${CARLA_TARGET_PACKAGE_PATH}/Tools) +make_directory (${CARLA_PACKAGE_ARCHIVE_PATH}/Tools) # @TODO Temporary hack: -file (COPY_FILE ${CARLA_BINARY_DIR}/_deps/recastnavigation-build/RecastBuilder/RecastBuilder${EXE_EXT} ${CARLA_TARGET_PACKAGE_PATH}/Tools/RecastBuilder${EXE_EXT}) +file (COPY_FILE ${CARLA_BUILD_PATH}/_deps/recastnavigation-build/RecastBuilder/RecastBuilder${EXE_EXT} ${CARLA_PACKAGE_ARCHIVE_PATH}/Tools/RecastBuilder${EXE_EXT}) -make_directory (${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/dist) -file (GLOB PYTHON_WHL_FILES ${CARLA_BINARY_DIR}/PythonAPI/dist/carla-*.whl) -file (COPY ${PYTHON_WHL_FILES} DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/dist/) -file (COPY_FILE ${CARLA_SOURCE_DIR}/Docs/python_api.md ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/python_api.md) -file (COPY ${CARLA_SOURCE_DIR}/PythonAPI/carla/agents/ DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/agents/) -file (COPY_FILE ${CARLA_SOURCE_DIR}/PythonAPI/carla/scene_layout.py ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/scene_layout.py) -file (COPY_FILE ${CARLA_SOURCE_DIR}/PythonAPI/carla/requirements.txt ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/carla/requirements.txt) +make_directory (${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/carla/dist) +file (GLOB PYTHON_WHL_FILES ${CARLA_BUILD_PATH}/PythonAPI/dist/carla-*.whl) +file (COPY ${PYTHON_WHL_FILES} DESTINATION ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/carla/dist/) +file (COPY_FILE ${CARLA_WORKSPACE_PATH}/Docs/python_api.md ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/python_api.md) +file (COPY ${CARLA_WORKSPACE_PATH}/PythonAPI/carla/agents/ DESTINATION ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/carla/agents/) +file (COPY_FILE ${CARLA_WORKSPACE_PATH}/PythonAPI/carla/scene_layout.py ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/carla/scene_layout.py) +file (COPY_FILE ${CARLA_WORKSPACE_PATH}/PythonAPI/carla/requirements.txt ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/carla/requirements.txt) -make_directory (${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/) -file (GLOB PYTHON_EXAMPLE_FILES ${CARLA_SOURCE_DIR}/PythonAPI/examples/*.py) -file (COPY ${PYTHON_EXAMPLE_FILES} DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/) -make_directory (${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/rss/) -file (GLOB PYTHON_EXAMPLE_RSS_FILES ${CARLA_SOURCE_DIR}/PythonAPI/examples/rss/*.py) -file (COPY ${PYTHON_EXAMPLE_RSS_FILES} DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/rss/) -file (COPY_FILE ${CARLA_SOURCE_DIR}/PythonAPI/examples/requirements.txt ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/examples/requirements.txt) +make_directory (${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/examples/) +file (GLOB PYTHON_EXAMPLE_FILES ${CARLA_WORKSPACE_PATH}/PythonAPI/examples/*.py) +file (COPY ${PYTHON_EXAMPLE_FILES} DESTINATION ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/examples/) +make_directory (${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/examples/rss/) +file (GLOB PYTHON_EXAMPLE_RSS_FILES ${CARLA_WORKSPACE_PATH}/PythonAPI/examples/rss/*.py) +file (COPY ${PYTHON_EXAMPLE_RSS_FILES} DESTINATION ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/examples/rss/) +file (COPY_FILE ${CARLA_WORKSPACE_PATH}/PythonAPI/examples/requirements.txt ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/examples/requirements.txt) -make_directory (${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/) -file (GLOB PYTHON_UTIL_FILES ${CARLA_SOURCE_DIR}/PythonAPI/util/*.py) -file (COPY ${PYTHON_UTIL_FILES} DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/) -file (COPY_FILE ${CARLA_SOURCE_DIR}/PythonAPI/util/requirements.txt ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/requirements.txt) -file (COPY ${CARLA_SOURCE_DIR}/PythonAPI/util/opendrive/ DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/PythonAPI/util/opendrive/) +make_directory (${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/util/) +file (GLOB PYTHON_UTIL_FILES ${CARLA_WORKSPACE_PATH}/PythonAPI/util/*.py) +file (COPY ${PYTHON_UTIL_FILES} DESTINATION ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/util/) +file (COPY_FILE ${CARLA_WORKSPACE_PATH}/PythonAPI/util/requirements.txt ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/util/requirements.txt) +file (COPY ${CARLA_WORKSPACE_PATH}/PythonAPI/util/opendrive/ DESTINATION ${CARLA_PACKAGE_ARCHIVE_PATH}/PythonAPI/util/opendrive/) -file (COPY ${CARLA_SOURCE_DIR}/Co-Simulation/ DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/Co-Simulation/) +# file (COPY ${CARLA_WORKSPACE_PATH}/Co-Simulation/ DESTINATION ${CARLA_PACKAGE_ARCHIVE_PATH}/Co-Simulation/) -make_directory (${CARLA_TARGET_PACKAGE_PATH}/HDMaps/) -file (GLOB PYTHON_HDMAP_FILES ${CARLA_SOURCE_DIR}/Unreal/CarlaUnreal/Content/Carla/HDMaps/*.pcd) -file (COPY ${PYTHON_HDMAP_FILES} DESTINATION ${CARLA_TARGET_PACKAGE_PATH}/HDMaps/) -file (COPY_FILE ${CARLA_SOURCE_DIR}/Unreal/CarlaUnreal/Content/Carla/HDMaps/Readme.md ${CARLA_TARGET_PACKAGE_PATH}/HDMaps/README) +make_directory (${CARLA_PACKAGE_ARCHIVE_PATH}/HDMaps/) +file (GLOB PYTHON_HDMAP_FILES ${CARLA_WORKSPACE_PATH}/Unreal/CarlaUnreal/Content/Carla/HDMaps/*.pcd) +file (COPY ${PYTHON_HDMAP_FILES} DESTINATION ${CARLA_PACKAGE_ARCHIVE_PATH}/HDMaps/) +file (COPY_FILE ${CARLA_WORKSPACE_PATH}/Unreal/CarlaUnreal/Content/Carla/HDMaps/Readme.md ${CARLA_PACKAGE_ARCHIVE_PATH}/HDMaps/README) diff --git a/Unreal/Package/CreateCarlaVersionFile.cmake b/Unreal/Package/CreateCarlaVersionFile.cmake index 8e0c1bbfd..e5c97c1d5 100644 --- a/Unreal/Package/CreateCarlaVersionFile.cmake +++ b/Unreal/Package/CreateCarlaVersionFile.cmake @@ -1,21 +1,30 @@ execute_process( - COMMAND git log -1 --format=%H - WORKING_DIRECTORY ${CARLA_SOURCE_DIR} - OUTPUT_VARIABLE CARLA_GIT_HASH + COMMAND + git log -1 --format=%H + WORKING_DIRECTORY + ${CARLA_WORKSPACE_PATH} + OUTPUT_VARIABLE + CARLA_GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process( - COMMAND git log -1 --format=%H - WORKING_DIRECTORY ${CARLA_SOURCE_DIR}/Unreal/CarlaUnreal/Content/Carla - OUTPUT_VARIABLE CONTENT_GIT_HASH + COMMAND + git log -1 --format=%H + WORKING_DIRECTORY + ${CARLA_WORKSPACE_PATH}/Unreal/CarlaUnreal/Content/Carla + OUTPUT_VARIABLE + CONTENT_GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE ) execute_process( - COMMAND git log -1 --format=%H - WORKING_DIRECTORY ${CARLA_UNREAL_ENGINE_PATH} - OUTPUT_VARIABLE UNREAL_ENGINE_GIT_HASH + COMMAND + git log -1 --format=%H + WORKING_DIRECTORY + ${CARLA_UNREAL_ENGINE_PATH} + OUTPUT_VARIABLE + UNREAL_ENGINE_GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE ) From 31ab42c46e0bd35667618a490f12f5b7e5f916aa Mon Sep 17 00:00:00 2001 From: Blyron Date: Tue, 1 Oct 2024 12:02:42 +0200 Subject: [PATCH 4/4] Write/Read doubles when writing/reading fvector --- .../Source/Carla/Recorder/CarlaRecorderHelpers.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderHelpers.cpp b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderHelpers.cpp index 5d2de8213..980cfa03a 100644 --- a/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderHelpers.cpp +++ b/Unreal/CarlaUnreal/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderHelpers.cpp @@ -37,9 +37,9 @@ std::string GetRecorderFilename(std::string Filename) // write binary data from FVector void WriteFVector(std::ostream &OutFile, const FVector &InObj) { - WriteValue(OutFile, InObj.X); - WriteValue(OutFile, InObj.Y); - WriteValue(OutFile, InObj.Z); + WriteValue(OutFile, InObj.X); + WriteValue(OutFile, InObj.Y); + WriteValue(OutFile, InObj.Z); } // write binary data from FTransform @@ -67,9 +67,9 @@ void WriteFString(std::ostream &OutFile, const FString &InObj) // read binary data to FVector void ReadFVector(std::istream &InFile, FVector &OutObj) { - ReadValue(InFile, OutObj.X); - ReadValue(InFile, OutObj.Y); - ReadValue(InFile, OutObj.Z); + ReadValue(InFile, OutObj.X); + ReadValue(InFile, OutObj.Y); + ReadValue(InFile, OutObj.Z); } // read binary data to FTransform