carla/Util/InstallersWin/install_fastDDS.bat

190 lines
5.8 KiB
Batchfile
Raw Normal View History

Ros2 (#6862) * Adding ROS2 manager * Trying to compile fastDDS in windows, but have problems with dependencies * Camera sensors connected to ROS2, dependencies disabled temporaly * Including enum with sensors list * adding GNSS sensor capture * adding IMU sensor capture * adding DVS sensor capture * adding Lidar sensor capture * adding SemanticLidar and Radar capture * adding ObstacleDetector and some fixes * modify cmakelists, failed to find libatomic * fixed libatomic * compile fast-dds with libc++ * fixed compliation fast dds with libcxx * linked carla with fastdds * Fixed Fast-DDS lib Now its compiled to a intermediate lib with a bridge so libstdc++ can be used * moved all ros2 deps to ros2 folder renamed types from .cxx to .cpp * Finally FastDDS compiled and working inside CARLA * exposed publish function for testing * fixed code style * make ros2 optional * make ros2 optional * Added defines to compile ROS2 code * ros image publisher working * deleted some buffer copies * Added more topics and ROS2 types * Adding sensor Transform as argument, and add function to send buffer or serialize and send buffer * Removing empty buffer from DVS sensor * fixed lidar publisher * fixed lidar publisher * Fix buffer of RGB in ROS2 * adding timestamp of each frame into ROS2 manager * sending timestamps with frame to ROS2 * put apart timestamp from frame counter call * adding BufferView to share buffers * adding BufferView to share buffers * adding ros_name attribute to all actors * mapping ros_name for each actor * ROS2 is now published in a different thread Publishers now can be created on demand and be reused Added subscriber for ego vehicle Fixed build scripts * forgot to add this fix * add ros2 to windows scripts * fixed default ros topic names * fix topic name duplication * Adding functions for enable/disable sensors publishing without listen to it * Added Camera info and ROI types RGB Camera now publishes in both topics * move camera info immutable data to the constructor * Publish transform for all topics Create Camera DVS subtopics Fixed bug with Lidar * Added flip Y to semantic lidar * Adding callbacks for subscribers from Unreal * Adding camera info to ROS2 (resolution and FOV) * Finished ROS2 naming from python * Fixed bug with ros names * Delete topics when deleting the sensors * setting the rosname same as default no longer rewrites it * ROS transform fix * Added all camera topics with the image and camera info Added vehicle control Added clock publisher * Change ros2 topic names for vehicle subscriber and clock publisher * Rename vehicle control ros2 topic name * rename subscriber type to CarlaEgoVehicleControl * Fix semantic lidar default ros name Fix sizeof the semantic lidar data buffer * Changed controller stored as string to pointer * Back to previous version for default hero ros name Removed debug prints * Remvoe callback when ego publisher disconnects * Serializing DVS data before sending to ROS * dvs camera image and lidar * DVS Pointcloud publishing * Remove unnecessary fields * Send local transforms to ros * avoid transform recalculation if not needed * Optical Flow Camera fixed * Set fixed branch for Fast-DDS to avoid cmake version change issues * Finally Working on package * Fix style from FastDDS auto generated files * Added ros2 to ubuntu in jenkins * removed ros2 from jenkins, test * restore ros2 in jenkins * fix copy shareds, and removed server dependency from libcarla * test installing the fastdds dependencies in jenkins * move installing deps to separate stage * removed install deps * Fixing test_benchmark_streaming * Fixed imu orientation and camera info data * Fixing test_benchmark_streaming.cpp with BufferView * Removing DEBUG_ONLY() * publish collision sensor * Fixing unit-tests with the new BufferView * camera info is set once * Fix echo camera info * fix transform rotation * Fixing ros_name attribute creation * fixed camera info and region of interest publish * fix IMU compass * Forgot to add ros2 flag to jenkins package --------- Co-authored-by: bernatx <bernatx@gmail.com>
2023-11-06 19:34:07 +08:00
@echo off
setlocal
rem BAT script that downloads and installs Fast-DDS library
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 ============================================================================
set DEL_SRC=false
:arg-parse
if not "%1"=="" (
if "%1"=="--build-dir" (
set BUILD_DIR=%~dpn2
shift
)
if "%1"=="--delete-src" (
set DEL_SRC=true
)
shift
goto :arg-parse
)
rem If not set set the build dir to the current dir
if "%BUILD_DIR%" == "" set BUILD_DIR=%~dp0
if not "%BUILD_DIR:~-1%"=="\" set BUILD_DIR=%BUILD_DIR%\
set FASTDDS_SRC=fastDDS-src
set FASTDDS_SRC_DIR=%BUILD_DIR%%FASTDDS_SRC%\
set FASTDDS_INSTALL=fastDDS-install
set FASTDDS_INSTALL_DIR=%BUILD_DIR%%FASTDDS_INSTALL%\
set FASTDDS_BUILD_DIR=%FASTDDS_SRC_DIR%build\
set FASTDDS_BASENAME=%FASTDDS_SRC%
if exist "%FASTDDS_INSTALL_DIR%" (
goto already_build
)
if not exist "%FASTDDS_SRC_DIR%" (
echo %FILE_N% Cloning "Fast-DDS"
call git clone https://github.com/eProsima/Fast-DDS.git "%FASTDDS_SRC_DIR:~0,-1%"
call git submodule init
call git submodule update
if %errorlevel% neq 0 goto error_git
) else (
echo %FILE_N% Not cloning "Fast-DDS" because already exists a folder called "%FASTDDS_SRC%".
)
echo Compiling fastCDR dependency...
if not exist "%FASTDDS_SRC_DIR%/thirdparty/fastcdr/build" (
echo %FILE_N% Creating "%FASTDDS_SRC_DIR%/thirdparty/fastcdr/build"
cd "%FASTDDS_SRC_DIR%/thirdparty/fastcdr"
mkdir build
cd ../../
)
cd "%FASTDDS_SRC_DIR%/thirdparty/fastcdr/build"
echo %FILE_N% Generating build...
cmake .. -G "Visual Studio 16 2019" -A x64^
-DCMAKE_BUILD_TYPE=Release^
-DCMAKE_CXX_FLAGS_RELEASE="/MD /MP"^
-DCMAKE_INSTALL_PREFIX="%FASTDDS_INSTALL_DIR:\=/%"^
-DCMAKE_CXX_FLAGS=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
if %errorlevel% neq 0 goto error_cmake
echo %FILE_N% Building...
cmake --build . --config Release --target install
if errorlevel neq 0 goto error_install
cd ../../..
@REM echo Compiling asio dependency...
@REM if not exist "%FASTDDS_SRC_DIR%/thirdparty/asio/asio/build" (
@REM echo %FILE_N% Creating "%FASTDDS_SRC_DIR%/thirdparty/asio/asio/build"
@REM cd "%FASTDDS_SRC_DIR%/thirdparty/asio/asio"
@REM mkdir build
@REM cd ../../
@REM )
@REM cd "%FASTDDS_SRC_DIR%/thirdparty/asio/asio/build"
@REM echo %FILE_N% Generating build...
@REM cmake .. -G "Visual Studio 16 2019" -A x64^
@REM -DCMAKE_BUILD_TYPE=Release^
@REM -DCMAKE_CXX_FLAGS_RELEASE="/MD /MP"^
@REM -DCMAKE_INSTALL_PREFIX="%FASTDDS_INSTALL_DIR:\=/%"^
@REM -DCMAKE_CXX_FLAGS=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
@REM if %errorlevel% neq 0 goto error_cmake
@REM echo %FILE_N% Building...
@REM cmake --build . --config Release --target install
@REM if errorlevel neq 0 goto error_install
@REM cd ../../../..
if not exist "%FASTDDS_BUILD_DIR%" (
echo %FILE_N% Creating "%FASTDDS_BUILD_DIR%"
mkdir "%FASTDDS_BUILD_DIR%"
)
cd "%FASTDDS_BUILD_DIR%"
echo %FILE_N% Generating build...
cmake .. -G "Visual Studio 16 2019" -A x64^
-DCMAKE_BUILD_TYPE=Release^
-DCMAKE_CXX_FLAGS_RELEASE="/MD /MP"^
-DCMAKE_INSTALL_PREFIX="%FASTDDS_INSTALL_DIR:\=/%"^
-DCMAKE_CXX_FLAGS=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING^
"%FASTDDS_SRC_DIR%"
if %errorlevel% neq 0 goto error_cmake
echo %FILE_N% Building...
cmake --build . --config Release --target install
if errorlevel neq 0 goto error_install
rem Remove the downloaded Fast-DDS source because is no more needed
if %DEL_SRC% == true (
rd /s /q "%FASTDDS_SRC_DIR%"
)
goto success
rem ============================================================================
rem -- Messages and Errors -----------------------------------------------------
rem ============================================================================
:success
echo.
echo %FILE_N% "Fast-DDS" has been successfully installed in "%FASTDDS_INSTALL_DIR%"!
goto good_exit
:already_build
echo %FILE_N% A "Fast-DDS" installation already exists.
echo %FILE_N% Delete "%FASTDDS_INSTALL_DIR%" if you want to force a rebuild.
goto good_exit
:error_git
echo.
echo %FILE_N% [GIT ERROR] An error ocurred while executing the git.
echo %FILE_N% [GIT ERROR] Possible causes:
echo %FILE_N% - Make sure "git" is installed.
echo %FILE_N% - Make sure it is available on your Windows "path".
goto bad_exit
:error_cmake
echo.
echo %FILE_N% [CMAKE ERROR] An error ocurred while executing the cmake.
echo %FILE_N% [CMAKE ERROR] Possible causes:
echo %FILE_N% - Make sure "CMake" is installed.
echo %FILE_N% - Make sure it is available on your Windows "path".
goto bad_exit
:error_install
echo.
echo %FILE_N% [Visual Studio 16 2019 Win64 ERROR] An error ocurred while installing using Visual Studio 16 2019 Win64.
echo %FILE_N% [Visual Studio 16 2019 Win64 ERROR] Possible causes:
echo %FILE_N% - Make sure you have Visual Studio installed.
echo %FILE_N% - Make sure you have the "x64 Visual C++ Toolset" in your path.
echo %FILE_N% For example using the "Visual Studio x64 Native Tools Command Prompt",
echo %FILE_N% or the "vcvarsall.bat".
goto bad_exit
:good_exit
echo %FILE_N% Exiting...
endlocal & set install_recast=%FASTDDS_INSTALL_DIR%
exit /b 0
:bad_exit
if exist "%FASTDDS_INSTALL_DIR%" rd /s /q "%FASTDDS_INSTALL_DIR%"
echo %FILE_N% Exiting with error...
endlocal
exit /b %errorlevel%