Skip to content

Commit c3e54fd

Browse files
author
Bernd Gassmann
committed
In conjunction with ROS2 use -ansimalloc for Unreal
1 parent 88191eb commit c3e54fd

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Util/BuildTools/BuildCarlaUE4.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ USE_UNITY=true
1919
USE_ROS2=false
2020

2121
EDITOR_FLAGS=""
22+
ROS2_EDITOR_FLAGS=""
23+
2224

2325
GDB=
2426
RHI="-vulkan"
@@ -70,6 +72,9 @@ while [[ $# -gt 0 ]]; do
7072
shift ;;
7173
--ros2 )
7274
USE_ROS2=true;
75+
# In conjuncation with ROS2 MallocBinned has problems:
76+
# enforce using AnsiMalloc calls (see https://forums.unrealengine.com/t/dealing-with-allocator-mismatches-with-external-libraries/1416830)
77+
ROS2_EDITOR_FLAGS="-ansimalloc"
7378
shift ;;
7479
--no-unity )
7580
USE_UNITY=false
@@ -208,7 +213,7 @@ fi
208213
if ${LAUNCH_UE4_EDITOR} ; then
209214

210215
log "Launching UE4Editor..."
211-
${GDB} ${UE4_ROOT}/Engine/Binaries/Linux/UE4Editor "${PWD}/CarlaUE4.uproject" ${RHI} ${EDITOR_FLAGS}
216+
${GDB} ${UE4_ROOT}/Engine/Binaries/Linux/UE4Editor "${PWD}/CarlaUE4.uproject" ${RHI} ${EDITOR_FLAGS} ${ROS2_EDITOR_FLAGS}
212217

213218
else
214219

Util/CreateDebian.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ cat >> CarlaUE4.sh <<EOF
7474
"/opt/carla-simulator/CarlaUE4/Binaries/Linux/CarlaUE4-Linux-Shipping" CarlaUE4 \$@
7575
EOF
7676

77+
# Updating CarlaUE4ROS2.sh script
78+
rm CarlaUE4ROS2.sh
79+
cat >> CarlaUE4ROS2.sh <<EOF
80+
#!/bin/sh
81+
"/opt/carla-simulator/CarlaUE4/Binaries/Linux/CarlaUE4-Linux-Shipping" CarlaUE4 -ansimalloc \$@
82+
EOF
83+
7784
# Making debian package to install Carla in /opt folder
7885
rm Makefile
7986

0 commit comments

Comments
 (0)