필자의 경우, 0.9.13의 CARLA를 설치하기 위해 이전 버전 설치 과정을 찾게 되었다.
(CARLA를 최신 버전(0.9.15)으로 설치했는데, CARLA Ros Bridge는 가장 최신 버전이 0.9.13이다
(단, CARLA 0.9.14까지는 지원하는 묘책이 있다는 사람은 있다.))
큰 틀은 아래의 글을 참고하였다. (단, 아래 글은 최신 버전이라는 가정하에 설치하기 때문에 약간의 차이가 있다.)
CARLA 설치[Ubuntu 20.04]
1. CARLA란 CARLA는 오픈소스 자율주행 시뮬레이터이다. Unreal Engine 4를 사용하고 있으며 Python API를 제공하고 있고 가상세계에서 LiDAR, Camera, Depth Camera, Segmentation 등 여러가지 센서를 사용하여 데이터
jeo96.tistory.com
다른 사항은Unreal Engine의 경우, 설치하려는 CARLA 버전에 맞는 UE 버전의 branch를 설치한다.
필자의 경우는 0.9.13 CARLA이므로, UE 4.26 (carla branch) 그대로 설치함.
그리고,
3. Build CARLA에서
git clone -b 0.9.13 https://github.com/carla-simulator/carla
으로 바꾸고,
./Update.sh 대신

