源码安装Autoware.auto
- 安装ROS2 foxy版本,由于版本问题,建议使用foxy版本,否则可能出现编译不通过的问题;
- 安装相关工具包:
sudo apt install -y git cmake python3-pip
pip3 install -U colcon-common-extensions vcstool
source /opt/ros/$ROS_DISTRO/setup.bash
- 安装ROS2依赖:
$ sudo apt update
$ sudo apt install -y python3-rosdep
$ sudo rosdep init
$ rosdep update
如果rosdep init失败,可使用鱼香ROS的脚本进行rosdepc初始化。
- 下载Autoware.auto源码:
$ git clone https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git
$ cd AutowareAuto
$ vcs import < autoware.auto.$ROS_DISTRO.repos
$ export ROS_VERSION=2
$ rosdep install -y -i --from-paths src
如果报错:bash: vcs: command not found
,可使用下面命令安装vcstool:sudo apt install python3-vcstool
5. 修改ROS2依赖,确保autoware编译通过:
sudo apt purge -y ros-foxy-autoware-auto-msgs
sudo apt purge -y ros-foxy-acado-vendor
sudo apt install -y ros-foxy-acado-vendor
- 编译源码:
cd AutowareAuto/
colcon build
本地源码avp例子的实现方法
在源码中没有avp例子中地图的点云文件和高精地图,因此需要安装ade,将ade中的/opt/AutowareAuto/share/autoware_demos/data目录文件拷贝到本地。
也可以从git中下载:https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git
建议使用git下载。
- 安装docker可参考:https://www.runoob.com/docker/ubuntu-docker-install.html
- 根据https://autowarefoundation.gitlab.io/autoware.auto/AutowareAuto/installation-ade.html安装ade
- ade安装好后,拷贝ade里的点云和高精地图:
docker cp -a ade:/opt/AutowareAuto/share/autoware_demos/data/ /home/你的计算机名/目标目录
- 将拷贝出来的文件替换/AutowareAuto/src/launch/autoware_demos/目录中的data文件夹
- colcon build 编译源码
- 运行LGSVL仿真器(2021.3版本),仿真配置如下:
Map:AutonomouStuff
Vehicle:AWFLexus2016RXHybrid
sensors:使用AutowareAuto/src/launch/autoware_demos/config/svl/avp-sensors.json的配置
bridge:ROS2
Autopilot:Autoware.Auto (Apex.AI)
Connection:localhost:9090 - 终端1:
lgsvl_bridge
如果没有,使用sudo apt install ros-foxy-lgsvl-bridge
安装
8. 终端2:
source install/setup.bash
ros2 launch autoware_auto_launch autoware_auto_visualization.launch.py
- 终端3:
source install/setup.bash
stdbuf -o L ros2 launch autoware_demos avp_sim.launch.py