carla/Util/BuildTools/BuildLibCarla.sh

249 lines
6.8 KiB
Bash
Raw Normal View History

2018-07-04 17:59:59 +08:00
#! /bin/bash
# ==============================================================================
# -- Parse arguments -----------------------------------------------------------
# ==============================================================================
DOC_STRING="Build LibCarla."
USAGE_STRING=$(cat <<- END
Usage: $0 [-h|--help]
Choose one or more build configurations
[--server] Build server-side configuration.
[--client] Build client-side configuration.
and choose one or more build options
[--debug] Build debug targets.
[--release] Build release targets.
Other commands
[--clean] Clean intermediate files.
[--rebuild] Clean and rebuild both configurations.
END
)
2018-07-04 17:59:59 +08:00
REMOVE_INTERMEDIATE=false
BUILD_SERVER=false
BUILD_CLIENT=false
BUILD_OPTION_DEBUG=false
BUILD_OPTION_RELEASE=false
BUILD_OPTION_DUMMY=false
BUILD_RSS_VARIANT=false
Pytorch integration with terramechanics (#5684) * Added sparse map reprsentation * Added pytorch for terramechanics modules * Added saving loading particles in independent thread * Added blank space at the EOF * Added texture creation lambda * Moving function to component * Added input/output architecture for neural network * Filling heightmap with particles data. Adding Logging to debug * Updating Texture data at realtime * Connected 3 stages, using MPC Position to Update and Texture * Added square particle sampling. Added second model input/output scheme. Fixed start up crash. * Added new flags and fixes * Position to update not updating in material but yes in MPC * Fixed coordinate frame issues and crashes * Prepared to follow position in the 1st vehicle in map * Fixed height map alignment * Fixed large map and terrain tiles alignment * Fixed inputs for new model * Added scale factor * Fixed slow read write operations * Bug fixes * Removed debug output * Removed nvidia profinling marks * Preparing merge debug code removed, runtime working by rounding the loading data properly * Made pytorch optional module * Added TRACE_CPUPROFILER_EVENT_SCOPE to Update and UpdateTexture * Added optional pytorch conditions and macros * Removed static Path * Fixed #ifdef clause. Added missing include. * Deformation on vehicle working. Ready to start optimisation * First optimsation done. Heightmap per Tile * Updated tiles'heightmap to make their size relative to texture and tilesize * Fixed slow frames. Added functionality * Removed unecessary library links * Fixed pytorch link * Limited search to relevant tiles * Added multithreaded particle search. Fixed cuda architectures compilation * Deformation plane added * Added missing resources * Updated particle movement update methods * Spawn on runtime deformation plane * Added cachemap lock when initializing a region * Added UHeightMapDataAsset to hold heightmap data * Fixing some settings Co-authored-by: Aaron <samaniegoaaron112@gmail.com> Co-authored-by: bernatx <bernatx@gmail.com>
2022-09-23 21:39:09 +08:00
USE_PYTORCH=false
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
USE_ROS2=false
2018-07-04 17:59:59 +08:00
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
OPTS=`getopt -o h --long help,rebuild,server,client,clean,debug,release,rss,pytorch,carsim,ros2 -n 'parse-options' -- "$@"`
2018-07-04 17:59:59 +08:00
eval set -- "$OPTS"
2020-10-01 22:35:12 +08:00
while [[ $# -gt 0 ]]; do
2018-07-04 17:59:59 +08:00
case "$1" in
--rebuild )
REMOVE_INTERMEDIATE=true;
BUILD_SERVER=true;
BUILD_CLIENT=true;
BUILD_OPTION_DEBUG=true;
BUILD_OPTION_RELEASE=true;
2018-07-04 17:59:59 +08:00
shift ;;
--server )
BUILD_SERVER=true;
shift ;;
--client )
BUILD_CLIENT=true;
shift ;;
--clean )
REMOVE_INTERMEDIATE=true;
BUILD_OPTION_DUMMY=true;
shift ;;
--debug )
BUILD_OPTION_DEBUG=true;
shift ;;
--release )
BUILD_OPTION_RELEASE=true;
2018-07-04 17:59:59 +08:00
shift ;;
Pytorch integration with terramechanics (#5684) * Added sparse map reprsentation * Added pytorch for terramechanics modules * Added saving loading particles in independent thread * Added blank space at the EOF * Added texture creation lambda * Moving function to component * Added input/output architecture for neural network * Filling heightmap with particles data. Adding Logging to debug * Updating Texture data at realtime * Connected 3 stages, using MPC Position to Update and Texture * Added square particle sampling. Added second model input/output scheme. Fixed start up crash. * Added new flags and fixes * Position to update not updating in material but yes in MPC * Fixed coordinate frame issues and crashes * Prepared to follow position in the 1st vehicle in map * Fixed height map alignment * Fixed large map and terrain tiles alignment * Fixed inputs for new model * Added scale factor * Fixed slow read write operations * Bug fixes * Removed debug output * Removed nvidia profinling marks * Preparing merge debug code removed, runtime working by rounding the loading data properly * Made pytorch optional module * Added TRACE_CPUPROFILER_EVENT_SCOPE to Update and UpdateTexture * Added optional pytorch conditions and macros * Removed static Path * Fixed #ifdef clause. Added missing include. * Deformation on vehicle working. Ready to start optimisation * First optimsation done. Heightmap per Tile * Updated tiles'heightmap to make their size relative to texture and tilesize * Fixed slow frames. Added functionality * Removed unecessary library links * Fixed pytorch link * Limited search to relevant tiles * Added multithreaded particle search. Fixed cuda architectures compilation * Deformation plane added * Added missing resources * Updated particle movement update methods * Spawn on runtime deformation plane * Added cachemap lock when initializing a region * Added UHeightMapDataAsset to hold heightmap data * Fixing some settings Co-authored-by: Aaron <samaniegoaaron112@gmail.com> Co-authored-by: bernatx <bernatx@gmail.com>
2022-09-23 21:39:09 +08:00
--pytorch )
USE_PYTORCH=true;
shift ;;
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
--ros2 )
USE_ROS2=true;
shift ;;
--rss )
BUILD_RSS_VARIANT=true;
shift ;;
2018-07-04 17:59:59 +08:00
-h | --help )
echo "$DOC_STRING"
echo "$USAGE_STRING"
exit 1
;;
* )
shift ;;
2018-07-04 17:59:59 +08:00
esac
done
source $(dirname "$0")/Environment.sh
function get_source_code_checksum {
local EXCLUDE='*__pycache__*'
find "${LIBCARLA_ROOT_FOLDER}"/* \! -path "${EXCLUDE}" -print0 | sha1sum | awk '{print $1}'
}
2018-07-04 17:59:59 +08:00
if ! { ${REMOVE_INTERMEDIATE} || ${BUILD_SERVER} || ${BUILD_CLIENT}; }; then
fatal_error "Nothing selected to be done."
fi
if ! { ${BUILD_OPTION_DUMMY} || ${BUILD_OPTION_DEBUG} || ${BUILD_OPTION_RELEASE} ; }; then
fatal_error "Choose --debug and/or --release."
fi
2018-07-04 17:59:59 +08:00
# ==============================================================================
# -- Clean intermediate files --------------------------------------------------
# ==============================================================================
if ${REMOVE_INTERMEDIATE} ; then
log "Cleaning intermediate files and folders."
rm -Rf ${LIBCARLA_BUILD_SERVER_FOLDER}* ${LIBCARLA_BUILD_CLIENT_FOLDER}*
Pytorch integration with terramechanics (#5684) * Added sparse map reprsentation * Added pytorch for terramechanics modules * Added saving loading particles in independent thread * Added blank space at the EOF * Added texture creation lambda * Moving function to component * Added input/output architecture for neural network * Filling heightmap with particles data. Adding Logging to debug * Updating Texture data at realtime * Connected 3 stages, using MPC Position to Update and Texture * Added square particle sampling. Added second model input/output scheme. Fixed start up crash. * Added new flags and fixes * Position to update not updating in material but yes in MPC * Fixed coordinate frame issues and crashes * Prepared to follow position in the 1st vehicle in map * Fixed height map alignment * Fixed large map and terrain tiles alignment * Fixed inputs for new model * Added scale factor * Fixed slow read write operations * Bug fixes * Removed debug output * Removed nvidia profinling marks * Preparing merge debug code removed, runtime working by rounding the loading data properly * Made pytorch optional module * Added TRACE_CPUPROFILER_EVENT_SCOPE to Update and UpdateTexture * Added optional pytorch conditions and macros * Removed static Path * Fixed #ifdef clause. Added missing include. * Deformation on vehicle working. Ready to start optimisation * First optimsation done. Heightmap per Tile * Updated tiles'heightmap to make their size relative to texture and tilesize * Fixed slow frames. Added functionality * Removed unecessary library links * Fixed pytorch link * Limited search to relevant tiles * Added multithreaded particle search. Fixed cuda architectures compilation * Deformation plane added * Added missing resources * Updated particle movement update methods * Spawn on runtime deformation plane * Added cachemap lock when initializing a region * Added UHeightMapDataAsset to hold heightmap data * Fixing some settings Co-authored-by: Aaron <samaniegoaaron112@gmail.com> Co-authored-by: bernatx <bernatx@gmail.com>
2022-09-23 21:39:09 +08:00
rm -Rf ${LIBCARLA_BUILD_PYTORCH_FOLDER}* ${LIBCARLA_BUILD_PYTORCH_FOLDER}*
2018-07-04 17:59:59 +08:00
rm -Rf ${LIBCARLA_INSTALL_SERVER_FOLDER} ${LIBCARLA_INSTALL_CLIENT_FOLDER}
fi
# ==============================================================================
# -- Define build function -----------------------------------------------------
2018-07-04 17:59:59 +08:00
# ==============================================================================
# Build LibCarla for the given configuration.
#
# usage: build_libcarla {Server,Client,ClientRSS} {Debug,Release}
#
function build_libcarla {
CMAKE_EXTRA_OPTIONS=''
if [ $1 == Server ] ; then
M_TOOLCHAIN=${LIBCPP_TOOLCHAIN_FILE}
M_BUILD_FOLDER=${LIBCARLA_BUILD_SERVER_FOLDER}.$(echo "$2" | tr '[:upper:]' '[:lower:]')
M_INSTALL_FOLDER=${LIBCARLA_INSTALL_SERVER_FOLDER}
elif [ $1 == Client ] ; then
M_TOOLCHAIN=${LIBSTDCPP_TOOLCHAIN_FILE}
M_BUILD_FOLDER=${LIBCARLA_BUILD_CLIENT_FOLDER}.$(echo "$2" | tr '[:upper:]' '[:lower:]')
M_INSTALL_FOLDER=${LIBCARLA_INSTALL_CLIENT_FOLDER}
Pytorch integration with terramechanics (#5684) * Added sparse map reprsentation * Added pytorch for terramechanics modules * Added saving loading particles in independent thread * Added blank space at the EOF * Added texture creation lambda * Moving function to component * Added input/output architecture for neural network * Filling heightmap with particles data. Adding Logging to debug * Updating Texture data at realtime * Connected 3 stages, using MPC Position to Update and Texture * Added square particle sampling. Added second model input/output scheme. Fixed start up crash. * Added new flags and fixes * Position to update not updating in material but yes in MPC * Fixed coordinate frame issues and crashes * Prepared to follow position in the 1st vehicle in map * Fixed height map alignment * Fixed large map and terrain tiles alignment * Fixed inputs for new model * Added scale factor * Fixed slow read write operations * Bug fixes * Removed debug output * Removed nvidia profinling marks * Preparing merge debug code removed, runtime working by rounding the loading data properly * Made pytorch optional module * Added TRACE_CPUPROFILER_EVENT_SCOPE to Update and UpdateTexture * Added optional pytorch conditions and macros * Removed static Path * Fixed #ifdef clause. Added missing include. * Deformation on vehicle working. Ready to start optimisation * First optimsation done. Heightmap per Tile * Updated tiles'heightmap to make their size relative to texture and tilesize * Fixed slow frames. Added functionality * Removed unecessary library links * Fixed pytorch link * Limited search to relevant tiles * Added multithreaded particle search. Fixed cuda architectures compilation * Deformation plane added * Added missing resources * Updated particle movement update methods * Spawn on runtime deformation plane * Added cachemap lock when initializing a region * Added UHeightMapDataAsset to hold heightmap data * Fixing some settings Co-authored-by: Aaron <samaniegoaaron112@gmail.com> Co-authored-by: bernatx <bernatx@gmail.com>
2022-09-23 21:39:09 +08:00
elif [ $1 == Pytorch ] ; then
M_TOOLCHAIN=${LIBSTDCPP_TOOLCHAIN_FILE}
M_BUILD_FOLDER=${LIBCARLA_BUILD_PYTORCH_FOLDER}.$(echo "$2" | tr '[:upper:]' '[:lower:]')
M_INSTALL_FOLDER=${LIBCARLA_INSTALL_SERVER_FOLDER}
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
elif [ $1 == ros2 ] ; then
M_TOOLCHAIN=${LIBSTDCPP_TOOLCHAIN_FILE}
M_BUILD_FOLDER=${LIBCARLA_FASTDDS_FOLDER}.$(echo "$2" | tr '[:upper:]' '[:lower:]')
M_INSTALL_FOLDER=${LIBCARLA_INSTALL_SERVER_FOLDER}
elif [ $1 == ClientRSS ] ; then
BUILD_TYPE='Client'
M_TOOLCHAIN=${LIBSTDCPP_TOOLCHAIN_FILE}
M_BUILD_FOLDER=${LIBCARLA_BUILD_CLIENT_FOLDER}.rss.$(echo "$2" | tr '[:upper:]' '[:lower:]')
M_INSTALL_FOLDER=${LIBCARLA_INSTALL_CLIENT_FOLDER}
2023-11-14 18:22:08 +08:00
CMAKE_EXTRA_OPTIONS="${CMAKE_EXTRA_OPTIONS:+${CMAKE_EXTRA_OPTIONS} }-DBUILD_RSS_VARIANT=ON -DADRSS_INSTALL_DIR=${CARLA_BUILD_FOLDER}/ad-rss-4.5.3/install"
else
fatal_error "Invalid build configuration \"$1\""
fi
2018-07-04 17:59:59 +08:00
if [ $2 == Debug ] ; then
M_DEBUG=ON
M_RELEASE=OFF
elif [ $2 == Release ] ; then
M_DEBUG=OFF
M_RELEASE=ON
else
fatal_error "Invalid build option \"$2\""
fi
2018-07-04 17:59:59 +08:00
log "Building LibCarla \"$1.$2\" configuration."
mkdir -p ${M_BUILD_FOLDER}
pushd "${M_BUILD_FOLDER}" >/dev/null
2018-07-04 17:59:59 +08:00
CHECKSUM_FILE=checksum.txt
if [ ! -f "${CHECKSUM_FILE}" ] ; then
NEEDS_CMAKE=true
elif [ "$(cat ${CHECKSUM_FILE})" != "$(get_source_code_checksum)" ] ; then
log "Re-running cmake, some files were added or removed."
NEEDS_CMAKE=true
else
NEEDS_CMAKE=false
fi
if ${NEEDS_CMAKE} ; then
2018-07-04 17:59:59 +08:00
cmake \
-G "Eclipse CDT4 - Ninja" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-$1} \
-DLIBCARLA_BUILD_DEBUG=${M_DEBUG} \
-DLIBCARLA_BUILD_RELEASE=${M_RELEASE} \
-DCMAKE_TOOLCHAIN_FILE=${M_TOOLCHAIN} \
-DCMAKE_INSTALL_PREFIX=${M_INSTALL_FOLDER} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
${CMAKE_EXTRA_OPTIONS} \
2018-07-04 17:59:59 +08:00
${CARLA_ROOT_FOLDER}
get_source_code_checksum > ${CHECKSUM_FILE}
2018-07-04 17:59:59 +08:00
fi
ninja
ninja install | grep -v "Up-to-date:"
popd >/dev/null
}
2018-07-04 17:59:59 +08:00
# ==============================================================================
# -- Build all possible configurations -----------------------------------------
2018-07-04 17:59:59 +08:00
# ==============================================================================
if { ${BUILD_SERVER} && ${BUILD_OPTION_DEBUG}; }; then
2018-07-04 17:59:59 +08:00
build_libcarla Server Debug
2018-07-04 17:59:59 +08:00
fi
2018-07-04 17:59:59 +08:00
if { ${BUILD_SERVER} && ${BUILD_OPTION_RELEASE}; }; then
2018-07-04 17:59:59 +08:00
build_libcarla Server Release
Pytorch integration with terramechanics (#5684) * Added sparse map reprsentation * Added pytorch for terramechanics modules * Added saving loading particles in independent thread * Added blank space at the EOF * Added texture creation lambda * Moving function to component * Added input/output architecture for neural network * Filling heightmap with particles data. Adding Logging to debug * Updating Texture data at realtime * Connected 3 stages, using MPC Position to Update and Texture * Added square particle sampling. Added second model input/output scheme. Fixed start up crash. * Added new flags and fixes * Position to update not updating in material but yes in MPC * Fixed coordinate frame issues and crashes * Prepared to follow position in the 1st vehicle in map * Fixed height map alignment * Fixed large map and terrain tiles alignment * Fixed inputs for new model * Added scale factor * Fixed slow read write operations * Bug fixes * Removed debug output * Removed nvidia profinling marks * Preparing merge debug code removed, runtime working by rounding the loading data properly * Made pytorch optional module * Added TRACE_CPUPROFILER_EVENT_SCOPE to Update and UpdateTexture * Added optional pytorch conditions and macros * Removed static Path * Fixed #ifdef clause. Added missing include. * Deformation on vehicle working. Ready to start optimisation * First optimsation done. Heightmap per Tile * Updated tiles'heightmap to make their size relative to texture and tilesize * Fixed slow frames. Added functionality * Removed unecessary library links * Fixed pytorch link * Limited search to relevant tiles * Added multithreaded particle search. Fixed cuda architectures compilation * Deformation plane added * Added missing resources * Updated particle movement update methods * Spawn on runtime deformation plane * Added cachemap lock when initializing a region * Added UHeightMapDataAsset to hold heightmap data * Fixing some settings Co-authored-by: Aaron <samaniegoaaron112@gmail.com> Co-authored-by: bernatx <bernatx@gmail.com>
2022-09-23 21:39:09 +08:00
if ${USE_PYTORCH} ; then
build_libcarla Pytorch Release
fi
2018-07-04 17:59:59 +08:00
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
if ${USE_ROS2} ; then
build_libcarla ros2 Release
fi
fi
2018-07-04 17:59:59 +08:00
CLIENT_VARIANT='Client'
if [ $BUILD_RSS_VARIANT == true ] ; then
CLIENT_VARIANT='ClientRSS'
fi
if { ${BUILD_CLIENT} && ${BUILD_OPTION_DEBUG}; }; then
2018-07-04 17:59:59 +08:00
build_libcarla ${CLIENT_VARIANT} Debug
2018-07-04 17:59:59 +08:00
fi
if { ${BUILD_CLIENT} && ${BUILD_OPTION_RELEASE}; }; then
build_libcarla ${CLIENT_VARIANT} Release
2018-07-04 17:59:59 +08:00
fi
# ==============================================================================
# -- ...and we are done --------------------------------------------------------
# ==============================================================================
log "Success!"