carla/Util/BuildTools/BuildOSM2ODR.bat

164 lines
5.3 KiB
Batchfile
Raw Normal View History

@echo off
setlocal enabledelayedexpansion
rem BAT script that creates the library for conversion from OSM to OpenDRIVE (carla.org).
rem Run it through a cmd with the x64 Visual C++ Toolset enabled.
set LOCAL_PATH=%~dp0
set FILE_N=-[%~n0]:
rem Print batch params (debug purpose)
echo %FILE_N% [Batch params]: %*
rem ============================================================================
rem -- Parse arguments ---------------------------------------------------------
rem ============================================================================
2020-07-28 17:29:06 +08:00
set DOC_STRING=Build LibCarla.
2021-03-15 17:33:39 +08:00
set USAGE_STRING=Usage: %FILE_N% [-h^|--help] [--rebuild] [--build] [--clean] [--no-pull]
2020-07-28 17:29:06 +08:00
set REMOVE_INTERMEDIATE=false
set BUILD_OSM2ODR=false
2021-03-15 17:33:39 +08:00
set GIT_PULL=true
Digital Twins 0.2 version (#6768) * Bitmap sent and drawn in widget texture with bugs * Map bitmap shown on widget * Concated meshes generated in the same lane to avoid errors during simplification * Navigation added to widget * Avoid Simplify to remove border vertices and try to parallel assets creation process * Road Generation 0.1 version ready * Removing Engine Association, Formatting CarlaTools Build dependencies * Change container type of generated procedural mesh componetns to be supported by UPROPERTY * Fixed indices jumping by two * Added in separate thread junctions generation * Started dynamic database creation * Dynamic database creation temporally removed * First step of merge. Coords of bottom left corner and top right corner * Libraries added to build system * Git ignore for osmrenderer to avoid ThirdParties directory to be tracked * Lat and Lon coords for corners sent from server to client * Transformed to local coords meshes' vertices' coords * Coords format error fixed * Saving xodr and osm files inside of OpenDrive folder * Widget fixed * UI design improved * WIP Windows build system for osm-world-renderer * Socket implementation replaced by boost asio framework in osmrenderer * Added multithreaded simplification of meshes * Build system adapted to wndows * Headers fixed to avoid windows specific heraders compilation * Remove warnings * Added widget to import building from houdini * Added origin latitude and longituda to OSM to OpenDRIVE conversion functions. Fixed Houdini importer widgets. * Add Houdini plugin download to the build system * Moved houdini blueprint. Houdini plugin now dowloads by default * Added houdini download for windows * OpenDriveToMap Now is a UOBject instead of widget * Added Lane mark generation. * Roads materials and distance field scale set to 0 * M_PI macro fixed for windows osm-renderer build system * Added Lane Marking generation * Fixed compilation issue related with std pair non copyable lane * Fix bug where different lanes were concating. Fix bug where end of roadmark was creating an artifact * Lanes Marks material assignation * Fix compilation issue and reading from not valid memory crash * Middle Lane mark duplication bug fixed - temp solution * Added bumps along road * Adding marchingcubes library and added to create junctions * Added junctions generations using marching cube and smoothed * Fixed linux compilation and removed couple warnings * Using previous algorithim for two road connections * Code cleanup * Remove debug state * Format Files * Format third parties files * Spaces removal * Fix code format * Added spawnning for trees * New branch to don`t loose modifications in code * Removing unnecesary spaces * Set trees for designer * Tag static mesh actor from road type * One tile with landscape and road cut * Changed format of For * WidgetCreated * Widget progress * LevelCreator Update * Folder for basicParameters in father map * Father map from template * Terrain mesh generated from noise and road mask Road mask not applied * Assign SubLevel by position * Changed to static functions * StrigUpdate * Added missing UFUNCTIONS * Trying to move Houdini actors to tiles * Meshes from Houdini to Tiles * Number of X and Y tiles exposed * Modify to new functions * Modifying code to create a new variable-offset and table to ingest blueprints * Update assignTile Function * Updating widget and cpp file to relocate meshes * Update Widget and create local copy of OpenDriveToMap * Added planes as landscape * RoadImported fixed * Simplification done in UE side * Update Houdini pipeline * Fixed osmrenderer compilation for windows * Generate landscape and set materials * Generate UVs for lane meshes. Generate Normals and Tangets for lane meshes * Delete unnecesary files * Widget updated * Exposing different variables to BPs * Update Assets * Asset path names fixed * Fixed height for misc objects, set default landscape * Rotate Light boxes * Adding OSM Importer plugin * Fixed normals on sidewalks * Update adding buildings plugin * Adding missing BP * Update * Fix BP_Instanced * Update OSMImporter * Creating BP_BuildingCreator * LevelCreator Fixed * Update building asset creation * If def add for osm renderer * Building block variation and styles * Updated values and generation for demo3 * Fix Widget * Changed unreal FSocket for boost sockets. Fixed road position errors * Update building creation * Updated Building Height * Fixing line colors * Added Planes in missing stuff * Update for meshes * Update deformation, avoid creation of individual buildings and add check for deformation * Deleted unnecesary files * New branch to work on building generation * Added shorts walls and roofs * Improve triangulation of polygons using UE * Fixing pipeline * Disabling shadows for roads and terrain * Updated default values for BP_Opendrivetomap * Updated OpenDriveToMap * Use Editor world instead of GetWorld * Added HTTP module * Change customfiledownloader API * Adding debuginformation * Using OpenDriveToMapObject * Adding Debug stuff * Expose Buildings names in ue4 * Remove from root when generation finished * Adding Slopes to building generation * Table update * Set pivot point at centre of building and Set use of material instances * Updating Buildings plane stuff * Fixing walls for building generator * Update data table * Updated road generation * Update DT * Update Origin of map and set moving for large map * Remove logs prepare blueprints for getting new info * Update slope fix and material for slopes * Updated Digital Twins for 12/06 * Added direct URL support * Avoid some crashes and improve QoL * Height fix * Tried to expose largemap in tick * New vegetation scatter tool * Added Full largemap support * Edit building levels in some type of levels * Updated static meshes instead of procedural meshes * Updated building generation and reduced logs * Vegetation tool into landscape pipeline * Demo ready for digital twins * Automated download of plugin * Update linux build script for UE4 Plugins * Disable sidewalks in junctions * Re enable sidewalksin crossing lanes * Removed asserts added checks to avoid generation of sidewalks on road * Optimizations for VRAM * Move actors slowly to sub levels * Added optimizations and support for smaller or bigger maps in tiles, modified TileSize * Garage and shed styles * Update generation stages * Update garage and shed parameters * Changed method generation to tile by tile * Fixed memory leak and UOpenDriveToMap is a uobject now * Fixed tile by tile generation * Added Heightmap support to map gen * last update * Commandlet generation working * Merge finished * Update DefaultEngine.ini to rever default rhi * Clean up HoudiniImporterWidget.cpp * Add with editor and make editor only code * Setup dependencies for CarlaTools plugin * Update StreetMap plugin commit and gitignore * Update Content version * Update next content version * Changed based type of OpenDrivetomap * Remove intermediate files if need similar to BuildCarlaUE4.sh * Update order of execution of donwload * Try to run download plugins everytime is used * Update packages sh avoid to delete anything * Fixing setup in windows * Add UE Constructor to Commandlet * More fixes * content version * Update package sh and update * Update Streetmap version * Update dependencies * Update StreetMap commit * Fix typo in gitignore * Update STMap plugin commit * Revert latest changes in windows package script * Update comments --------- Co-authored-by: aollero <aollero@cvc.uab.cat> Co-authored-by: aollero <adriollero@gmail.com> Co-authored-by: Axel <axellopez92@outlook.com> Co-authored-by: marionzki <mnoriegazamora@gmail.com> Co-authored-by: bernatx <bernatx@gmail.com>
2023-10-31 18:24:22 +08:00
set CURRENT_OSM2ODR_COMMIT=1835e1e9538d0778971acc8b19b111834aae7261
set OSM2ODR_BRANCH=aaron/defaultsidewalkwidth
2021-03-15 17:33:39 +08:00
set OSM2ODR_REPO=https://github.com/carla-simulator/sumo.git
2020-07-28 17:29:06 +08:00
:arg-parse
if not "%1"=="" (
if "%1"=="--rebuild" (
set REMOVE_INTERMEDIATE=true
set BUILD_OSM2ODR=true
)
if "%1"=="--build" (
set BUILD_OSM2ODR=true
)
2021-03-15 17:33:39 +08:00
if "%1"=="--no-pull" (
set GIT_PULL=false
)
2020-07-28 17:29:06 +08:00
if "%1"=="--clean" (
set REMOVE_INTERMEDIATE=true
)
if "%1"=="--generator" (
set GENERATOR=%2
shift
)
2020-07-28 17:29:06 +08:00
if "%1"=="-h" (
echo %DOC_STRING%
echo %USAGE_STRING%
GOTO :eof
)
if "%1"=="--help" (
echo %DOC_STRING%
echo %USAGE_STRING%
GOTO :eof
)
shift
goto :arg-parse
)
if %REMOVE_INTERMEDIATE% == false (
if %BUILD_OSM2ODR% == false (
echo Nothing selected to be done.
goto :eof
)
)
rem ============================================================================
rem -- Local Variables ---------------------------------------------------------
rem ============================================================================
rem Set the visual studio solution directory
rem
2020-07-28 16:41:28 +08:00
set OSM2ODR_VSPROJECT_PATH=%INSTALLATION_DIR:/=\%osm2odr-visualstudio\
2021-03-18 16:16:37 +08:00
set OSM2ODR_SOURCE_PATH=%INSTALLATION_DIR:/=\%om2odr-source\
2020-07-28 16:41:28 +08:00
set OSM2ODR_INSTALL_PATH=%ROOT_PATH:/=\%PythonAPI\carla\dependencies\
set OSM2ODR__SERVER_INSTALL_PATH=%ROOT_PATH:/=\%Unreal\CarlaUE4\Plugins\Carla\CarlaDependencies
set CARLA_DEPENDENCIES_FOLDER=%ROOT_PATH:/=\%Unreal\CarlaUE4\Plugins\Carla\CarlaDependencies\
if %GENERATOR% == "" set GENERATOR="Visual Studio 16 2019"
2020-07-28 17:29:06 +08:00
if %REMOVE_INTERMEDIATE% == true (
rem Remove directories
for %%G in (
"%OSM2ODR_INSTALL_PATH%",
) do (
if exist %%G (
echo %FILE_N% Cleaning %%G
rmdir /s/q %%G
)
)
)
2020-07-28 17:29:06 +08:00
rem Build OSM2ODR
if %BUILD_OSM2ODR% == true (
2021-03-15 17:33:39 +08:00
if %GIT_PULL% == true (
if not exist "%OSM2ODR_SOURCE_PATH%" git clone -b %OSM2ODR_BRANCH% %OSM2ODR_REPO% %OSM2ODR_SOURCE_PATH%
cd "%OSM2ODR_SOURCE_PATH%"
git fetch
git checkout %CURRENT_OSM2ODR_COMMIT%
)
if not exist "%OSM2ODR_VSPROJECT_PATH%" mkdir "%OSM2ODR_VSPROJECT_PATH%"
cd "%OSM2ODR_VSPROJECT_PATH%"
echo.%GENERATOR% | findstr /C:"Visual Studio" >nul && (
set PLATFORM=-A x64
) || (
set PLATFORM=
)
cmake -G %GENERATOR% %PLATFORM%^
2020-07-28 17:29:06 +08:00
-DCMAKE_CXX_FLAGS_RELEASE="/MD /MP"^
-DCMAKE_INSTALL_PREFIX="%OSM2ODR_INSTALL_PATH:\=/%"^
-DPROJ_INCLUDE_DIR=%INSTALLATION_DIR:/=\%\proj-install\include^
2021-03-15 17:33:39 +08:00
-DPROJ_LIBRARY=%INSTALLATION_DIR:/=\%\proj-install\lib\proj.lib^
-DXercesC_INCLUDE_DIR=%INSTALLATION_DIR:/=\%\xerces-c-3.2.3-install\include^
-DXercesC_LIBRARY=%INSTALLATION_DIR:/=\%\xerces-c-3.2.3-install\lib\xerces-c.lib^
"%OSM2ODR_SOURCE_PATH%"
2020-07-28 17:29:06 +08:00
if %errorlevel% neq 0 goto error_cmake
cmake --build . --config Release --target install | findstr /V "Up-to-date:"
if %errorlevel% neq 0 goto error_install
copy %OSM2ODR_INSTALL_PATH%\lib\osm2odr.lib %CARLA_DEPENDENCIES_FOLDER%\lib
copy %OSM2ODR_INSTALL_PATH%\include\OSM2ODR.h %CARLA_DEPENDENCIES_FOLDER%\include
2020-07-28 17:29:06 +08:00
)
goto success
rem ============================================================================
rem -- Messages and Errors -----------------------------------------------------
rem ============================================================================
:success
if %BUILD_OSM2ODR% == true echo %FILE_N% OSM2ODR has been successfully installed in "%OSM2ODR_INSTALL_PATH%"!
goto good_exit
:error_cmake
echo.
echo %FILE_N% [ERROR] An error ocurred while executing the cmake.
echo [ERROR] Possible causes:
echo [ERROR] - Make sure "CMake" is installed.
echo [ERROR] - Make sure it is available on your Windows "path".
echo [ERROR] - CMake 3.9.0 or higher is required.
goto bad_exit
:error_install
echo.
echo %FILE_N% [ERROR] An error ocurred while installing using %GENERATOR% Win64.
2020-07-28 17:29:06 +08:00
echo [ERROR] Possible causes:
echo [ERROR] - Make sure you have Visual Studio installed.
echo [ERROR] - Make sure you have the "x64 Visual C++ Toolset" in your path.
echo [ERROR] For example using the "Visual Studio x64 Native Tools Command Prompt",
echo [ERROR] or the "vcvarsall.bat".
goto bad_exit
:good_exit
endlocal
exit /b 0
2020-07-28 17:29:06 +08:00
:bad_exit
endlocal
exit /b %errorlevel%