LoginSignup
5
6

More than 3 years have passed since last update.

Ubuntu18.04.5にAutowareをインストールする

Last updated at Posted at 2020-12-26

まっさらなUbuntuの状態から、最新のAutowareをインストールする。(2020/12/24時点)

参考:
https://qiita.com/hgoj/items/e23c463b885e7bb1b911
https://qiita.com/kameyama-eiji/items/0b3f914dbe03a83a1231

前段:Ubuntuのインストール
https://qiita.com/atsuto/items/b31a82b984169c20f448

PCについて

Alienware
メモリ:32GB
CPU:Intel Core i7 2.9GHz(8コア)
GPU:GeForce GTX 1080

バージョンについて

ROS:Autoware.AI
ROS2:Autoware.auto
の2系統ある。
対応バージョンについて:https://faboplatform.github.io/AutowareDocs/07.RC_program/00.about_ros/
今回は、ROS1、Ubuntu18.04.5、Autoware

gitのインストール

sudo apt update
sudo apt install git

Cloneして実行

$ git clone https://gitlab.com/autowarefoundation/autoware.ai/docker.git
$ cd docker/generic
$ ./run.sh

エラー。

Dockerのインストール

Dockerがないようなので下記ページに従ってインストールする。
https://docs.docker.com/engine/install/ubuntu/
docker-ce 5:20.10.1~3-0~ubuntu-bio amd64

もう一度

$ sudo ./run.sh

nvidiaがない。

CUDAのインストール

https://qiita.com/ksasaki/items/b20a785e1a0f610efa08
https://developer.nvidia.com/cuda-downloads
最後に-driversをつけるといいとか。
cuda-drivers 460.27.04-1

sudo apt-get -y install cuda-drivers

Nvidia Dockerオプションの変更

下記エラーになるので

docker: Error response from daemon: Unknown runtime specified nvidia.

https://qiita.com/ksasaki/items/b20a785e1a0f610efa08
を参考に、--runtime=nvidia から --gpus allに変更

run.sh
    RUNTIME="--gpus all"

GPU認識

GPUを認識できていないエラー。

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

この辺を参考に。
https://qiita.com/tomp/items/50081b99df7963462488
https://blog.uni-3.app/2019/08/08/docker-gpu/
https://waldeinsamkeit.hatenablog.jp/entry/2019/08/17/002854

GPUの確認コマンドが返ってくるか。

$ nvidia-smi

結局は下記でうまくいった。

$ systemctl restart docker.service

UID設定

Changing autoware user ID to match your host's user ID (0).
This operation can take a while...
usermod: UID '0' already exists

sudoでのコマンド実行だとUIDが0になってしまうので、自分のUIDである1000に変更した。

run.sh
USER_ID="$(id -u)"

run.sh
USER_ID="1000"

通った!

boldly@boldly-Alienware-17-R4:~/Documents/docker/generic$ sudo ./run.sh 
[sudo] password for boldly: 
Using options:
    ROS distro: melodic
    Image name: autoware/autoware
    Tag prefix: latest
    Cuda support: on
    Pre-release version: off
    UID: <1000>
Launching autoware/autoware:latest-melodic-cuda
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

autoware@boldly-Alienware-17-R4:/home/autoware$

autowareユーザディレクトリができて、autowareユーザになっている。

Autoware起動

$ cd Autoware
$ source install/setup.bash
$ roslaunch runtime_manager runtime_manager.launch &

↓結果

... logging to /home/autoware/.ros/log/c5c1dc98-4693-11eb-94d6-9cb6d0e65079/roslaunch-boldly-Alienware-17-R4-84.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://boldly-Alienware-17-R4:34879/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.6

NODES
  /
    run (runtime_manager/run)

auto-starting new master
process[master]: started with pid [94]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to c5c1dc98-4693-11eb-94d6-9cb6d0e65079
process[rosout-1]: started with pid [105]
started core service [/rosout]
process[run-2]: started with pid [108]
[run-2] process has finished cleanly
log file: /home/autoware/.ros/log/c5c1dc98-4693-11eb-94d6-9cb6d0e65079/run-2*.log

画面が立ち上がった。

Screenshot from 2020-12-25 18-32-36.png

Autoware Dockerについて

なぜかコンテナを止めたり、PCを再起動するとDockerのコンテナが消えてしまい、毎回作り直しになる。
そういうもの?
ファイルは、ホストとなるPCの「~/shared_dir」とコンテナの「shared_dir」で共有されている。

5
6
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6