을 따라 진행하도록 한다. 이때 압축 파일 설치가 꽤나 걸리고 무겁다. 0.9.13의 경우 10GB 이상 했던거로 기억한다.
그러면 문제없이 될 것이다.
다만, 다음에 make PythonAPI때부터 오류가 진창 난다.
이는 어떻게 해결하였는지 아래에서 설명한다.
최신이 아닌 예전 버전을 설치하면서 생기는 오류 대부분은,
현재 최신 깃에서 변경된 사항을 확인하여 수정하면 해결이 됐다.
먼저, Setup.sh에서 수정할 필요가 있었다.
/carla/Util/BuildTools/Setup.sh를 들어가서,
1. line 133의 wget "https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/ ~... 을 수정한다.
wget "https://carla-releases.s3.eu-west-3.amazonaws.com/Backup/${BOOST_PACKAGE_BASENAME}.tar.gz"
(출처 : https://github.com/carla-simulator/carla/issues/7039)
고치기 전에는 아래와 같은 오류가 뜬다. 아래는 디버깅 과정이다.
한편 0.9.13의 경우 BOOST버전이 1.72.0인데, 1.80.0으로 바꾸면 종속성 오류가 뜬다. 버전은 그대로 두고 진행했다.
Setup.sh: Retrieving boost.
--2024-01-07 22:27:23-- https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz
Resolving boostorg.jfrog.io (boostorg.jfrog.io)... 18.214.194.113, 3.95.117.170, 18.232.172.199
Connecting to boostorg.jfrog.io (boostorg.jfrog.io)|18.214.194.113|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://landing.jfrog.com/reactivate-server/boostorg [following]
--2024-01-07 22:27:24-- https://landing.jfrog.com/reactivate-server/boostorg
Resolving landing.jfrog.com (landing.jfrog.com)... 18.232.172.199, 18.214.194.113, 3.95.117.170
Connecting to landing.jfrog.com (landing.jfrog.com)|18.232.172.199|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11534 (11K) [text/html]
Saving to: ‘boost_1_72_0.tar.gz’
boost_1_72_0.tar.gz 100%[===================>] 11.26K --.-KB/s in 0s
2024-01-07 22:27:25 (54.4 MB/s) - ‘boost_1_72_0.tar.gz’ saved [11534/11534]
Setup.sh: Extracting boost for Python 3.
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
make: *** [Util/BuildTools/Linux.mk:137: setup] Error 2
위에는 boost_1_72_0.tar.gz가 tar.gz형태로 저장이 되지 않고 HTML 파일로 저장되어 생기는 오류다.
실제로 판단하기 위해서는
cd carla/Build
file boost_1_72_0.tar.gz
를 해보면 알 수 있다. boost_1_72_0.tar.gz: HTML document, ASCII text, with very long lines
2. line 432의 XERCESC_REPO를 수정
기존의 XERCESC_REPO=https://ftp.cixug.es/apache//~..를
XERCESC_REPO=https://archive.apache.org/dist/xerces/c/3/sources/xerces-c-${XERCESC_VERSION}.tar.gz
위의 링크로 수정한다.
3. BuildPythonAPI.sh에서 오류 발생
BuildOSM2ODR.sh: Success!
BuildPythonAPI.sh: Building Python API for Python 3.
Traceback (most recent call last):
File "setup.py", line 9, in <module>
from setuptools import setup, Extension
File "/home/robotics/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 19, in <module>
from setuptools.dist import Distribution
File "/home/robotics/.local/lib/python3.8/site-packages/setuptools/dist.py", line 36, in <module>
from setuptools.config import parse_configuration
File "/home/robotics/.local/lib/python3.8/site-packages/setuptools/config/__init__.py", line 8, in <module>
from . import setupcfg
File "/home/robotics/.local/lib/python3.8/site-packages/setuptools/config/setupcfg.py", line 32, in <module>
from ..errors import FileError, OptionError
ImportError: cannot import name 'FileError' from 'setuptools.errors' (/home/robotics/.local/lib/python3.8/site-packages/setuptools/errors.py)
make: *** [Util/BuildTools/Linux.mk:87: PythonAPI] Error 1
위와 같은 오류는 ImportError를 보면 setuptools.errors에서 FileError를 찾지 못해서 발생한 것으로 보인다.
먼저, setuptools를 최신 버전으로 업그레이드해보았다.
pip install --upgrade setuptools
헉 ~ 드디어 성공했다.
이후 make launch를 하면 UE이 실행되는 걸 볼 수 있다.
CARLA를 재설치하면, RoadRunner Plugin이 다시 없어지니, 다시 진행해야한다.
필자의 경우, 0.9.13의 CARLA를 설치하기 위해 이전 버전 설치 과정을 찾게 되었다.
(CARLA를 최신 버전(0.9.15)으로 설치했는데, CARLA Ros Bridge는 가장 최신 버전이 0.9.13이다
(단, CARLA 0.9.14까지는 지원하는 묘책이 있다는 사람은 있다.))
큰 틀은 아래의 글을 참고하였다. (단, 아래 글은 최신 버전이라는 가정하에 설치하기 때문에 약간의 차이가 있다.)
CARLA 설치[Ubuntu 20.04]
1. CARLA란 CARLA는 오픈소스 자율주행 시뮬레이터이다. Unreal Engine 4를 사용하고 있으며 Python API를 제공하고 있고 가상세계에서 LiDAR, Camera, Depth Camera, Segmentation 등 여러가지 센서를 사용하여 데이터
jeo96.tistory.com
다른 사항은Unreal Engine의 경우, 설치하려는 CARLA 버전에 맞는 UE 버전의 branch를 설치한다.
필자의 경우는 0.9.13 CARLA이므로, UE 4.26 (carla branch) 그대로 설치함.
그리고,
3. Build CARLA에서
git clone -b 0.9.13 https://github.com/carla-simulator/carla
으로 바꾸고,
./Update.sh 대신

을 따라 진행하도록 한다. 이때 압축 파일 설치가 꽤나 걸리고 무겁다. 0.9.13의 경우 10GB 이상 했던거로 기억한다.
그러면 문제없이 될 것이다.
다만, 다음에 make PythonAPI때부터 오류가 진창 난다.
이는 어떻게 해결하였는지 아래에서 설명한다.
최신이 아닌 예전 버전을 설치하면서 생기는 오류 대부분은,
현재 최신 깃에서 변경된 사항을 확인하여 수정하면 해결이 됐다.
먼저, Setup.sh에서 수정할 필요가 있었다.
/carla/Util/BuildTools/Setup.sh를 들어가서,
1. line 133의 wget "https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/ ~... 을 수정한다.
wget "https://carla-releases.s3.eu-west-3.amazonaws.com/Backup/${BOOST_PACKAGE_BASENAME}.tar.gz"
(출처 : https://github.com/carla-simulator/carla/issues/7039)
고치기 전에는 아래와 같은 오류가 뜬다. 아래는 디버깅 과정이다.
한편 0.9.13의 경우 BOOST버전이 1.72.0인데, 1.80.0으로 바꾸면 종속성 오류가 뜬다. 버전은 그대로 두고 진행했다.
Setup.sh: Retrieving boost.
--2024-01-07 22:27:23-- https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz
Resolving boostorg.jfrog.io (boostorg.jfrog.io)... 18.214.194.113, 3.95.117.170, 18.232.172.199
Connecting to boostorg.jfrog.io (boostorg.jfrog.io)|18.214.194.113|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://landing.jfrog.com/reactivate-server/boostorg [following]
--2024-01-07 22:27:24-- https://landing.jfrog.com/reactivate-server/boostorg
Resolving landing.jfrog.com (landing.jfrog.com)... 18.232.172.199, 18.214.194.113, 3.95.117.170
Connecting to landing.jfrog.com (landing.jfrog.com)|18.232.172.199|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11534 (11K) [text/html]
Saving to: ‘boost_1_72_0.tar.gz’
boost_1_72_0.tar.gz 100%[===================>] 11.26K --.-KB/s in 0s
2024-01-07 22:27:25 (54.4 MB/s) - ‘boost_1_72_0.tar.gz’ saved [11534/11534]
Setup.sh: Extracting boost for Python 3.
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
make: *** [Util/BuildTools/Linux.mk:137: setup] Error 2
위에는 boost_1_72_0.tar.gz가 tar.gz형태로 저장이 되지 않고 HTML 파일로 저장되어 생기는 오류다.
실제로 판단하기 위해서는
cd carla/Build
file boost_1_72_0.tar.gz
를 해보면 알 수 있다. boost_1_72_0.tar.gz: HTML document, ASCII text, with very long lines
2. line 432의 XERCESC_REPO를 수정
기존의 XERCESC_REPO=https://ftp.cixug.es/apache//~..를
XERCESC_REPO=https://archive.apache.org/dist/xerces/c/3/sources/xerces-c-${XERCESC_VERSION}.tar.gz
위의 링크로 수정한다.
3. BuildPythonAPI.sh에서 오류 발생
BuildOSM2ODR.sh: Success!
BuildPythonAPI.sh: Building Python API for Python 3.
Traceback (most recent call last):
File "setup.py", line 9, in <module>
from setuptools import setup, Extension
File "/home/robotics/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 19, in <module>
from setuptools.dist import Distribution
File "/home/robotics/.local/lib/python3.8/site-packages/setuptools/dist.py", line 36, in <module>
from setuptools.config import parse_configuration
File "/home/robotics/.local/lib/python3.8/site-packages/setuptools/config/__init__.py", line 8, in <module>
from . import setupcfg
File "/home/robotics/.local/lib/python3.8/site-packages/setuptools/config/setupcfg.py", line 32, in <module>
from ..errors import FileError, OptionError
ImportError: cannot import name 'FileError' from 'setuptools.errors' (/home/robotics/.local/lib/python3.8/site-packages/setuptools/errors.py)
make: *** [Util/BuildTools/Linux.mk:87: PythonAPI] Error 1
위와 같은 오류는 ImportError를 보면 setuptools.errors에서 FileError를 찾지 못해서 발생한 것으로 보인다.
먼저, setuptools를 최신 버전으로 업그레이드해보았다.
pip install --upgrade setuptools
헉 ~ 드디어 성공했다.
이후 make launch를 하면 UE이 실행되는 걸 볼 수 있다.
CARLA를 재설치하면, RoadRunner Plugin이 다시 없어지니, 다시 진행해야한다.