Apollo自动驾驶虚拟仿真赛笔记[3]-完成第一个场景并生成patch文件

场景描述

补充

工作流程大概是
git工具pull apollo,新建一个分支apollo_contest
然后我们修改 modules/planning中的文件,编译,在dreamview中查看效果是否符合比赛要求
调试完成,git push(这步不是必要的)

git add .
git commit -m "xxx"
git format-patch HEAD^

最后生成patch文件,提交到比赛网页

不一定要每次修改都编译

关注一些重要文件/目录

/apollo/modules/planning目录


image

planning模块文件修改

第一题:人行道避让


改参数应该就能完成
定位到要修改的文件/apollo/modules/planning/conf/traffic_rule_config.pb.txt
找到要修改的字段

config: { rule_id: CROSSWALK enabled: true crosswalk { stop_distance: 1.0 max_stop_deceleration: 6.0 min_pass_s_distance: 1.0 max_valid_stop_distance: 3.5 expand_s_distance: 2.0 stop_strict_l_distance: 6.0 stop_loose_l_distance: 8.0 stop_timeout: 4.0 } }
按照题目要求,应该是stop_strict_l_distance和stop_loose_l_distance字段
!!!!需要满足strict_l > loose_l

这里我改错了
stop_strict_l_distance: 5.0
stop_loose_l_distance: 5.5
结果就不通过竞赛规则检测

好像有一两题不用修改文件也可以90分(eg.红绿灯场景)

建议看一下代码文件

/planning/trafic_rules/crosswalk.cc可以看到参数的意义(如果您对参数的意思不是太了解)

备注

git log查看commit版本号

其中commit_id为f24630b30b76d8b14bf1815dc2a025277e034649的编号代表从远程获取的远程edu_sim_contest分支代码,各位参赛者都是以该分支代码为基础进⾏的以赛事场景任务的调试,各位提交的Patch⽂件也会被合并到该分支代码 进行线上评测,因此各位参赛者务必要确保您本地仓库的代码与远程的edu_sim_contest是⼀一致的,如果不一致就会导致合并失败,从而影响您的评测结果。

git设置,准备提交代码

准备工作目录

思路:gitlab创建公开项目->fork gitee的apollo->pull to gitlab->更改文件也pull(主要是方便团队协作)

mkdir /apollo_contest
git init
git clone -b edu_sim_contest git@gitee.com:ApolloAuto/apollo.git
git remote add origin git@gitlab.com:paisheng1/temp_apollo_contest.git(你的git地址)
git branch apollo_contest 新建一个分支
git checkout apollo_contest 切换到分支
git add .
git push origin master -force



error: src refspec master does not match any

原因本地仓库为空
git add .
git commit -m "test4"

查看

git remote -v显示所有远程仓库
git remote show 别名
git status查看仓库状态
git log 查看提交日志
git branch 查看分支

error: failed to push some refs to 'git@gitlab.com:paisheng1/temp_apollo_contest.git'

hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
解决办法git push gitlab master --force

gitignore 用于忽略某些文件

在 Git 中,我们可以用 git add 要告诉 Git 文件冲突已经解决
运行git config core.ignorecase false,关闭git忽略大小写配置,即可检测到大小写名称更改

使用git format-patch制做patch文件

git add .
git commit -m "CROSSROAD"
git format-patch HEAD^

提交代码

结果(模拟赛)

posted @ 2022-05-30 01:59  qsBye  阅读(1678)  评论(0编辑  收藏  举报