Apollo自动驾驶虚拟仿真赛笔记[2]-环境配置补充

dreamview 中没有Apollo_map地图

检查以下setup mode:Contest Debug
如果没有这个模式,检查一下版本edu_sim_contest

生成障碍物

启动场景生成组件Sim_Obstacle

git配置

同一个邮箱在不同电脑上也需要配置,复制密钥文件夹没有用的吧?
git config --global user.name "qsbye"
git config --global user.email "2557877116@qq.com"

查看配置信息

git config --list
cd ~/.ssh

生成密钥

ssh-keygen -t rsa -C "2557877116@qq.com"
生成的密钥在~/.ssh/id_rsa.pub文件,复制文件内容到gitee的公钥管理

复制文件内容到剪贴板

apt-get install xsel
cat ~/.ssh/id_rsa.pub | xsel --clipboard

验证

ssh -T git@gitee.com

初始化本地git仓库

cd 文件夹
git init

安装比赛用apollo系统(我笔记[1]发的文件少了比赛用的模块)

「没看到比赛用的地图?版本错了:(,下面才是正确版本」


[提供的docker.sh文件]

#!/bin/bash

function install_prepare()
{
    sudo apt update 
    #sudo apt upgrade -y
    sudo apt install gcc g++ git vim curl make cmake gedit unzip cutecom can-utils net-tools -y
}

function install_docker() 
{    
    sudo modprobe overlay
    sudo docker -v 1>/dev/null 2>&1
    if [ $? -eq 0 ]
    then
        id | grep "docker" 1>/dev/null 2>&1
        if [ $? -eq 0 ]
        then
            echo "docker is OK!"
            return 1
        else
            sudo gpasswd -a $USER docker  
            sudo usermod -aG docker $USER
            sudo systemctl restart docker
            echo "please reboot the computer and run the scripts again!"
            return 2
        fi
    else
        curl https://get.docker.com | sh && sudo systemctl --now enable docker
        sudo systemctl restart docker
        sudo gpasswd -a $USER docker  
        sudo usermod -aG docker $USER
        sudo systemctl restart docker
        sudo chmod 777 /var/run/docker.sock
        echo "please reboot the computer and run the scripts again!"
        return 3
    fi

    return 0
}

function clone_apollo()
{
    cd ~
    git init
    git clone -b edu_sim_contest git@gitee.com:ApolloAuto/apollo.git
    cd ~/apollo
    bash docker/scripts/dev_start.sh -y
}

function main() 
{
    install_prepare
    install_docker
    clone_apollo
    
    return 0
}

main "$@"

bash docker.sh
cd /apollo 进入用户根目录下的apollo文件夹(默认位置)
bash docker/scripts/dev_into.sh -C 使用国内源
bash apollo.sh build 此时会下载依赖包

下载依赖包失败

方法1.修改host配置 (没用)

13.250.94.254 api.github.com
140.82.112.6 api.github.com
13.250.168.23 api.github.com
13.250.177.223 github.com
13.229.188.59 github.com

方法2.wget文件并解压到目录

wget https://apollo-system.bj.bcebos.com/archive/bazel_deps/bazel-dependencies-5.0.0.tar.gz
tar -zxvf bazel-dependencies-5.0.0.tar.gz
cp -r bazel-dependencies-5.0.0/* apollo/.cache/distdir

方法3.设置代理

export HTTPS_PROXY="http://192.168.0.108:7890"

fatal: 无法读取远程仓库。请确认您有正确的访问权限并且仓库存在。

不要用sudo git

关于apollo.sh build报错

In file included from ./modules/prediction/container/obstacles/obstacle.h:38:0,
from ./modules/prediction/evaluator/evaluator.h:28,
from ./modules/prediction/evaluator/pedestrian/pedestrian_interaction_evaluator.h:31,
from modules/prediction/evaluator/pedestrian/pedestrian_interaction_evaluator_test.cc:17:
bazel-out/k8-fastbuild/bin/modules/prediction/proto/prediction_conf.pb.h:326:5: warning: 'ObstacleConf_EvaluatorType_RNN_EVALUATOR' is deprecated [-Wdeprecated-declarations]
ObstacleConf_EvaluatorType_RNN_EVALUATOR;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/k8-fastbuild/bin/modules/prediction/proto/prediction_conf.pb.h:108:3: note: declared here
ObstacleConf_EvaluatorType_RNN_EVALUATOR PROTOBUF_DEPRECATED_ENUM = 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/k8-fastbuild/bin/modules/prediction/proto/prediction_conf.pb.h:376:5: warning: 'ObstacleConf_PredictorType_REGIONAL_PREDICTOR' is deprecated [-Wdeprecated-declarations]
ObstacleConf_PredictorType_REGIONAL_PREDICTOR;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/k8-fastbuild/bin/modules/prediction/proto/prediction_conf.pb.h:141:3: note: declared here
ObstacleConf_PredictorType_REGIONAL_PREDICTOR PROTOBUF_DEPRECATED_ENUM = 2,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

诸如此类的,可以忽略,不影响最后结果,
但是如果bazel Server terminated abruptly (error code: 14, error message: 'Socket close...
可能是系统磁盘不够了,大概预留20G的空闲空间,内存15G左右
这时候可以用/script/apollo_clean.sh --bazel清理一下,然后清理以下系统的垃圾文件如apt-get clean
查看空闲内存free -g

总算看到比赛用地图了


posted @   qsBye  阅读(734)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
点击右上角即可分享
微信分享提示