Autoware开发
2021/5/14 18:27:00
本文主要是介绍Autoware开发,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
目录
/etc/udev/rules.d
50-usbcan.rules
55-usbserial.rules
xrdp
docker
install
Ubuntu 下非 root 用户运行 docker
将用户加入该 group 内
重启服务
重进终端
pkg
/etc/apt/sources.list.d/nvidia-container-runtime.list
/etc/apt/sources.list.d/nvidia-docker.list
portainer
安装portainer
管理员登录
registry
/etc/docker/daemon.json
docker push
docker pull
auth
autoware
Docker
克隆Autoware-AI/docker
修改run.sh
创建容器
安装软件
编译
images
build from Dockerfile
Source
autoware.ai.repos
/etc/udev/rules.d
50-usbcan.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0471", ATTRS{idProduct}=="1200", GROUP="autoware", MODE="0666"
55-usbserial.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", GROUP="ygzhang", MODE="0666"
xrdp
sudo vi /etc/apt/sources.list sudo apt-get update apt-get source xorgxrdp Reading package lists... Done Picking 'xrdp' as source package instead of 'xorgxrdp' NOTICE: 'xrdp' packaging is maintained in the 'Git' version control system at: https://anonscm.debian.org/git/pkg-remote/xrdp.git Please use: git clone https://anonscm.debian.org/git/pkg-remote/xrdp.git to retrieve the latest (possibly unreleased) updates to the package. Need to get 3575 kB of source archives. Get:1 http://archive.ubuntu.com/ubuntu bionic/universe xrdp 0.9.5-2 (dsc) [2749 B] Get:2 http://archive.ubuntu.com/ubuntu bionic/universe xrdp 0.9.5-2 (tar) [464 kB] Get:3 http://archive.ubuntu.com/ubuntu bionic/universe xrdp 0.9.5-2 (tar) [3083 kB] Get:4 http://archive.ubuntu.com/ubuntu bionic/universe xrdp 0.9.5-2 (diff) [25.7 kB] Fetched 3575 kB in 5s (738 kB/s) dpkg-source: info: extracting xrdp in xrdp-0.9.5 dpkg-source: info: unpacking xrdp_0.9.5.orig.tar.gz dpkg-source: info: unpacking xrdp_0.9.5.orig-xorgxrdp.tar.gz dpkg-source: info: unpacking xrdp_0.9.5-2.debian.tar.xz dpkg-source: info: applying make-fixes.diff dpkg-source: info: applying config.diff dpkg-source: info: applying misc-fixes.diff dpkg-source: info: applying fix_perms.diff dpkg-source: info: applying shutup-daemon.diff dpkg-source: info: applying systemd.diff dpkg-source: info: applying lfs.diff dpkg-source: info: applying pulse-debian.patch
xrdp_0.9.5-2.debian.tar.xz
xrdp_0.9.5.orig.tar.gz
xrdp_0.9.5.orig-xorgxrdp.tar.gz
xorgxrdp_nvidia https://github.com/jsorg71/xorgxrdp.git
xorgxrdp 0.2.13 requires xrdp v0.9.13 or later -> nvidia_hack
xorgxrdp 0.2.14 requires xrdp v0.9.14
| xrdp | xorgxrdp |
Ubuntu 18.04 | 0.9.5 | 0.2.5 |
nvidia_hack |
| 0.2.13 |
docker
install
https://github.com/Autoware-AI/autoware.ai/wiki/docker-installation
https://docs.docker.com/engine/install/ubuntu/
Ubuntu 下非 root 用户运行 docker
将用户加入该 group 内
sudo usermod -aG docker $USER
重启服务
sudo service docker restart # 或者 sudo /etc/init.d/docker restart
重进终端
Ubuntu | docker-ce | nvidia-container-runtime | nvidia-container-toolkit | nvidia-docker2 |
18.04.5 | 20.10.5 | 3.4.2-1 | 1.4.2-1 | 2.5.0-1 |
16.04.4 | 19.03.4 |
|
|
|
pkg
pkg | version | bin or lib |
libnvidia-container-tools | 1.3.3-1 | nvidia-container-cli |
libnvidia-container1:amd64 | 1.3.3-1 | libnvidia-container.so.1.3.3 |
nvidia-container-runtime | 3.4.2-1 | nvidia-container-runtime |
nvidia-container-toolkit | 1.4.2-1 | nvidia-container-toolkit |
/etc/apt/sources.list.d/nvidia-container-runtime.list
1 #deb https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/$(ARCH) / 2 # deb https://nvidia.github.io/libnvidia-container/experimental/ubuntu18.04/$(ARCH) / 3 #deb https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/$(ARCH) / 4 # deb https://nvidia.github.io/nvidia-container-runtime/experimental/ubuntu18.04/$(ARCH) /
/etc/apt/sources.list.d/nvidia-docker.list
1 deb https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/$(ARCH) / 2 #deb https://nvidia.github.io/libnvidia-container/experimental/ubuntu18.04/$(ARCH) / 3 deb https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/$(ARCH) / 4 #deb https://nvidia.github.io/nvidia-container-runtime/experimental/ubuntu18.04/$(ARCH) / 5 deb https://nvidia.github.io/nvidia-docker/ubuntu18.04/$(ARCH) /
portainer
安装portainer
opensesame@Ubuntu:~$ docker search portainer|head -n 3 NAME DESCRIPTION STARS OFFICIAL AUTOMATED portainer/portainer This Repo is now deprecated, use portainer/p… 2072 portainer/portainer-ce Portainer CE - Making Docker and Kubernetes … 507
opensesame@Ubuntu:~$ docker pull portainer/portainer:1.24.1 1.24.1: Pulling from portainer/portainer d1e017099d17: Pull complete 717377b83d5c: Pull complete Digest: sha256:f8c2b0a9ca640edf508a8a0830cf1963a1e0d2fd9936a64104b3f658e120b868 Status: Downloaded newer image for portainer/portainer:1.24.1 docker.io/portainer/portainer:1.24.1
opensesame@Ubuntu:~$ docker run -d -p 9000:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock --name portainer portainer/portainer:1.24.1 251649eb0c6f341c66627ab8acddafdec0b979699c64acd7da22d2ff08b975df
管理员登录
浏览器访问http://localhost:9000,本机访问使用localhost,其他机器访问使用portainer所在机器的ip地址,例如:portainer所在机器的ip地址为192.168.5.10,浏览器访问http://192.168.5.10:9000。看到如下界面,输入2次相同的密码,点击“Create User”创建管理员用户。
选择Local、点击“Connect”
进入主界面。至此可以通过Web界面进行容器的相关操作。
registry
docker search registry sudo vi /etc/docker/daemon.json {"registry-mirrors":["https://6kx4zyno.mirror.aliyuncs.com"]} sudo service docker restart docker run -d -p 5000:5000 --name registry --restart=always -v /opt/registry:/var/lib/registry registry
/etc/docker/daemon.json
{ "registry-mirrors":["https://6kx4zyno.mirror.aliyuncs.com"], "insecure-registries":["20.21.5.12:5000"] }
docker push
sudo vi /etc/docker/daemon.json sudo service docker restart docker tag autoware/autoware:1.14.0-melodic-cuda 20.21.5.12:5000/ourautoware:1.14.0-melodic-cuda docker push 20.21.5.12:5000/ourautoware:1.14.0-melodic-cuda
docker pull
sudo vi /etc/docker/daemon.json sudo service docker restart docker pull 20.21.5.12:5000/ourautoware:1.14.0-melodic-cuda
auth
sudo apt install httpd-tools mkdir /opt/registry-auth htpasswd -Bbn autoware autoware@2021 > /opt/registry-auth/htpasswd docker run -d -p 5000:5000 --restart=always \ -v /opt/registry-auth/:/auth/ \ -v /opt/registry:/var/lib/registry --name registry-auth -e "REGISTRY_AUTH=htpasswd" \ -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \ -e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd" registry
autoware
GitHub - Autoware-AI/autoware.ai: Open-source software for self-driving vehicles
https://github.com/Autoware-AI/autoware.ai
https://github.com/vkrit/Autoware
Docker
https://github.com/Autoware-AI/autoware.ai/wiki/Docker
https://github.com/Autoware-AI/autoware.ai/wiki/Generic-x86-Docker
克隆Autoware-AI/docker
git clone https://github.com/Autoware-AI/docker.git Cloning into 'docker'... remote: Enumerating objects: 36, done. remote: Counting objects: 100% (36/36), done. remote: Compressing objects: 100% (28/28), done. remote: Total 712 (delta 16), reused 15 (delta 7), pack-reused 676 Receiving objects: 100% (712/712), 964.36 KiB | 1.12 MiB/s, done. Resolving deltas: 100% (393/393), done.
修改run.sh
--- a/generic/run.sh +++ b/generic/run.sh @@ -11,6 +11,7 @@ BASE_ONLY="false" PRE_RELEASE="off" AUTOWARE_HOST_DIR="" USER_ID="$(id -u)" +DISPLAY=:0 function usage() { echo "Usage: $0 [OPTIONS]" @@ -157,12 +158,16 @@ IMAGE=$IMAGE_NAME:$TAG_PREFIX-$ROS_DISTRO$SUFFIX echo "Launching $IMAGE" docker run \ - -it --rm \ + -it \ + --name ourautoware \ + -p 12322:22 \ + -p 13389:3389 \ + -p 9090:9090 \ + -p 11311:11311 \ $VOLUMES \ --env="XAUTHORITY=${XAUTH}" \ --env="DISPLAY=${DISPLAY}" \ --env="USER_ID=$USER_ID" \ --privileged \ - --net=host \ + --net=bridge \ $RUNTIME \ $IMAGE
命令行参数
|
|
|
-i, --interactive | Keep STDIN open even if not attached |
|
-t, --tty | Allocate a pseudo-TTY |
|
-rm | Automatically remove the container when it exits |
|
-v, --volume list | Bind mount a volume |
|
-e, --env list | Set environment variables |
|
--privileged | Give extended privileges to this container |
|
--network network | Connect a container to a network |
|
--gpus gpu-request | GPU devices to add to the container ('all' to pass all GPUs) | <19.03 && !nvidia-docker |
--runtime | Runtime to use for this container |
|
创建容器
cd docker/generic ./run.sh -t 1.14.0 Using options: ROS distro: melodic Image name: autoware/autoware Tag prefix: 1.14.0 Cuda support: on Pre-release version: off UID: <1002> Launching autoware/autoware:1.14.0-melodic Changing autoware user ID to match your host's user ID (1002). This operation can take a while... To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details. autoware@autoware:/home/autoware$
安装软件
docker exec -it ourautoware /tmp/entrypoint.sh sudo apt update sudo apt install -y vim sudo net-tools tzdata ssh xrdp xfce4 xfce4-terminal
编译
AUTOWARE_COMPILE_WITH_CUDA=1 colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
images
| 1.14.0-melodic 20-05-27_09:36 | 1.14.0-melodic-cuda 20-07-25_02:41 |
| 6.6G | 10.1G |
Autoware | 3.3G | 3.2G |
dependencies | 1.4G | 1.4G |
libcudnn |
| 1.3G |
cuda-libraries |
| 1.2G |
cuda-libraries |
| 820.6M |
ros-melodic-ros-core | 802.2M | 759.9M |
apt install | 637.8M | 640.5M |
apt update 37M apt install -y vim sudo net-tools tzdata ssh xrdp xfce4 xfce4-terminal 283.5M colcon build 4.1G rm -rf build log install 283.5M
build from Dockerfile
build.sh
OPTIONS | default |
|
-b,--base-only | false |
|
-c,--cuda <on|off> | on | 容器CUDA支持与否 |
-h,--help |
|
|
-i,--image <name> | autoware/autoware | dokcer镜像名 |
-r,--ros-distro <name> | melodic | ROS发布版本 |
-t,--tag-prefix <tag> | local |
|
-v,--version <version> |
| 指定autoware版本,重载--tag-prefix |
--tag $IMAGE_NAME:$TAG_PREFIX-$ROS_DISTRO$CUDA_SUFFIX
| IMAGE_NAME | TAG_PREFIX | ROS_DISTRO | CUDA_SUFFIX |
default | autoware/autoware | local | melodic | -cuda |
options |
| -v,--version | -r,--ros-distro | -c,--cuda |
* 先根据ROS版本构建基本镜像
* 从基本镜像构建支持CUDA镜像(由-c选项控制)
* 从CUDA镜像构建最终镜像,或者从基本镜像构建最终镜像。
./build.sh (不指定autoware版本,默认使用master)
Dockerfile.base -> autoware/autoware:local-melodic-base
Dockerfile.cuda.melodic -> autoware/autoware:local-melodic-base-cuda
Dockerfile -> autoware/autoware:local-melodic-cuda
./build.sh -v 1.14.0 (指定autoware版本)
Dockerfile.base -> autoware/autoware:1.14.0-melodic-base
Dockerfile.cuda.melodic -> autoware/autoware:1.14.0-melodic-base-cuda
Dockerfile -> autoware/autoware:1.14.0-melodic-cuda
./build.sh -c off(不指定autoware版本,默认使用master,不支持CUDA)
Dockerfile.base -> autoware/autoware:local-melodic-base
Dockerfile -> autoware/autoware:local-melodic
版本1.11.*使用Dockerfile.legacy.colcon,版本1.[6-10].*使用Dockerfile.legacy.catkin,其他使用Dockerfile。
Source
Source Build · Autoware-AI/autoware.ai Wiki · GitHub
autoware.ai.repos
git repo | URL |
|
common | https://github.com/Autoware-AI/common.git | Autoware-AI |
core_perception | https://github.com/Autoware-AI/core_perception.git | Autoware-AI |
core_planning | https://github.com/Autoware-AI/core_planning.git | Autoware-AI |
documentation | https://github.com/Autoware-AI/documentation.git | Autoware-AI |
messages | https://github.com/Autoware-AI/messages.git | Autoware-AI |
simulation | https://github.com/Autoware-AI/simulation.git | Autoware-AI |
utilities | https://github.com/Autoware-AI/utilities.git | Autoware-AI |
visualization | https://github.com/Autoware-AI/visualization.git | Autoware-AI |
drivers | https://github.com/Autoware-AI/drivers.git | Autoware-AI |
osrf_citysim | https://github.com/CPFL/osrf_citysim.git | CPFL |
car_demo | https://github.com/CPFL/car_demo.git | CPFL |
ds4 | https://github.com/tier4/ds4.git | tier4 |
* CPFL: Computing Platforms Federated Labratory
这篇关于Autoware开发的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-26Mybatis官方生成器资料详解与应用教程
- 2024-11-26Mybatis一级缓存资料详解与实战教程
- 2024-11-26Mybatis一级缓存资料详解:新手快速入门
- 2024-11-26SpringBoot3+JDK17搭建后端资料详尽教程
- 2024-11-26Springboot单体架构搭建资料:新手入门教程
- 2024-11-26Springboot单体架构搭建资料详解与实战教程
- 2024-11-26Springboot框架资料:新手入门教程
- 2024-11-26Springboot企业级开发资料入门教程
- 2024-11-26SpringBoot企业级开发资料详解与实战教程
- 2024-11-26Springboot微服务资料:新手入门全攻略