[자율주행/시뮬레이터] 우분투에 카를라 (Carla) 설치

2022. 5. 25. 20:0004. Archives/Self-driving Cars

728x90
반응형

 

실제 상황에서 꾸미기 힘든 자율주행 환경을 가상으로 꾸미기 쉽게 해주는 시뮬레이터는 여러가지가 있다.

그 중에서 나는 Carla를 써서 환경을 꾸며서 쓰기로 했다.

 

공식 홈페이지는 아래와 같다.

https://carla.org/

 

CARLA

Open-source simulator for autonomous driving research.

carla.org

 

사실 저기는 개발에 도움되는 이야기는 없다.

가지고 놀려면 documentation 페이지랑 친해져야한다.

https://carla.readthedocs.io/en/latest/

 

CARLA Simulator

Welcome to the CARLA documentation. This home page contains an index with a brief description of the different sections in the documentation. Feel free to read in whatever order preferred. In any case, here are a few suggestions for newcomers. The CARLA fo

carla.readthedocs.io

 

나는 최신 버전을 쓸 것이기 때문에 latest 페이지의 내용을 참고하다가, 그냥 최신 버전의 페이지를 바로 참고하기로 했다.

릴리즈된 최신 버전은 0.9.13 이고, 해당 버전의 설치 관련 페이지는 아래와 같다.

https://carla.readthedocs.io/en/0.9.13/start_quickstart/

 

Quick start package installation - CARLA Simulator

This guide shows how to download and install the packaged version of CARLA. The package includes the CARLA server and two options for the client library. There are additional assets that can be downloaded and imported into the package. Advanced customizati

carla.readthedocs.io

 

설치하는 문서에 사족이 너무 길어서 그냥 커맨드만 붙여서 쓴다.

내가 설치할 환경은 Nvidia 그래픽 카드 드라이버가 설치된 Ubuntu 18.04 이다.

아래 커맨드를 순서대로 입력하면 우분투에서 carla를 설치해서 쓸 수 있다.

pip install --user pygame numpy && pip3 install --user pygame numpy 

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1AF1527DE64CB8D9
sudo add-apt-repository "deb [arch=amd64] http://dist.carla.org/carla $(lsb_release -sc) main"
sudo apt-get update

sudo apt-get install -y libomp5
sudo apt-get install -y carla-simulator=0.9.13

위의 커맨드에서 documentation에는 없는 내용이 하나 있는데 그게 

sudo apt-get install -y libomp5

이 부분이다.

 

이런저런 테스트를 한다고 완전 clean한 우분투에 해당 매뉴얼을 따라서 설치를 진행하는데, 꼭 이 패키지 하나가 없어서 실행을 못한다는 에러가 떴다.

 

그래서 내가 쓰는 설치 스크립트에는 그냥 넣어줬다.

 

이렇게 설치하면, 카를라는

/opt/carla-simulator

폴더에 설치된다!

 

해당 폴더로 이동해서

./CarlaUE4.sh

커맨드를 입력하면 Carla가 잘 실행되는 것을 볼 수 있다!

반응형