如何在Ubuntu22.04上安装Apollo
时间: 2024-10-20 19:03:53 浏览: 17
apollo安装.pdf
在Ubuntu 22.04(Focal Fossa)上安装Apollo自动驾驶平台,你需要先确保系统已经更新到最新版本,并安装必要的依赖。以下是简化的步骤:
1. **更新系统**:
```bash
sudo apt update && sudo apt upgrade
```
2. **安装基本依赖**:
```
sudo apt install -y git build-essential cmake ninja-build python3-pip libprotobuf-dev lsb-release protobuf-ros-navigation
```
3. **安装ROS Foxy** (如果你还没有安装):
```bash
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo gpg --dearmor -o /usr/share/keyrings/rospkg.gpg
echo "deb [arch=amd64 keyring=/usr/share/keyrings/rospkg.gpg] http://packages.ros.org/ros/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-y ros-foxy-desktop
```
4. **创建工作目录并克隆Apollo源码**:
```
mkdir apollo
cd apollo
git clone https://github.com/ApolloAuto/apollo.git
```
5. **构建 Apollo**:
```bash
cd apollo
source setup.bash
colcon build
```
6. **配置环境变量** (可选):
如果你想在其他终端窗口也能使用Apollo,需要添加`export PATH=$PATH:$HOME/apollo/bazel-bin`到你的`~/.bashrc`文件。
7. **运行Apollo**:
进入`scripts`目录启动Apollo示例车或模拟器:
```bash
cd scripts
./start.sh
```
阅读全文