본문 바로가기
카테고리 없음

ROS2 CARLA Autoware Bridge

by Z0e 2025. 3. 28.

 

 

1. NVIDIA Container Toolkit, ROS2 Humble Docker 설치

 

NVIDIA Container Toolkit 설치

관련 포스팅Docker 설치Docker 명령어 모음    NVIDIA Container ToolkitDocker 컨테이너 내에서도 NVIDIA GPU를 사용할 수 있도록 지원하는 도구    Installationcurl -fsSL https://nvidia.github.io/libnvidia-container/gpgk

soheelog.com

 

Docker를 통한 ROS2 Humble 재설치: with CUDA & GUI 환경

관련 포스팅Docker 설치Docker 명령어 모음NVIDIA Container Toolkit 설치Docker를 통한 ROS2 Humble 설치     지난 포스팅 Docker를 통한 ROS2 Humble 설치를 진행하고 나서 재부팅 이후에 `qt.qpa.xcb: could not connect t

soheelog.com

 

GitHub - sohee-zoe/ros2-humble-Dockerfile: Ubuntu 22.04 ROS 2 Humble

Ubuntu 22.04 ROS 2 Humble. Contribute to sohee-zoe/ros2-humble-Dockerfile development by creating an account on GitHub.

github.com

 

 

2. CARLA, CARLA-Autoware-Bridge, Autoware

 

GitHub - TUMFTM/Carla-Autoware-Bridge: Carla 0.9.15 and Autoware Universe Humble

Carla 0.9.15 and Autoware Universe Humble. Contribute to TUMFTM/Carla-Autoware-Bridge development by creating an account on GitHub.

github.com

 

2-1 CARLA 시뮬레이터

docker pull carlasim/carla:0.9.15
docker run \
  --name carla \
  --privileged \
  --gpus all \
  --net=host \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
  carlasim/carla:0.9.15 \
  /bin/bash ./CarlaUE4.sh -vulkan -carla-rpc-port=1403
  
docker start carla

 

 

2-2 CARLA Autoware Bridge

 

GitHub - ttgamage/carla-ros-bridge: ROS Humble bridge for CARLA v0.9.15

ROS Humble bridge for CARLA v0.9.15. Contribute to ttgamage/carla-ros-bridge development by creating an account on GitHub.

github.com

docker pull tumgeka/carla-autoware-bridge:latest

docker run \
  --name carla-autoware-bridge \
  --rm \
  -it \
  --network host \
  -e RMW_IMPLEMENTATION=rmw_cyclonedds_cpp \
  tumgeka/carla-autoware-bridge:latest
  
docker start carla-autoware-bridge
docker exec -it carla-autoware-bridge /bin/bash


# Launch the bridge
ros2 launch carla_autoware_bridge carla_aw_bridge.launch.py port:=1403 town:=Town10HD
ros2 launch carla_autoware_bridge carla_aw_bridge.launch.py port:=1403 town:=Town02

# spawn traffic
python3 src/carla_autoware_bridge/utils/generate_traffic.py -p 1403

 

 

2-3 Autoware

Option 1) autoware-universe:humble-2024.01-cuda-amd64

`TUMFTM/Carla-Autoware-Bridge`에서 설명하는 autoware 도커 이미지는 제공되지 않고 있다.
git clone https://github.com/TUMFTM/Carla_t2.git

ros2 launch autoware_launch e2e_simulator.launch.xml vehicle_model:=carla_t2_vehicle sensor_model:=carla_t2_sensor_kit map_path:=<path to /wsp/map>

docker pull ghcr.io/autowarefoundation/autoware:humble-2024.01-cuda-amd64

rocker --network=host -e RMW_IMPLEMENTATION=rmw_cyclonedds_cpp -e LIBGL_ALWAYS_SOFTWARE=1 --x11 --nvidia --volume /path/to/code -- ghcr.io/autowarefoundation/autoware-universe:humble-2024.01-cuda-amd64

 

Issue)

더보기

문제 1. rocker 미지원

 

 

Docker installation quick start Failed! · Issue #8700 · autowarefoundation/autoware_universe

Checklist I've read the contribution guidelines. I've searched other issues and no duplicate issues were found. I'm convinced that this is not my fault but a bug. Description I tried following the ...

github.com

 

sudo apt install software-properties-common

sudo add-apt-repository universe

sudo apt update && sudo apt install curl -y

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

sudo apt update

sudo apt-get install python3-rocker
더보기

문제 2. autoware universe 도커 이미지 인증 문제

 

# Autoware 이미지 풀
docker pull ghcr.io/autowarefoundation/autoware-universe:humble-2024.01-cuda-amd64

 

Error response from daemon: Head "
https://ghcr.io/v2/autowarefoundation/autoware-universe/manifests/humble-2024.01-cuda-amd64
": unauthorized

 

  • 해결 방법
    • 옵션 1) 어떤 유저가 수정해서 fork함 → better_autoware_launch
    • 옵션 2) 소스코드로 빌드

 

Option 2) Better Autoware Launch

 

GitHub - YuqiHuai/better_autoware_launch

Contribute to YuqiHuai/better_autoware_launch development by creating an account on GitHub.

github.com

git clone git@github.com:YuqiHuai/rocker.git --depth=1
cd rocker
pip install -e .

# for uv
# pip install -e . --system
git clone https://github.com/YuqiHuai/better_autoware_launch.git
cd better_autoware_launch

bash docker/build/build_docker.sh
bash docker/build/build_docker.sh --multi_container

# bash docker/scripts/dev_start.sh --container_name autoware --use_multi_container
# bash docker/scripts/dev_into.sh --container_name autoware

 

`docker/scripts/dev_start_custom.sh` 작성

# !/bin/bash

CONTAINER_NAME="autoware_dev_${USER}"
USE_MULTI_CONTAINER=false
GREAT_GRAND_PARENT=$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")

show_help() {
    echo -e "\e[34mUsage:\e[0m $0 [options]"
    echo -e "\e[34mOptions:\e[0m"
    echo -e "  \e[32m--container_name <name>\e[0m    Set container name"
    echo -e "  \e[32m--use_multi_container\e[0m      Enable multi-container mode"
    echo -e "  \e[32m--help\e[0m                     Show this help message"
    exit 0
}

# Parse named arguments
while [[ $# -gt 0 ]]; do
    case "$1" in
    --container_name)
        CONTAINER_NAME="$2"
        shift 2
        ;;
    --use_multi_container)
        USE_MULTI_CONTAINER=true
        shift
        ;;
    --help)
        show_help
        ;;
    *)
        echo -e "\e[31m[ERROR]: Unknown argument $1\e[0m"
        show_help
        ;;
    esac
done

# check if image is built
check_image() {
    if [[ "$(docker images -q $IMAGE_NAME 2>/dev/null)" == "" ]]; then
        echo -e "\e[31m[ERROR]: Image $IMAGE_NAME not found\e[0m"
        exit 1
    fi
}

if [[ "$USE_MULTI_CONTAINER" == true ]]; then
    IMAGE_NAME="sora_autoware_multi_container:latest"
else
    IMAGE_NAME="sora_autoware:latest"
fi

check_image

# check if container is running
if [[ "$(docker ps -q -f name=$CONTAINER_NAME)" != "" ]]; then
    echo -e "\e[31m[ERROR]: Container $CONTAINER_NAME already running\e[0m"
    exit 1
fi

rocker --nvidia --privileged --x11 --user --net host \
    -e RMW_IMPLEMENTATION=rmw_cyclonedds_cpp \
    -e LIBGL_ALWAYS_SOFTWARE=1 \
    --volume $GREAT_GRAND_PARENT/data/autoware_map:$HOME/autoware_map \
    --volume $GREAT_GRAND_PARENT:$HOME/better_autoware_launch \
    --name $CONTAINER_NAME \
    --hostname $CONTAINER_NAME \
    --mode non-interactive \
    --detach \
    -- $IMAGE_NAME sleep infinity

echo -e "\e[32m[INFO]: Started container $CONTAINER_NAME\e[0m"
bash docker/scripts/dev_start_custom.sh --container_name autoware --use_multi_container
bash docker/scripts/dev_into.sh --container_name autoware

 

 

Option 3) Autoware Universe 소스코드 빌드

 

GitHub - autowarefoundation/autoware_universe

Contribute to autowarefoundation/autoware_universe development by creating an account on GitHub.

github.com

mkdir -p ~/autoware_ws/src
cd ~/autoware_ws/src
git clone -b humble https://github.com/autowarefoundation/autoware_universe.git
cd ..
colcon build --symlink-install

 

 

3. CARLA ROS Bridge

 

GitHub - ttgamage/carla-ros-bridge: ROS Humble bridge for CARLA v0.9.15

ROS Humble bridge for CARLA v0.9.15. Contribute to ttgamage/carla-ros-bridge development by creating an account on GitHub.

github.com

source .venv/bin/activate
mkdir ros-bridge && cd ros-bridge
git clone --recurse-submodules https://github.com/ttgamage/carla-ros-bridge.git
mv carla-ros-bridge src
rosdep update
rosdep install --from-paths src --ignore-src -r
colcon build --symlink-install
source install/setup.zsh

 

 

 

 

결과

 

아직 CARLA Autoware Bridge 연동만 확인되었다..