diff --git a/build_latex_tactile.bat b/build_latex_tactile.bat new file mode 100644 index 00000000..9bcbaa93 --- /dev/null +++ b/build_latex_tactile.bat @@ -0,0 +1,8 @@ +@echo off + + + +rem 编译触觉本科毕业论文 +pushd "%cd%\sim\tactile\undergraduate\" +xelatex -synctex=1 -interaction=nonstopmode hutbthesis_main.tex +popd \ No newline at end of file diff --git a/tactile/content/chapter1.tex b/tactile/content/chapter1.tex new file mode 100644 index 00000000..c07d5664 --- /dev/null +++ b/tactile/content/chapter1.tex @@ -0,0 +1,125 @@ +\subsection{研究背景及意义} + +\subsubsection{选题背景} + +随着虚拟现实、医学仿真、机器人操作等领域的快速发展,可变形物体的触觉交互技术日益成为研究热点。该技术旨在通过物理仿真与触觉反馈的结合,使用户能够在虚拟环境中获得接近真实的触觉体验。本文围绕可变形物体建模、触觉渲染方法、VR/XR交互系统以及医学仿真应用等方面,对国内外相关研究进行梳理,并分析其发展趋势。 + +\subsubsection{选题意义} + +机器人仿真与虚拟现实领域经过多年积累,刚体物体的交互技术已相对成熟,软组织、柔性材料等可变形物体的仿真研究却仍处于起步阶段。这类物体在受力时表现出的非线性特征与时变属性给建模工作带来了相当大的困难,单纯依靠视觉信息难以支撑精细化的操控任务,操作者往往因缺乏力觉感知而无法准确判断接触状态。本课题选用MuJoCo作为物理仿真引擎,配合Weart触觉手套,尝试构建一套视觉呈现、物理运算与力觉反馈相互协同的交互系统。这一平台有望打破当前仿真研究偏重图形渲染、忽视触觉通道的局面,为研究者探索复杂形变件下的力学感知机制提供可重复验证的实验条件。 + + 在保证系统实时响应的前提下精确计算软体接触力并将其转化为触觉信号,这一问题在现有交互系统中尚未得到有效解决。本研究计划建立物理引擎输出参数与触觉驱动指令之间的映射关系,力求实现高刷新率、低传输延时的力觉回路。视觉信号与触觉信号的时空同步问题同样值得关注,为系统验证触觉反馈的实际效用,本课题将生成若干组物理特性各异的软体模型,涵盖不同弹性系数、阻尼参数与几何构型,借此考察触觉通道对操作稳定性与任务完成质量的影响程度。 + + 当前同类研究多侧重于演示交互效果的视觉逼真程度,缺乏针对交互过程本身的定量评估手段,本课题拟建立一套涵盖任务耗时、操作成功比例、接触力平稳程度等维度的评价指标体系。实验设计上将安排受试者分别在开启触觉与关闭触觉两种条件下执行相同任务,采集对应的操作数据,通过统计比较把操作者的主观触感体验转化为具有统计意义的数值结论,为触觉技术在远程医疗、精密组装及虚拟训练等应用场景的推广提供实证支撑。 + +\subsection{国内研究现状} + +国内学者在可变形物体触觉交互领域开展了多角度的研究工作,主要集中在以下几个方向。 + +在可变形物体形变仿真方面,马雨前针对虚拟手术中的软组织形变问题,提出了基于有限元仿真的RPIM无网格建模方法,并研究了相应的碰撞检测技术。冯上涛则专注于虚拟手术缝合仿真中的软组织形变与碰撞检测,为手术操作提供了技术支持。陈杰基于Unity3D平台实现了虚拟肝脏手术的形变与切割仿真,展示了游戏引擎在医学仿真中的应用潜力。这些研究为可变形物体的形变建模提供了不同的技术路径,为后续触觉交互系统的开发奠定了基础。 + +在触觉渲染与反馈方面,陈大鹏等[4]提出了一种数据驱动的纹理摩擦建模方法,通过采集真实物体的纹理数据来提升触觉渲染的真实性。陈庚[6]进一步研究了虚拟纹理多维属性的力触觉建模与再现方法,将触觉反馈从单一的力值扩展到粗糙度、摩擦系数等多维属性。这些工作表明,数据驱动方法在提升触觉真实性方面具有显著优势。 + +在软组织力学建模方面,刘代清[5]从手法淋巴引流的角度出发,建立了皮肤软组织的力学模型,并进行了淋巴动力学的有限元分析。胡子阳等[1]则将CBAM注意力机制引入到人体软组织的多物理场建模中,实现了快速同步建模。这些研究为可变形物体的物理参数设置提供了理论依据。 + +在XR交互系统方面,王宏润[2]研究了触觉增强的XR自然手势交互系统,探讨了如何在XR环境中实现自然的手势识别与触觉反馈。刘浩城[3]针对软组织的安全交互问题,提出了针灸机器人的柔性末端控制方法,强调了安全机制在软体操作中的重要性。 + +\subsubsection{国外研究现状} + +国外学者在可变形物体触觉交互领域的研究起步较早,在理论方法与系统实现方面均有较多积累。 + +在可变形物体操作方面,Blanco-Mulero D.[10]通过学习动力学模型与自适应策略,实现了可变形物体的高效机器人操作。该研究表明,学习算法能够有效处理可变形物体的非线性特性,为触觉交互中的力控制提供了参考。Kundu S.[11]则专注于布料类可变形物体的抓取质量评估,提出了多种评估指标,为量化可变形物体交互效果提供了方法。 + +在触觉交互系统方面,de Santis E等人[12]的工作与本研究密切相关。该研究在I-RIM 3D 2024会议上发表了题为"Haptic interaction with virtual deformable objects"的论文,提出了一套完整的触觉交互系统架构。该系统集成了MuJoCo物理引擎、WEART触觉手套和VR头显,实现了与虚拟可变形物体的实时触觉交互。该研究不仅展示了触觉交互的可行性,还提供了详细的实验设计和评估方法,为后续研究提供了重要参考。 + +\subsubsection{发展趋势} + +综合国内外研究现状,可变形物体触觉交互技术呈现出以下发展趋势。 + +首先,技术融合趋势明显。传统的有限元方法、弹簧-质点模型等物理仿真技术,正在与深度学习、数据驱动方法相结合。例如,胡子阳等[1]将注意力机制引入软组织建模,陈大鹏等[4]利用数据驱动方法进行纹理摩擦建模。这种技术融合能够充分发挥各方法的优势,提升触觉交互的真实性和准确性。 + +其次,评估体系日趋完善。早期研究多依赖主观评价或单一指标,而近期研究越来越重视量化评估。Kundu S.提出了抓取质量评估指标,de Santis E等人[12]在实验中使用了多种量化指标。建立完善的评估体系,有助于客观比较不同方法的优劣,推动技术进步。 + +最后,应用场景不断拓展。从最初的虚拟手术仿真,扩展到机器人操作、XR交互、康复训练等多个领域。王宏润[2]的研究展示了触觉交互在XR系统中的应用,刘浩城[3]的工作则体现了触觉技术在康复领域的潜力。 + +\subsubsection{对本人研究的启发} + +基于上述文献分析,本研究将围绕DeformableSimulation项目展开可变形物体触觉交互的实验与评估工作。 +在可变形物体建模方面,可以参考马雨前[7]、冯上涛[9]等人的研究,利用MuJoCo的flexcomp元素创建不同类型的可变形物体,包括网格型、椭球型和基于Gmsh网格的复杂生物组织模型。 +在触觉反馈方面,可以借鉴陈大鹏等[4]、陈庚[6]的数据驱动方法,优化项目中的纹理映射机制,将触觉反馈从单一的力值扩展到多维属性。 +在系统集成方面,de Santis E等人[12]的工作提供了完整的系统架构参考,包括硬件集成、软件设计、触觉反馈映射等关键环节。 +在评估体系方面,可以参考Kundu S.[11]的量化评估方法,建立包含接触力、纹理匹配度、系统性能等多维指标的评估体系。 +通过以上研究,本研究将实现可变形物体触觉交互的规范化流程,并输出可量化的评估结果,为相关领域的研究提供参考。 + +\subsection{研究方法与思路} + +本研究基于DeformableSimulation项目,采用MuJoCo物理引擎作为仿真平台,结合WEART TouchDIVER触觉手套与Oculus Rift S VR头显,构建可变形物体触觉交互系统。 + +研究方法主要包括可变形物体建模、触觉反馈机制、运动重定向算法以及系统性能评估四个方面。 + +1.在可变形物体建模方面,本研究利用MuJoCo的flexcomp元素创建多种类型的可变形物体,通过设置不同的类型参数(grid、ellipsoid、gmsh)、弹性参数(杨氏模量、泊松比、阻尼系数)和约束条件(固定节点、碰撞检测),实现软体立方体、软体球体、软体布料垫以及生物组织(如左肾、肝脏)等可变形物体的建模,其中grid型适用于规则形状的软体,ellipsoid型适用于球形可变形物体,gmsh型则用于复杂生物组织的建模。 + +2.在触觉反馈机制方面,本研究建立力值计算与纹理映射的双通道反馈机制,力值通道通过MuJoCo的touch传感器检测手指与可变形物体的接触,将物理引擎计算的接触力归一化为0-1范围的触觉强度,并通过WEART手套施加到用户手指,纹理通道根据接触的可变形物体类型,从预定义的纹理映射表中获取对应的纹理类型(如ProfiledRubberSlow、CrushedRock、VenetianGranite),实现触觉纹理的差异化反馈。 + +3.在运动重定向方面,本研究实现真实手部运动到虚拟手部的映射,通过Oculus Rift S控制器获取手部的位置与姿态信息,利用运动重定向算法将其转换为虚拟手部的mocap位置和四元数旋转,同时通过WEART手套获取手指的闭合度与外展角,将其映射到虚拟手指的关节角度,实现手指运动的精确控制。 + +4.在系统性能评估方面,本研究建立多维度的评估体系,通过固定测试集(包含不同类型的可变形物体),记录接触力值、纹理反馈类型、系统帧率、交互延迟等量化指标,同时设计对比实验,比较不同可变形物体(不同弹性参数、不同几何形状)的触觉反馈效果,分析触觉交互的真实性与稳定性。 + +研究思路遵循"建模-交互-评估"的闭环流程,首先基于MuJoCo创建可变形物体模型,设置合理的物理参数,其次集成硬件设备,实现触觉交互系统的搭建,再次开展交互实验,收集触觉反馈数据,最后分析实验结果,评估触觉交互的效果,并提出改进方案,通过这一研究思路,本研究旨在实现可变形物体触觉交互的规范化流程,并为相关领域的研究提供可复现的实验数据与方法参考。 + +\subsubsection{主要工作任务} + +1. 明确选题内涵:深入理解可变形物体触觉交互与实时仿真技术的核心原理,厘清基于 MuJoCo 引擎、WEART 触觉手套及 VR 设备的系统核心概念、技术框架与研究价值,界定研究的关键技术边界。 + +2. 文献综述与研究现状分析:系统收集国内外可变形物体建模、触觉渲染、多模态交互系统及相关物理引擎应用的研究文献,全面梳理研究现状,总结主流方法、技术瓶颈与发展趋势,明确本研究的切入点。 + +3. 确定研究思路与方法:在文献分析基础上,制定 “建模 - 交互 - 评估” 的闭环研究技术路线,明确实验环境搭建方案、系统开发框架、核心算法设计思路及评估指标体系,形成完整可行的研究方案。 + +4. 系统架构设计与可视化表达:使用 Visio 等绘图工具绘制系统整体架构图、模块交互流程图、数据传输链路图等,清晰展现硬件设备接入、软件模块划分及各环节数据流向,为系统开发提供明确指导。 + +5. 前期需求分析与技术设计:开展详细技术需求分析,包括硬件设备兼容需求、可变形物体模型参数设计、触觉反馈映射规则、运动重定向算法参数、系统实时性要求等,完成系统概要设计与详细设计文档。 + +6. 系统实现与功能验证:基于 DeformableSimulation 项目基础,实现可变形物体触觉交互系统。详细完成可变形物体建模(含规则形状与复杂生物组织)、触觉反馈机制(力值计算与纹理映射)、运动重定向等核心模块开发,阐述关键技术创新点,提供完整功能验证结果。 + +7. 实验结果分析与评估:设计标准化实验方案,包括不同类型可变形物体的交互测试、纯视觉与视触融合模式的对比实验等。采集接触力值、系统帧率、交互延迟、任务完成质量等量化数据,使用专业工具进行数据分析,验证系统性能与触觉反馈有效性。 + +8. 论文撰写与成果整理:按照学术论文规范,完成从选题背景、文献综述、系统设计、实验验证到结论展望的完整论文撰写,按时完成论文修改、定稿及答辩准备工作,确保研究成果的系统性与规范性。 + +\subsection{基本要求} + +1. 文献综述要求:文献调研需全面覆盖国内外最新研究成果,至少包含 20 篇以上核心文献(含中外文献),综述需分层分类归纳,既总结现有技术方法,又分析研究空白与不足,为研究提供坚实理论依据。 + +2. 系统开发要求:基于 MuJoCo 物理引擎、WEART TouchDIVER 触觉手套及 Oculus Rift S VR 头显实现系统开发,确保硬件设备兼容、软件模块接口清晰、代码可运行可复现。系统需支持多种可变形物体建模,实现力值与纹理双通道触觉反馈,保证实时响应(帧率稳定、低延迟)。 + +3. 实验验证要求:实验设计科学严谨,包含不同物理属性(弹性、阻尼、几何形状)的可变形物体测试集,设置纯视觉与视触融合两种对比场景。评估指标需涵盖系统性能(帧率、延迟)、交互效果(接触力准确性、纹理辨识度)、任务完成质量(耗时、成功率)等维度,所有实验结果需有详细数据记录与可视化展示。 + +4. 论文质量要求:论文观点明确、结构完整、层次清晰,技术描述准确详实,实验数据充分,分析论证严谨。语言表达通顺规范,符合学术写作要求,图表清晰规范,能完整呈现研究过程与成果。 + +5. 理论与实践结合:充分体现专业知识与工程实践的有机结合,展示运用物理仿真、触觉交互等理论解决实际问题的能力,技术方案需有理论支撑,实验结果需有深入理论分析。 + +6. 学术规范要求:严格遵守学术道德规范,所有引用文献均需正确标注,实验数据真实可靠,杜绝任何形式的学术不端行为。 + +7. 追求卓越标准:以高质量完成毕业设计为目标,在技术实现、实验设计、论文撰写等各环节追求高标准,力争研究成果达到良好以上水平。 + +\subsection{论文结构或写作提纲} + +第一章 绪论 + 阐明可变形物体交互仿真的研究背景与意义,分析当前软体接触建模面临的主要瓶颈,明确本研究的核心目标与技术路线。 + +第二章 相关工作 + 梳理可变形物体仿真、触觉渲染算法及多模态交互系统的研究现状,比较主流物理引擎的性能差异,论证本课题技术方案的合理性。 + +第三章 系统架构与仿真环境搭建 + 介绍硬件设备接入方式与软件接口设计,说明如何构建三组以上物理属性差异显著的可变形物体模型,并制定配套交互任务。 + +第四章 触觉建模与控制策略实现 + 阐述接触力参数提取方法,提出仿真力到触觉信号的映射算法,设计多线程控制框架以保证视觉与力觉的协调运行。 + +第五章 实验设计与结果分析 + 设计标准化操作任务,对比纯视觉与视触融合两种模式下的操作表现,以统计数据验证触觉反馈的有效性。 + +第六章 讨论与局限性分析 + 剖析系统性能表现,分析模型简化、设备带宽、传输延时等因素的影响,对典型失败案例进行归因。 + +第七章 总结与展望 + 归纳研究成果与创新点,探讨后续改进方向。 diff --git a/tactile/undergraduat/.gitignore b/tactile/undergraduat/.gitignore new file mode 100644 index 00000000..c89dc294 --- /dev/null +++ b/tactile/undergraduat/.gitignore @@ -0,0 +1,246 @@ +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb +clean.bat +elegant*-cn.pdf +elegant*-en.pdf +*.dates + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Comment the next line if you want to keep your tikz graphics files +*.tikz +*-tikzDictionary + +# listings +*.lol + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# easy-todo +*.lod + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices +*.xyc + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# Kile +*.backup + +# KBibTeX +*~[0-9]* + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# generated if using elsarticle.cls +*.spl diff --git a/tactile/undergraduat/README.md b/tactile/undergraduat/README.md new file mode 100644 index 00000000..74029dba --- /dev/null +++ b/tactile/undergraduat/README.md @@ -0,0 +1,38 @@ +# 本科毕业设计模板 + +湖南工商大学本科毕业设计模板。 + +# 使用 +推荐使用 [texstudio](https://pan.baidu.com/s/1Is2-VR1z-tMYvmdinsVY_g?pwd=hutb) 或 [overleaf](https://cn.overleaf.com/) 进行论文撰写。 + +注:在 latex 2023 中编译成功,latex 2016 编译失败(需要更高的版本,其他版本的 latex 没试过)。 + +# 贡献 +有任何对模板格式进行调整的可以提交 [Issues](https://github.com/OpenHUTB/undergraduate/issues) 或 [Pull Request](https://github.com/OpenHUTB/undergraduate/pulls) 。 + +# 选题 +[选题列表](https://github.com/OpenHUTB/undergraduate/wiki/%E6%AF%95%E8%AE%BE%E9%80%89%E9%A2%98) + + +## 要求 +1. 格式化、注释、文档翻译 +2. 运行 +3. 测试(例子通过) + + +## 初始化 + +1. 新建github工程 + +2. 运行`init_proj('PROJECT_NAME');` + +3. 分配开发者 + + +## 使用 +克隆仓库 +```shell +git clone --recursive https://github.com/OpenHUTB/undergraduate.git +``` + +# 贡献者 diff --git a/tactile/undergraduat/cmdel.bat b/tactile/undergraduat/cmdel.bat new file mode 100644 index 00000000..c9642e0a --- /dev/null +++ b/tactile/undergraduat/cmdel.bat @@ -0,0 +1,2 @@ +del /a /f *.xml *.bcf *.out *.log *.sav *.gz *.aux *.bbl *.bak *.dvi *.blg + diff --git a/tactile/undergraduat/content/abstracten.tex b/tactile/undergraduat/content/abstracten.tex new file mode 100644 index 00000000..8d2feaeb --- /dev/null +++ b/tactile/undergraduat/content/abstracten.tex @@ -0,0 +1,7 @@ +%!TEX root = ../csuthesis_main.tex +\keywordsen{Pedestrian navigation, Reinforcement learning, Virtual simulation, Carla platform, Path planning, Obstacle avoidance} +\begin{abstracten} + +With the advancement of smart city infrastructure, pedestrian navigation systems face increasing challenges in handling complex and dynamic urban environments. Traditional rule-based planning approaches struggle to adapt to real-time variations in pedestrian behavior. This study proposes a pedestrian navigation and control system based on the Unreal Engine and Carla platform, integrating reinforcement learning to optimize path planning and obstacle avoidance. By simulating realistic traffic scenarios, the system provides a high-fidelity virtual environment for training and evaluating intelligent agents. Reinforcement learning algorithms such as DQN and PPO are applied to improve navigation decision-making, guided by a multi-dimensional reward function that balances goal achievement, safety, and path efficiency. Experiments conducted in various simulation scenarios demonstrate the system's effectiveness in enhancing navigation accuracy, obstacle avoidance success, and overall planning efficiency. The results validate the feasibility of combining virtual simulation with reinforcement learning, offering a scalable and cost-effective approach to intelligent pedestrian navigation, and laying the groundwork for future research in multi-agent collaboration and intelligent traffic systems. + +\end{abstracten} diff --git a/tactile/undergraduat/content/abstractzh.tex b/tactile/undergraduat/content/abstractzh.tex new file mode 100644 index 00000000..bc0bba71 --- /dev/null +++ b/tactile/undergraduat/content/abstractzh.tex @@ -0,0 +1,9 @@ +%!TEX root = ../csuthesis_main.tex +% 设置中文摘要 +\keywordscn{行人导航\quad 强化学习\quad 虚拟仿真\quad Carla平台\quad 路径规划\quad 避障} +%\categorycn{TP391} +\begin{abstractzh} + +智慧城市环境下交通环境对行人导航的要求更高,传统的基于规划路径的方式已经无法满足动态、复杂环境下行人的变化。为了提升行人导航的自适应能力和路径规划效率,本文在虚幻引擎与Carla中模拟一个真实的步行环境,构建一个具备强学习能力的行人控制和行人导航系统,动态仿真真实城市的交通环境,为行人强化学习模型提供测试、训练环境。本文将DQN、PPO等强化学习算法引入行人控制和行人避障,设计多维度奖励函数提升智能体对目标、避障、路径的理解能力,从而提升复杂交通环境下行人的决策能力。对行人导航、避障和路径多场景仿真评估,验证了系统在动态、复杂环境下的鲁棒性。验证了虚拟仿真和强化学习的融合可以拓展智慧交通应用领域,对多智能体协同智能交通未来发展提供可行性方案与路径支撑。 + +\end{abstractzh} diff --git a/tactile/undergraduat/content/acknowledgements.tex b/tactile/undergraduat/content/acknowledgements.tex new file mode 100644 index 00000000..c6a858ba --- /dev/null +++ b/tactile/undergraduat/content/acknowledgements.tex @@ -0,0 +1,20 @@ +%!TEX root = ../csuthesis_main.tex +\begin{acknowledgements} + +当我敲下论文的最后一个句号,本科生活也即将画上圆满的句点。回顾撰写论文的日子,虽困难重重,但我切实体会到了学术研究的严谨和价值,也对未来的研究生学术生活满怀期待。在此,我真心感谢所有给予我支持和帮助的老师、朋友和家人。 + +感谢虚幻引擎官方认证讲师谌嘉诚老师。我最初接触 UE4,是因为看到他开发的游戏。那些精彩作品在我心中种下了成为游戏开发者的种子,也促使我选定了现在这篇论文。谌老师的作品不仅引领我进入游戏开发领域,还激励我在这条路上不断探索。 + +感谢湖南工商大学前沿交叉学院、人工智能与先进计算学院、工商管理学院的全体老师,本科四年,是他们的辛勤教导为我奠定了扎实的专业基础。感谢我的导师王海东老师,没有您的帮助我无法完成论文。 + +感谢前沿交叉学院的刘利枚老师。不管是备考研究生时给我的鼓励,还是落榜时送来的安慰,都让我感受到温暖与力量,帮我在挫折中重新振作。感谢辅导员刘振坤老师,他为我的考研提供了许多实用指导,让迷茫的我找到了方向。还要感谢论文开题和中期答辩时提出宝贵意见的评审专家,他们的批评和建议让我的研究逻辑更严密,也为我未来的学术研究定下严谨基调。 + +感谢室友李勇、朱栋、全松林、资龙、邓哲,还有谭子钰、张子阳、杨钊等等我的大学好友们,以及我的女朋友李玲俊。四年同窗,我们一起学习、生活,分享成长中的喜怒哀乐。那些一起奋斗的日子和欢声笑语,都是我大学生活中最珍贵的回忆,也会成为我人生中最重要的一笔财富。 + +感谢我的父母和家人。他们一直包容理解我,支持我的每一个选择。在我焦虑迷茫时,给予精神鼓励和安慰,让我能专心备考考研、撰写论文。感谢妈妈在我人生关键节点为我指明方向,感谢爸爸尊重我的想法和选择,让我能按自己的意愿追逐梦想,感谢舅舅在求学路上给我的诸多帮助,让我感受到家人的温暖与力量。 + +最后,我也要感谢自己。大学四年,从初入校园的懵懂,到如今目标明确、步伐坚定,即使前路满是艰辛与挑战。希望未来,我能带着这份坚持和勇气,朝着目标不断奋进,在学术和人生道路上取得更好成绩 。 + +行文终有尽时,感激永不停止,谨以此论文献给所有关心帮助过我的人! + +\end{acknowledgements} diff --git a/tactile/undergraduat/content/appendix.tex b/tactile/undergraduat/content/appendix.tex new file mode 100644 index 00000000..b24041bf --- /dev/null +++ b/tactile/undergraduat/content/appendix.tex @@ -0,0 +1,216 @@ +\chapter{代码} + +\section{行人导航系统伪代码} + +\renewcommand{\thealgorithm}{A.\arabic{algorithm}} + +\begin{algorithm}[H] +\caption{Carla行人导航系统主流程} +\begin{algorithmic}[1] +\STATE 启动GUI窗口,初始化控件与信号连接 +\STATE 点击“初始化环境”时: + \STATE \quad 连接Carla服务器,加载Town01地图 + \STATE \quad 解析CSV文件构建k近邻导航图,检测最大连通子图 + \STATE \quad 筛选有效生成点并设置SpinBox编号范围 +\STATE 点击“开始训练”时: + \STATE \quad 获取训练参数(学习率、GAE λ、熵系数等) + \STATE \quad 创建训练线程 \texttt{TrainingThread},初始化PPO模型 + \STATE \quad 每n\_steps同步训练进度,每50 episode保存检查点 +\STATE 点击“运行演示”时: + \STATE \quad 加载预训练模型,基于A*路径执行导航 + \STATE \quad 实时绘制轨迹点与规划路径箭头 +\STATE 进入主事件循环,处理可视化工具操作与线程控制 +\end{algorithmic} +\end{algorithm} + +\begin{algorithm}[H] +\caption{环境类 \texttt{EnhancedPedestrianEnv} 核心结构} +\begin{algorithmic}[1] +\STATE 初始化:连接Carla服务器,构建可行走点导航图 +\STATE 筛选有效生成点(验证Spawn点可生成性) +\STATE 定义动作空间(5维离散动作),观察空间(12维状态向量): + \STATE \quad 归一化位置、目标方向、障碍距离、路径偏离等 +\STATE 每步执行: + \STATE \quad 解析动作(转向角+速度比),计算安全速度 + \STATE \quad 基于目标方向自动调整偏航角 + \STATE \quad 应用行人控制并更新轨迹可视化 + \STATE \quad 计算奖励:目标接近奖励 + 路径跟随奖励 - 碰撞惩罚 + \STATE \quad 激光雷达障碍检测(最小距离更新) +\STATE 路径规划: + \STATE \quad 基于CSV导航点构建图结构,执行A*搜索 + \STATE \quad 合法性检查(起点/终点在最大连通子图中) +\STATE 重置环境时清理旧Actor,重新生成传感器与标记 +\end{algorithmic} +\end{algorithm} + +\begin{algorithm}[H] +\caption{训练线程 \texttt{TrainingThread} 流程} +\begin{algorithmic}[1] +\REQUIRE 环境参数(起止点编号、摄像头跟随标志) +\REQUIRE 训练参数(n\_steps=4096, batch\_size=256, total\_steps=1e5) +\STATE 初始化向量化环境 \texttt{DummyVecEnv} +\STATE 配置PPO策略网络(双128层ReLU网络) +\STATE for $step \leftarrow 0$ to \texttt{total\_steps} by \texttt{n\_steps} do + \STATE 执行策略rollout收集经验数据 + \STATE 计算GAE优势估计,更新策略参数 + \STATE 同步训练进度至GUI(奖励曲线、进度条) + \IF{episode\_count \% 50 == 0} + \STATE 保存检查点(时间戳命名) + \ENDIF +\STATE 保存最终模型,释放GPU显存 +\end{algorithmic} +\end{algorithm} + +\begin{algorithm}[H] +\caption{导航图构建与路径规划} +\begin{algorithmic}[1] +\REQUIRE CSV可行走点文件(x,y,z,index) +\STATE 加载CSV点集,构建无向图G +\STATE for each point $p_i$: + \STATE \quad 查找k个最近邻点,添加带权边(距离为权重) +\STATE 提取最大连通子图,缓存合法节点索引 +\STATE 路径搜索: + \STATE \quad 查找起点/终点最近图节点 + \STATE \quad 执行A*算法(启发函数为欧氏距离) + \STATE \quad 路径合法性验证(节点在连通子图中) +\STATE 返回路径点列表,转换为Dummy Waypoint格式 +\end{algorithmic} +\end{algorithm} + + +% 用户手册章节 +\chapter{用户手册} + +\section{Carla 行人导航系统使用指南} + +\begin{table}[H] +\centering +\renewcommand{\arraystretch}{1.3} +\begin{tabular}{ + >{\centering\arraybackslash}p{3cm} + >{\centering\arraybackslash}p{8cm} + >{\centering\arraybackslash}p{4cm} +} +\toprule +\textbf{版本号} & \textbf{描述} & \textbf{日期} \\ +\midrule +v1.4.0 & 新增导航图连通性分析、路径合法性检测、PyQt6界面升级 & 2025年5月17日 \\ +\bottomrule +\end{tabular} +\caption{系统版本信息} +\label{tab:version-info} +\end{table} + +\subsection{系统简介} +本系统基于Carla 0.9.15与PyQt6框架,集成以下创新特性: +\begin{itemize} +\item 基于CSV可行走点构建k近邻导航图,支持最大连通子图提取 +\item 增强路径合法性检测机制,自动提示不可达路径 +\item 动态轨迹可视化(绿色轨迹点 + 红色路径箭头) +\item 多线程训练架构,支持CUDA加速与模型检查点保存 +\end{itemize} + +\subsection{配置要求} +\subsubsection*{硬件配置} +\begin{itemize} +\item GPU:支持CUDA 11.7+(需8GB显存) +\item 内存:16GB DDR4(训练时建议32GB) +\end{itemize} + +\subsubsection*{软件依赖} +\begin{itemize} +\item \texttt{PyQt6}取代PyQt5,需通过pip安装: +\begin{lstlisting}[language=bash] +pip install pyqt6 carla gymnasium stable-baselines3 +\end{lstlisting} +\item Carla PythonAPI需与服务器版本匹配(0.9.15) +\end{itemize} + +\subsection{GUI模块详解} +\begin{figure}[H] +\centering +\includegraphics[width=1\textwidth]{images/gui_layout.pdf} +\caption{GUI界面功能分区示意图} +\label{fig:gui-layout} +\end{figure} + +\subsubsection*{新增功能控件} +\begin{itemize} +\item 路径合法性检测:点击后扫描CSV文件,输出可达路径对 +\item 清除调试标记:一键清除Carla世界中的所有可视化对象 +\item 摄像头视角跟随:勾选后第三人称视角跟踪行人移动 +\end{itemize} + +\subsection{训练参数优化建议} +\begin{table}[H] +\centering +\renewcommand{\arraystretch}{1.2} +\caption{关键参数经验值} +\begin{tabular}{lll} +\toprule +\textbf{参数} & \textbf{推荐值} & \textbf{作用} \\ +\midrule +k近邻数 & 6 & 平衡图连通性与计算效率 \\ +路径偏离半径 & 2.0m & 控制路径跟随奖励的阈值 \\ +同步模式帧率 & 50FPS & 保证传感器数据时序一致性 \\ +目标容差 & 1.5m & 判定到达目标的距离阈值 \\ +\bottomrule +\end{tabular} +\end{table} + +\subsection{典型工作流程} +\begin{enumerate} +\item \textbf{环境预配置}: + \begin{lstlisting}[language=bash] + # 生成可行走点CSV(需提前运行) + python generate_walkable_points.py --town Town01 + \end{lstlisting} +\item \textbf{训练阶段}: + \begin{itemize} + \item 设置起点/终点编号跨度>50以保证路径复杂度 + \item 首次训练建议启用"摄像头跟随"以实时观察策略表现 + \end{itemize} +\item \textbf{演示阶段}: + \begin{itemize} + \item 加载模型后点击"显示可行走点"验证起终点位置 + \item 路径异常时可点击"清除标记"重新规划 + \end{itemize} +\end{enumerate} + +\begin{table}[H] +\centering +\renewcommand{\arraystretch}{1.3} +\caption{增强版故障排查指南} +\begin{tabular}{ + >{\centering\arraybackslash}p{6cm} + >{\centering\arraybackslash}p{9cm} +} +\toprule +\textbf{现象} & \textbf{解决方案} \\ +\midrule +A*路径搜索失败 & 检查CSV文件完整性,确保起终点在最大连通子图内 \\ +激光雷达无数据 & 验证行人高度是否>2m(z=2.5的安装位置) \\ +训练时奖励震荡 & 降低学习率至1e-5,增加batch\_size至512 \\ +GUI线程卡死 & 避免在训练过程中操作SpinBox控件 \\ +\bottomrule +\end{tabular} +\end{table} + +\subsection{开发者扩展接口} +\begin{itemize} +\item 自定义路径规划算法: +\begin{lstlisting}[language=Python] +def _generate_path(self): + # 重写此方法实现RRT等算法 +\end{lstlisting} +\item 增加观测维度: +\begin{lstlisting}[language=Python] +# 修改observation_space与_get_obs() +self.observation_space = spaces.Box(...) +\end{lstlisting} +\item 添加新传感器: +\begin{lstlisting}[language=Python] +def _attach_sensors(self): + # 参照_lidar配置新增RGB相机等 +\end{lstlisting} +\end{itemize} diff --git a/tactile/undergraduat/content/chapter1.tex b/tactile/undergraduat/content/chapter1.tex new file mode 100644 index 00000000..23ff5cf0 --- /dev/null +++ b/tactile/undergraduat/content/chapter1.tex @@ -0,0 +1,112 @@ +\chapter{绪论} + +\section{研究背景与意义} + +智慧城市与智能交通发展背景下行人导航与控制系统在现代交通管理中作用重要。行人作为城市交通系统的重要组成部分其行为具有显著随机性和多样性给传统交通管理和路径规划方法带来诸多挑战,行人导航系统研究旨在通过实时路径优化与智能调控提升行人交通安全与出行效率。但传统导航方法多基于规则模型主要依赖静态预设参数,难以应对复杂动态环境中行人行为的快速变化,比如面对突发障碍物或密集交通流动时传统算法常无法快速调整路径规划或实时优化决策进而影响导航系统可靠性与安全性。 + +近年来人工智能技术快速发展,强化学习作为数据驱动的决策优化方法为行人导航领域提供全新思路,其通过智能体与环境交互学习最优策略能在动态环境中实现实时决策优化,特别适用于非线性非结构化的复杂场景。不过仅依靠强化学习技术难以全面解决行人导航问题,现实环境中数据采集的高成本高风险特性在实际应用中极大限制了强化学习的训练与推广。 + +\begin{figure}[H] + \centering + \begin{subfigure}{0.48\textwidth} + \includegraphics[width=\linewidth]{images/Unreal_Engine.pdf} + \end{subfigure} + \hfill + \begin{subfigure}{0.48\textwidth} + \includegraphics[width=\linewidth]{images/Carla.pdf} + \end{subfigure} + \caption{虚幻引擎和Carla} + \label{fig:CarlaUE} +\end{figure} + +本研究基于 Carla 利用虚幻引擎(Unreal Engine)这一高仿真度虚拟场景构建平台提供了解决实际环境数据采集困难的理想工具,如图 \ref{fig:CarlaUE}所示。该引擎既能生成复杂多样的动态环境也能模拟真实场景中行人行为的随机性和多样性,为强化学习智能体的训练与测试提供安全低成本的实验平台。如通过虚幻引擎模拟十字路口复杂交通场景可逼真再现行人与车辆的动态交互,为强化学习算法的优化与验证创造实验条件,且其支持生成视觉、惯性、语义信息等多种传感器数据进一步丰富了强化学习的训练数据来源。 + +本研究结合虚拟仿真技术和强化学习算法解决行人导航核心问题,包括精准建模动态环境下行人行为,行人行为受交通信号、周围车辆动态变化及其他行人行为等多种因素影响,建立能真实反映不同环境中行人决策逻辑的高精度行人行为模型是首要难题;高效结合虚拟仿真与强化学习,强化学习有效性依赖训练环境质量,虚幻引擎仿真能力为训练高效智能体提供可能,但设计能充分利用虚幻引擎生成的多样化数据的高效强化学习算法亟待解决;平衡路径规划效率与行人安全性,行人导航系统要提高路径规划效率并优先考虑行人安全,如在交通高峰期复杂场景中找到安全高效路径是研究重点。 + +智慧交通系统发展对行人导航系统提出更高要求,既需与车辆、交通信号灯等其他交通参与者无缝协作以优化交通系统运行效率,随着多智能体技术发展,行人导航系统研究也从单一智能体优化转向多智能体协作,通过多智能体协同作用提升导航效率与安全性是未来重要研究方向。 + +本研究引入虚幻引擎仿真能力与强化学习自适应策略优化能力试图突破上述问题,虚幻引擎的逼真场景和多样化数据为复杂行为建模和智能体训练提供支持,强化学习算法自适应优化能力使智能体可快速适应复杂动态环境变化,两者结合能为行人导航系统提供新理论和技术支撑,在智能交通、自动驾驶和城市规划等领域有广泛应用潜力。 + +\section{国内外研究现状} + +近年来强化学习与虚拟仿真技术在智能交通和行人导航领域研究取得显著进展,从强化学习在行人导航中的应用、虚幻引擎在智能体训练中的作用以及行人导航的挑战与发展趋势三方面进行综述。 + +\subsection{强化学习在行人导航中的应用} + +强化学习(Reinforcement Learning, RL)是一种通过智能体与环境交互学习最优策略的方法,近年来在交通系统优化和行人导航中得到了广泛应用。与传统路径规划方法相比,强化学习不仅可以应对动态环境,还能通过不断训练提高系统性能,展现了较高的自适应性和优化能力。强化学习技术在交通信号控制取得重要成果,钱立军等\cite{qian2024sac}基于 SAC 算法优化多交叉口交通信号控制提升交通通行效率,为动态环境复杂信号调度提供新思路,Arulkumaran等\cite{arulkumaran2017deeprl}系统阐述了深度强化学习在动态决策中的理论优势,Wei 等\cite{wei2021survey}综述强化学习在交通信号控制研究进展指出深度强化学习(Deep Reinforcement Learning, DRL)解决非线性优化问题优势适用于实时动态交通场景;在路径规划领域应用广泛,陶幸等\cite{tao2024motion}提出基于惯性传感器免对准动作捕捉方法为动态场景行人行为建模提供技术支持,Chen 等\cite{chen2018ionet}结合深度学习与强化学习技术设计基于因果推理路径优化方法引入因果关系提升智能体在动态环境适应能力;深度强化学习为路径规划研究注入新动力,Mnih 等\cite{mnih2013dqn}首次提出深度 Q 学习(Deep Q - Learning, DQN)算法将深度神经网络引入强化学习框架提升其在高维状态空间表现能力;在多智能体协作问题广泛研究,Clifton等\cite{clifton2020qlearning}系统论证了Q-learning算法在动态决策中的理论优势,Lian 等\cite{lian2023inverseql}设计基于离线 Q 学习多智能体协作算法解决复杂动态场景全局优化问题,Zhang等\cite{zhang2019pedestrian}提出的行人安全感知信号控制策略,Yazdani等\cite{yazdani2023ivpl}开发的IVPL系统进一步验证了深度强化学习在行人优先信号控制中的有效性,厦门路桥信息\cite{xiamen2025}开发的碰撞预测系统通过多智能体实时交互,将高风险路口预警准确率提升至89\%。Luo等\cite{luo2023adaptive}提出的自适应道路配置算法通过分布式强化学习范式,在行人流量动态调整中实现了49.55\%的计算成本优化。 + +\subsection{虚幻引擎在智能体训练中的作用} + +虚幻引擎作为高仿真虚拟场景构建工具为复杂动态环境下强化学习算法训练和验证提供高效实验平台,借由强大虚拟仿真能力和多样化场景支持成为智能体训练测试重要工具。 + +1. \textbf{虚幻引擎在视觉导航研究中的应用:} 虚幻引擎在视觉导航研究应用广泛,Redmon等\cite{redmon2017yolo9000}通过虚幻引擎生成增强数据训练 YOLO 目标检测模型,Mourikis 等\cite{mourikis2007msckf}结合虚幻引擎构建视觉惯性导航系统并通过多状态约束卡尔曼滤波(MSCKF)算法优化路径规划,Howard等\cite{howard2017mobilenets}提出的轻量化网络为实时目标检测提供了重要技术支持,Campos 等\cite{campos2021orbslam3}提出的 ORB-SLAM3 算法利用虚拟场景数据显著提升视觉建图与定位的鲁棒性和精度为复杂动态环境中的导航提供有力支持,DSR-YOLO模型\cite{dsryolo2025}通过集成DCNv4和SimAM注意力机制,在CityPersons数据集上实现70.25\%的mAP@50。STI-Bench基准测试\cite{sti2025}显示当前多模态大模型在时空量化任务中平均准确率不足42\%。 + +2. \textbf{虚幻引擎在路径规划中的贡献:} 虚幻引擎于路径规划研究表现重要作用,Guo 等\cite{guo2020pdr}结合虚幻引擎动态仿真能力提出基于 PDR/UWB 融合的导航系统用于复杂环境行人路径优化,Wang 等\cite{wang2023llio}通过虚幻引擎构建高仿真交通场景训练强化学习智能体路径规划策略验证其在强化学习训练中的高效性和低成本特性。 + +3. \textbf{虚幻引擎与目标检测的结合:} 虚幻引擎还被用于目标检测与路径规划结合研究,Redmon 等\cite{redmon2017yolo9000}通过虚幻引擎生成增强数据训练 YOLO 目标检测模型提高目标检测在复杂场景中的表现能力,Ren等\cite{ren2017fasterrcnn}提出的目标检测框架为动态障碍物识别提供了新思路,Zhang等\cite{zhang2023shapeiou}提出的Shape-IoU指标为动态障碍物检测精度评估提供了更优的度量标准,Simonyan 和 Zisserman 等\cite{simonyan2014action}进一步研究虚幻引擎对深度学习模型的优化作用为复杂交通场景下的行为预测提供理论支持。 + +4. \textbf{虚幻引擎在多智能体协作中的应用:} 虚幻引擎的仿真能力在多智能体协作研究中广泛应用,Bochkovskiy 等\cite{bochkovskiy2020yolov4}开发基于虚幻引擎的交通流量仿真工具验证多智能体协作算法有效性,Campos 等\cite{campos2021orbslam3}通过虚拟场景数据验证智能体在多智能体协作场景中的优化表现为行人导航系统的多智能体研究提供重要支持,Liu等\cite{liu2020tlio}通过紧耦合学习方法改进了惯性里程计精度。 + +虚幻引擎为强化学习算法设计训练与验证提供有力支持,在视觉导航路径规划与多智能体协作中的应用展现巨大潜力。 + +\subsection{行人导航的挑战与发展趋势} + +行人导航技术虽取得显著进展但在复杂动态环境中仍存复杂行为建模、动态环境适应性及多智能体协作优化等诸多挑战。 + +1. \textbf{行人行为的复杂建模:} 行人行为具显著多样性与随机性,赵靖等\cite{zhao2014crossing}提出基于动态信号优化的行人过街模型通过行为建模提升信号控制效率与安全性,Foxlin 等\cite{foxlin2005tracking}设计基于惯性传感器的行人轨迹跟踪方法为复杂行为建模提供技术支持。长沙智慧信号灯系统\cite{changsha2021}通过LED动态提示和900万像素违法抓拍单元显著减少路口事故,Zhang等\cite{zhang2025traffic}开发的MFS-MSTD模型在非随机缺失场景下流量修复误差降低52\%。 + +2. \textbf{动态环境的实时适应:} 动态环境不确定性对导航系统提出更高要求,Herath 等\cite{herath2020ronin}通过视觉信号优化路径规划使智能体实时适应动态障碍物变化,Dai等\cite{dai2017temporalcontext}提出的时序上下文网络为动态行为预测提供了新方法,Wang 等\cite{wang2013densetrajectory}提出基于强化学习的信号优化方法在动态环境中提升系统鲁棒性,Reid等\cite{reid1980tracking}提出的多目标跟踪算法为动态障碍物预测提供了理论基础。 + +3. \textbf{多智能体协作的优化:} 复杂交通场景中多智能体协作优化问题尤为重要,Lian 等\cite{lian2023inverseql}通过强化学习实现多智能体高效协作提高全局路径规划效率,Campos 等\cite{campos2021orbslam3}利用虚幻引擎验证多智能体协作优化算法在复杂场景中的应用价值。叶军华\cite{ye2023fusion}提出的多传感器融合定位算法将室内定位误差降低至3米以内。 + +4. \textbf{未来研究趋势:} 未来行人导航研究将朝以下方向发展:基于多源数据的复杂行为建模与优化;提升强化学习智能体在动态环境中的泛化能力;多智能体协作优化在虚拟仿真环境中的深度应用。 + +\section{研究内容与创新} + +本研究聚焦 "基于虚幻引擎的行人强化学习控制与导航系统" 展开,针对复杂动态交通环境中行人智能导航问题,运用虚拟仿真平台 Carla 与强化学习算法构建可训练、可评估、可扩展的智能导航系统。具体研究内容如下: + +1. \textbf{构建高仿真虚拟行人导航环境} 基于虚幻引擎与 Carla 平台构建高仿真虚拟行人导航环境,通过模拟城市道路结构、交通信号、车辆动态、障碍物变化等因素建立支持多场景切换的训练测试环境,形成高逼真度虚拟实验平台为智能体学习提供真实感知基础。 + +2. \textbf{设计多行为控制与骨骼建模系统:} 设计多行为控制与骨骼建模系统,借助 Carla 平台控制 API 及骨骼动画控制机制实现行人单向行走、过马路、来回走动等基础行为建模和动态路径更新,提升系统对多样化行人行为的响应能力。 + +3. \textbf{引入并比较多种强化学习算法:} 引入 PID 控制、DQN 算法、PPO 算法三种强化学习控制策略,在避障成功率、路径规划效率、模型稳定性等方面对比其性能表现,通过实验评估算法在动态环境中的适应性与可推广性。 + +4. \textbf{构建可解释性奖励函数体系:} 结合行人实际行为及交通安全需求构建可解释性奖励函数体系,设计融合目标达成、路径跟踪、安全避障、时间效率等因素的多维奖励函数,增强模型对复杂目标的理解与优化能力。 + +5. \textbf{实现系统性能评估与可视化展示:} 开展系统性能评估与可视化展示工作,通过仿真实验分析不同算法控制下的导航路径、碰撞率、目标达成时间等指标,利用图像增强与日志分析技术对行人导航过程进行可视化呈现,为后续系统优化与部署提供辅助支持。 + +本研究创新性体现在: + +1. \textbf{融合虚拟仿真与强化学习:} 融合虚拟仿真与强化学习搭建低成本高精度训练平台,借助虚幻引擎生成可控多样场景,解决传统现实数据采集难度大、风险高的问题,实现强化学习模型安全训练与快速迭代。 + +2. \textbf{提出动态加权融合路径规划机制:} 在 PID 控制中设计目标向量与避障向量的动态加权机制,结合雷达感知与环境反馈提升行人智能体对突发障碍的响应能力。 + +3. \textbf{构建多维奖励函数促进多目标导航优化:} 基于导航目标与交通安全性构建复合奖励函数体系,兼顾目标达成速度、路径偏差、避障效果与行走合理性,推动智能体学习策略从单一任务导向转向多目标协同优化。 + +4. \textbf{完成 DQN 与 PPO 两种主流强化学习算法在复杂交通环境中的对比分析:} 首次在 Carla 行人控制任务中系统对比两类深度强化学习方法的表现,提出适用于动态城市环境的稳定策略优化路径。 + +通过上述研究,该系统展示了虚拟仿真与强化学习在智慧交通中的深度融合潜力,为未来多智能体行人交通协同控制提供理论参考与实验平台支撑。 + +\section{论文组织架构} + +本论文以 "基于虚幻引擎的行人强化学习控制与导航系统" 为主题,针对智慧城市交通场景下复杂行人导航问题展开研究,内容涵盖仿真平台构建、强化学习算法实现、导航系统设计、实验验证与未来发展等方面。 + +\begin{figure}[H] + \centering + \includegraphics[width=0.8\textwidth]{images/tech_route.pdf} + \caption{论文技术路线图} + \label{fig:techroute} +\end{figure} + +图\ref{fig:techroute} 展示了本文的整体技术路线,按照“需求分析—平台搭建—算法实现—系统设计—性能评估—未来拓展”的顺序展开,形成一条从理论研究到系统落地的闭环路径。通过虚拟仿真场景设计与Carla平台集成,实现复杂交通场景下的动态障碍物建模与多传感器数据融合;在此基础上实现PID、DQN与PPO等多种强化学习策略控制,并进行对比分析;最终完成行人导航系统的完整功能设计与实验验证,为未来在真实场景中的迁移与多智能体协作提供技术支撑,详细解释如下: + +1. \textbf{虚拟仿真环境搭建}:基于虚幻引擎与 Carla 平台构建面向行人导航的高保真虚拟仿真场景,包括虚拟城市环境生成、动态障碍物模拟、多传感器信息建模与数据融合,为强化学习智能体提供训练环境基础。 + +2. \textbf{强化学习算法实现}:强化学习算法实现部分介绍 PID 控制、DQN 算法与 PPO 策略训练的原理及实现过程,通过对比不同控制策略在复杂环境中的适应性与学习效率为后续导航系统算法选择提供依据。 + +3. \textbf{行人导航系统设计}:行人导航系统设计围绕行人路径规划与避障问题构建多维奖励函数体系、路径规划模块及避障协同机制,同时建立骨骼控制与行为建模方法并引入动态权重融合策略以提升导航策略的稳定性与效率。 + +4. \textbf{实验验证与性能评估}:实验验证与性能评估环节通过仿真实验对导航精度、避障成功率、路径效率及实时控制性能进行综合分析,评估不同控制算法在复杂场景下的性能差异及系统整体运行效果。 + +5. \textbf{未来研究方向}:结合当前成果与系统运行反馈提出未来研究拓展方向,包括多智能体协作机制、传感器系统增强、复杂场景泛化能力提升及算法在硬件部署中的适应性问题。 + diff --git a/tactile/undergraduat/content/chapter2.tex b/tactile/undergraduat/content/chapter2.tex new file mode 100644 index 00000000..3ffe05ad --- /dev/null +++ b/tactile/undergraduat/content/chapter2.tex @@ -0,0 +1,147 @@ +\chapter{相关理论基础} + +\section{系统架构与设计初步} + +\begin{figure}[H] + \centering + \includegraphics[width=0.8\textwidth]{images/system_architecture.png} + \caption{行人控制系统架构示意图} + \label{fig:system_architecture} +\end{figure} + +本行人控制系统基于 Carla 仿真平台用 Python 编程语言及其 Carla API 实现核心功能,目标是在虚拟环境模拟行人运动控制,通过调节移动、检测周围障碍物及避障等完成复杂导航任务,初步设计 “单向行走”“过马路”“来回行走” 三类基础行为后期可扩展为 “随机漫步”“群体避障” 等高级策略。系统架构由环境设置与初始化、行人控制、碰撞检测与避障、用户输入与交互模块构成,环境设置与初始化模块基于 Carla 的 Town1 地图加载城市道路等元素并随机分布静态和动态障碍物增强场景多样性与鲁棒性,为行人挂载 RGB 摄像头和碰撞传感器设置不同采样频率与视野范围提供视觉感知和避障算法数据,行人控制模块用 Carla 的 WalkerControl 类精确调节行人速度、方向和避障行为实现精确运动控制,碰撞检测与避障模块依赖 Carla 传感器系统让行人实时感知障碍物并避让,通过实时检测动态调整路径避碰,用户输入与交互模块为实验操作提供便利,实现键盘控制行人移动使用户与系统交互更直观便捷。由此设计出了如图 \ref{fig:system_architecture}所示的行人控制系统架构。 + +\section{行人骨骼控制} + +在行人行为研究中准确获取骨骼姿态信息是实现行为理解与决策的关键,结合 Carla 平台 AI 行人生成功能与自定义脚本设计可实现模拟环境中行人骨骼数据的完整采集处理及后续深度学习模型训练验证,为训练行人识别建筑物道路汽车人行道及过马路行人以保障安全,Carla 模拟器通过人工智能控制的行人填充模拟和训练数据,人体姿态估计在自动驾驶安全人群控制及机器人等多个计算机视觉应用中是重要因素。 + +Carla 的 API 支持从模拟行人获取真实骨架,该骨架由含根节点或顶点及定义骨骼姿势向量的一组骨骼组成\cite{openhutb2025},如下图 \ref{fig:pedestrian_skeleton}所示,这些骨骼控制模拟行人四肢和身体运动,通过收集各骨骼集合可构建虚拟人姿势模型,该模型能与神经网络估计的姿势模型比较甚至用于训练神经网络进行姿势估计,通过 AI 控制器生成行人并恢复其骨骼真实三维坐标,将这些骨骼投影到相机传感器捕获的二维图像上,可在 Carla 模拟器中为人体姿势估计框架设置训练和验证,保证骨骼数据采集的完整性和精度能为后续基于 Carla 环境的行人姿态估计与行为预测模型提供坚实数据基础。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/pedestrian_skeleton.pdf} + \caption{行人骨骼控制示意图} + \label{fig:pedestrian_skeleton} +\end{figure} + +\section{行人行为控制} +本系统行为控制模型基于 Carla 平台 WalkerControl 模块构建,通过设定行人方向和速度参数精确操控移动行为,采用 town5 作为模拟地图,除基本移动功能外支持单向行走与过马路、来回走动两种主要行为模式,这些模式可在不同场景模拟行人多样化行为并满足后续复杂导航任务需求,模块化设计与参数化配置使系统能够灵活适应不同实验需求,为后续深度学习模型在行人避障与导航任务中的集成提供稳定高效的基础环境,初步研究未加入动态障碍物,仅实现行人单独行进,存在一定局限性。\cite{csdn2023carla} + +\subsection{单向行走与过马路} +单向行走与过马路是行人基础且关键的行为模式,行人通常从起点出发沿预设路径抵达目标位置,本研究设计简易路线规划系统以精确模拟行人过马路行为,允许其从街道一侧安全移动至对面。如图 \ref{fig:crossing_path},行人从人行道的右侧走向人行道的左侧。 + +\begin{figure}[H] + \centering + \begin{minipage}{1\textwidth} + \centering + \includegraphics[width=\textwidth]{images/crossing_path1.pdf} + \caption*{行人开始过马路} + \end{minipage} + + \vspace{0.5cm} + + \begin{minipage}{1\textwidth} + \centering + \includegraphics[width=\textwidth]{images/crossing_path2.pdf} + \caption*{行人成功通过马路} + \end{minipage} + \caption{行人单向行走与过马路示意图} + \label{fig:crossing_path} +\end{figure} + +实现时通过设定明确目标位置使行人沿起点到终点的预定路径行走,核心是利用 Carla 平台 WalkerControl 组件设定行人位置、速度等运动参数,该模型作为初步探索 Carla 行人行为模拟的实践较为简单。 + +\subsection{来回走与路径控制} + +\begin{figure}[H] + \centering + \begin{minipage}{\textwidth} + \centering + \begin{subfigure}{0.48\textwidth} + \includegraphics[width=\textwidth]{images/crossing_walking1.pdf} + \end{subfigure} + \begin{subfigure}{0.48\textwidth} + \includegraphics[width=\textwidth]{images/crossing_walking2.pdf} + \end{subfigure} + + \vspace{0.3cm} + + \begin{subfigure}{0.48\textwidth} + \includegraphics[width=\textwidth]{images/crossing_walking3.pdf} + \end{subfigure} + \begin{subfigure}{0.48\textwidth} + \includegraphics[width=\textwidth]{images/crossing_walking4.pdf} + \end{subfigure} + + \caption*{行人从右向左通过人行道过程} + \end{minipage} + + \vspace{0.5cm} + + \begin{minipage}{\textwidth} + \centering + \begin{subfigure}{0.48\textwidth} + \includegraphics[width=\textwidth]{images/crossing_walking5.pdf} + \end{subfigure} + \begin{subfigure}{0.48\textwidth} + \includegraphics[width=\textwidth]{images/crossing_walking6.pdf} + \end{subfigure} + + \vspace{0.3cm} + + \begin{subfigure}{0.48\textwidth} + \includegraphics[width=\textwidth]{images/crossing_walking7.pdf} + \end{subfigure} + \begin{subfigure}{0.48\textwidth} + \includegraphics[width=\textwidth]{images/crossing_walking8.pdf} + \end{subfigure} + + \caption*{行人从左向右返回过程} + \end{minipage} + + \vspace{0.5cm} + + \caption{行人来回通过人行道示意图} + \label{fig:walking_back_and_forth} +\end{figure} + +来回走动是行人在两个固定点间循环往复的常见行走模式,适用于短距离反复行走场景如本次模拟的过马路过程,其实现通过设定目标点并实时更新目标位置确保行人按既定路径高效移动。如图 \ref{fig:walking_back_and_forth},行人到达人行道一侧以后开始转向,向另一侧行进。 + +实现时先指定两个目标位置,行人到达一个目标后系统自动切换目标使其返回起点,该过程可完全自动化或根据需求允许手动控制,为应对突发情况系统实时监测环境调整行人动作,如遇红灯原地等候、绿灯直接通行,动态路径调整功能确保行人依实际情况及时反应顺利到达下一个目标,这种智能路径规划技术既提高行走效率和安全性,也为后续导航系统设定目标位置奠定基础。 + +\section{键盘控制行人移动} +本研究设计并实现键盘控制功能以提升用户体验和系统互动性,用户可通过简单键盘输入直接操控行人运动,采用 Pygame 库监听键盘输入,支持按下 W、A、S、D 键实现前进、后退、转向等动作控制,同时在 Pygame 可视化框中提供障碍物识别和监测功能,遇障碍物时屏幕显示距离等实时反馈,如图 \ref{fig:collision_detection},此时屏幕上会显示出障碍物的距离以及相关警告,相关训练代码在地图 town1 中实现。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/collision_detection.pdf} + \caption{行人障碍物检测示意图} + \label{fig:collision_detection} +\end{figure} + +具体实现过程包含以下步骤:通过 Pygame 库设置键盘事件监听功能使系统捕捉用户键盘操作并与行人运动方向精确映射,具体规则如下表所示,确保用户键盘输入的每一指令被系统准确识别执行;设计控制逻辑使用户输入指令后行人的 WalkerControl 模块实时响应,根据指令更新行人方向和速度,确保行人移动即时准确反映用户控制意图以实现精确控制;考虑行人运动安全性,系统加入碰撞检测与停止机制,当行人遇障碍物时内置碰撞传感器立即检测并触发碰撞事件,系统接收到事件后迅速反应停止行人运动,有效避免碰撞风险保障行人运动安全性。 + +\begin{table}[H] + \centering + \renewcommand{\arraystretch}{1.3} + \begin{tabular}{ + >{\centering\arraybackslash}p{6.5cm} + >{\centering\arraybackslash}p{4cm} + } + \toprule + \textbf{控制说明} & \textbf{控制键} \\ + \midrule + WASD 移动 & 空格跳跃 \\ + Shift 加速 & ESC 退出 \\ + \bottomrule + \end{tabular} + \caption{键盘控制人规则} + \label{tab:keyboard-control} +\end{table} + +键盘控制模块不仅能实现对行人的灵活操控,也为调试与实验分析提供了完善的交互与可视化支持,为后续引入 AI 控制与自动化策略奠定基础。 + +\section{本章小结} + +本章系统阐述行人导航系统构建的关键理论与技术支撑,基于 Carla 仿真平台实现环境设置、传感器配置、行人控制等核心功能模块并明确系统整体架构设计逻辑,详尽介绍行人骨骼控制原理及关键参数提取方式以为行为建模与路径规划提供数据基础,通过分段控制策略实现单向行走、过马路、来回路径切换等基本行为并结合动态目标点更新机制实现高层级行为仿真控制,借助键盘控制接口引入用户交互功能以提升系统调试效率与可视化能力。​ +本章内容完成从虚拟仿真环境搭建到基础行为控制模块构建的核心准备工作,为后续强化学习控制算法接入及训练环境部署奠定理论与工程基础。 diff --git a/tactile/undergraduat/content/chapter3.tex b/tactile/undergraduat/content/chapter3.tex new file mode 100644 index 00000000..3ef0fd2c --- /dev/null +++ b/tactile/undergraduat/content/chapter3.tex @@ -0,0 +1,528 @@ +\chapter{基于强化学习的行人控制} + +\section{环境配置} + +本研究主要目标是用强化学习算法(PPO、PID、DQN)训练优化行人控制系统,核心是评估这些算法在复杂动态环境里的性能表现。为此,所有深度学习训练与实验都在功能强大的 Carla 仿真平台开展。Carla 平台有多样城市环境,涵盖各类道路、建筑风格、车辆模型、行人行为,能模拟真实城市交通复杂性,这让它成为自动驾驶研究和智能体训练的理想测试平台。​ + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/town1.pdf} + \caption{Carla中的Town1俯视图} + \label{fig:town1} +\end{figure} + +Carla 是专为自动驾驶研究设计的开源模拟平台,支持相机、激光雷达(LiDAR)、惯性测量单元(IMU)等多种传感器集成,能模拟含道路、交通信号灯、行人及其他交通参与者的复杂城市环境,为强化学习、路径规划、感知与控制算法开发提供高度可定制虚拟环境。本研究借 Carla 的 Python API 与仿真环境交互,实现行人运动控制并收集环境数据用于学习,该 API 能以编程模拟行人、车辆、交通灯等动态因素,还能实时获取各类传感器数据,给算法训练测试提供丰富信息。​ + +本研究因训练测试需求及研究者个人电脑计算能力限制选择 Carla 仿真平台 Town01 地图作为实验环境。Town01 作为 Carla 平台标准城市地图之一如图 \ref {fig:town1} 所示,包含多种城市道路结构、交通标志、建筑物、行人及交通工具等元素,设计旨在模拟真实城市交通环境并提供丰富具代表性的测试场景。该地图具备较高城市仿真还原度,结构涵盖多个复杂布局的城市道路与交叉口以重构现实交通网络与流动模式,集成私家车、公务车、公交车等多类型交通工具及行人对象、交通信号灯系统模拟典型城市运行状态,强化学习训练中除道路建筑等静态构造物外,还引入移动车辆与行人个体等具行为逻辑的动态障碍物以提升路径规划与避障策略的难度与真实性。 + +\section{PID(Proportional-Integral-Derivative)控制算法} + +\begin{algorithm}[H] + \caption{自适应PID控制算法} + \begin{algorithmic}[1] + \STATE 初始化参数$K_p^0$, $K_i^0$, $K_d^0$ % 改为 \STATE + \WHILE{系统运行} + \STATE 获取激光雷达数据$L_t$ + \STATE 计算障碍物距离$d_{obs} = \min(L_t)$ + \IF{$d_{obs} < 5m$} + \STATE $K_p \gets 1.2K_p^0$ + \STATE $K_d \gets 1.5K_d^0$ + \ENDIF + \STATE 执行PID计算 + \ENDWHILE + \end{algorithmic} +\end{algorithm} + +\subsection{PID控制算法建模} + +\subsubsection{控制方程推导} +离散PID控制算法表示为: +\begin{equation} + u(k) = K_p e(k) + K_i T \sum_{i=0}^k e(i) + K_d \frac{e(k)-e(k-1)}{T} +\end{equation} +其中,$T=0.005s$为采样周期,$e(k)$为第$k$时刻的横向偏差。 + +\subsubsection{参数整定策略} +通过Ziegler-Nichols临界比例法确定基础参数后,结合实际场景进行优化: +转向控制参数:$K_p=0.8$, $K_i=0.001$, $K_d=0.2$\\ +速度控制参数:$K_p=0.5$, $K_i=0.01$, $K_d=0.1$ + +\subsubsection{PID控制原理} + +PID控制算法通过比例(P)、积分(I)与微分(D)三项协同工作实现对目标系统的控制,其数学表达如下: +\[ +u(t) = K_p e(t) + K_i \int_0^t e(\tau) d\tau + K_d \frac{d}{dt} e(t) +\] + $e(t)$ 表示当前时刻控制误差而 $u(t)$ 为控制器输出量,该控制器由三部分构成: + +比例项 $K_p e(t)$ 通过调节比例系数 $K_p$ 对当前误差快速响应以修正偏离目标行为并增强响应速度和控制强度,积分项 $K_i \int_0^t e(\tau) d\tau$ 通过累计过去误差补偿长时间累积的稳态偏差以提高系统长期控制精度,微分项 $K_d \frac{d}{dt} e(t)$ 根据误差变化速率预测调整以抑制系统振荡并提升稳定性与鲁棒性。 + +三者协同可在多种工程系统中实现较优的动态性能与稳态性能平衡,广泛应用于温度调节、伺服控制、轨迹跟踪等自动化控制场景。 + +\subsection{算法实现与效果可视化} + +\subsubsection{传感器数据处理} + +激光雷达传感器提供了高精度的三维点云信息,系统通过一套完整的预处理与分析流程将其转换为可用于导航决策的结构化信息。数据处理流程主要包括以下几个环节: + +首先,系统对原始点云数据进行初步筛选,设定感知范围为半径不超过8米、水平视角位于前向60°范围内的空间区域,滤除无效测点与边缘噪声数据,从而减少冗余信息并提升处理效率。其次,在障碍物识别阶段,引入基于密度的空间聚类算法(改进版DBSCAN),设定聚类半径阈值 $\epsilon=0.5m$ 与最小邻居点数 $MinPts=5$,实现对局部高密度点云区域的有效分离,进而标定出潜在障碍物目标。最后,系统对已识别障碍物执行威胁评估,通过计算最短距离 $d_{min}$ 以及相对速度 $v_{rel}$ 等关键指标,辅助行为决策模块判断是否采取避障策略或调整路径规划。 + +该处理流程在保证实时性的基础上,提升了环境建模的准确性,为下游控制算法提供了可靠支持。 + +\subsubsection{动态权重融合算法} +目标向量$\vec{T}$与避障向量$\vec{A}$的融合策略: +\begin{equation} + \vec{C} = \alpha \vec{T} + (1-\alpha)\vec{A} +\end{equation} +其中权重系数$\alpha$的动态调整规则为: +\begin{equation} + \alpha = + \begin{cases} + 0.05, & d_{\text{min}} \leq 1\ \text{m} \\ + 0.8(1 - e^{-0.5d_{\text{min}}}), & 1\ \text{m} < d_{\text{min}} \leq 5\ \text{m} \\ + 1, & d_{\text{min}} > 5\ \text{m} + \end{cases} +\end{equation} + +\subsubsection{核心模块功能解析} + +系统核心功能模块由若干关键类构成,分别负责路径控制、传感器数据处理、误差计算与控制环执行等任务,具体实现如下: + +PIDController类承担基本的控制策略计算职责,其中\texttt{compute()}函数实现了具备抗积分饱和能力的PID控制逻辑,在保证控制稳定性的同时避免积分项过大造成系统震荡;\texttt{reset()}函数用于在检测到碰撞事件后清空累计误差,确保恢复控制时状态重置合理,有助于系统稳定恢复。 + +PIDPedestrianEnv类集成了环境感知与路径控制的多项功能。在感知方面,\texttt{\_process\_lidar()}函数对激光雷达点云数据进行实时处理,限定分析区域为前向60度扇形,最大探测距离为8米,随后采用DBSCAN聚类算法($\epsilon=0.5$ m)识别局部障碍物簇,实现高效环境建模。在路径误差估计方面,\texttt{calculate\_errors()}函数将目标方向与避障方向融合为一个期望方向向量,并根据当前任务阶段动态调整加权系数(取值范围为$[0.05, 0.95]$),再将该向量投影至局部坐标系以计算横向与纵向偏差,为后续控制指令提供误差信息支持。 + +控制执行层 \texttt{run\_control\_loop()}函数以 200Hz 高频运行保证控制精度与响应速度,速度控制通过引入非线性安全函数$v_{\text{safe}} = (\frac{d}{5})^{1.5} \cdot 3.0$动态调节移动速度确保接近障碍物时具备充分制动空间,系统在碰撞时自动触发后退 1 米后随机旋转 90 度重新导航的恢复策略提升鲁棒性与自主回复能力,该模块紧密集成感知规划与控制环节在确保实时性的同时有效提升导航稳定性与安全性。 + +\subsubsection{传感器系统架构} +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/sensor_architecture.pdf} + \caption{多传感器数据融合架构} + \label{fig:sensor} +\end{figure} + +\subsection{实验结果分析} + +为评估系统导航控制实际性能本节从避障效果、路径偏差控制与系统响应行为等维度分析实验结果并基于观察提出优化方向。系统在 100 次独立实验中避障成功 94 次成功率达93.7\% 表明控制策略在典型场景下具备较强鲁棒性与稳定性,实际行进路径相较理论路径平均偏差 $0.45 \pm 0.12$ 米显示动态环境中轨迹一致性较好,特定紧急避障情境中因障碍物突现或多障碍干扰出现最大18.7\%瞬时过冲。 + +图~\ref{fig:pid_obstacle} 展示智能体面对广告牌类障碍物时的避障行为,绿色箭头为导航目标方向、红色箭头为避障方向(仅障碍检测后可见)、蓝色箭头为实际前进方向,图像生成后经锐化及亮度对比度优化提升细节与视觉清晰度便于观察导航方向向量变化。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/obstacle_avoidance.pdf} + \caption{行人智能体通过PID控制进行避障的示意图} + \label{fig:pid_obstacle} +\end{figure} + +基于实验表现系统功能实现已具良好基础但仍有提升空间,优化方向主要包括引入自适应 PID 参数调节机制提升不同场景响应灵活性、融合视觉语义信息提升障碍物识别分类精度与避障决策语境感知能力、采用模型预测控制(Model Predictive Control, MPC)方法优化路径平滑性与前瞻性减少复杂场景路径震荡问题。 + +\section{DQN(Deep Q-Network)算法} + +\begin{algorithm}[H] + \caption{DQN训练算法} + \begin{algorithmic}[1] + \STATE 初始化环境与模型 + \STATE 设置动作空间与状态空间 + \WHILE{训练过程中} + \STATE 进行环境重置,获取初始观测$O_0$ + \FOR{每个训练步骤} + \STATE 根据当前策略选择动作$a_t$ + \STATE 执行动作$a_t$,获得新的观测$O_{t+1}$,奖励$R_t$ + \STATE 存储经验$(O_t, a_t, R_t, O_{t+1})$ + \STATE 从经验池中采样批量数据进行更新 + \STATE 使用DQN算法更新Q网络 + \ENDFOR + \ENDWHILE + \end{algorithmic} +\end{algorithm} + +\subsection{Q-learning公式} + +在引入目标网络机制后,Q-learning算法的更新策略得到进一步优化,其Q值更新公式表达如下: +\[ +Q(s_t,a_t) \leftarrow Q(s_t,a_t) + \alpha\left[r_t + \gamma \max_{a'}Q_{\text{target}}(s_{t+1},a') - Q(s_t,a_t)\right] +\] +该公式表示智能体在状态 $s_t$ 采取动作 $a_t$ 后,根据获得的即时奖励 $r_t$ 和下一状态 $s_{t+1}$ 的最大期望收益,调整当前状态-动作对的估值。其中各参数的含义如下: + +学习率 $\alpha=10^{-4}$ 控制Q值更新的幅度,数值越小则代表对新信息的更新越缓慢(对应代码中的 \texttt{learning\_rate=1e-4});折扣因子 $\gamma=0.99$ 用于衡量未来回报的重要性,较高的折扣因子表明模型更注重长期收益(对应代码中的 \texttt{gamma=0.99})。此外,$Q_{\text{target}}$ 表示由目标网络计算得到的下一状态的最大Q值,用于提升估值过程的稳定性,避免在策略训练初期因频繁更新而导致震荡。 + +该更新机制能够在保留传统Q-learning策略探索性的基础上,通过固定目标网络参数进行延迟更新,有效缓解训练不稳定的问题,特别适用于深度强化学习中的高维状态空间建模场景。 + +\subsection{双网络架构设计} + +为提升训练稳定性与估值精度,系统采用双网络架构,由在线网络(Online Network)与目标网络(Target Network)组成,分别承担策略更新与价值估计的不同功能。 + +在线网络用于实时学习当前策略,其结构为两层全连接神经网络,每层节点数为256,采用ReLU作为激活函数(对应代码设置为 \texttt{activation\_fn=torch.nn.ReLU}),在每一步梯度下降中更新权重参数 $\theta_{\text{online}}$,确保模型对最新状态反馈做出及时响应。 + +目标网络结构与在线网络保持一致,但其参数更新方式采用“硬更新”机制,即以固定步数间隔将在线网络的权重直接复制至目标网络。该同步过程公式如下所示: +\[ +\theta_{\text{target}} \leftarrow \theta_{\text{online}} +\] +在具体实现中,目标网络每1000步执行一次参数同步(对应代码参数为 \texttt{target\_upda\\te\_interval=1000}),通过延迟更新策略降低了目标Q值波动,增强了训练过程的收敛性。 + +\subsection{经验回放机制} + +经验回放(Experience Replay)机制用于缓解样本相关性对训练收敛的负面影响,系统通过构建经验池与延迟学习机制提升数据利用率与策略泛化能力。 + +经验池用于存储智能体在交互过程中收集的状态-动作-奖励-下一状态四元组,容量设置为 $10^5$ 条经验(对应代码参数为 \texttt{buffer\_size=100000}),每次训练从中均匀随机采样形成小批量数据,批次大小设为128条样本(\texttt{batch\_size=128}),以提升训练的稳定性与样本多样性。 + +在模型训练初期,系统采用延迟学习策略,即前1000步不进行参数更新,仅用于填充经验池(设置为 \texttt{learning\_starts=1000}),之后每隔4步执行一次策略网络的权重更新,从而保证网络初始训练基于足够多样的经验。 + +探索行为采用$\epsilon$-greedy策略控制动作选择过程,在训练初期以较高概率随机探索,随着训练步数增加逐步降低随机性。初始探索率 $\epsilon=1.0$,线性衰减至 $\epsilon=0.05$,整个衰减过程占总训练步数的20\%(设置为 \texttt{exploration\_fraction=0.2},\texttt{exploration\_final\_eps=0.05})。该策略在保持探索能力的同时,使策略网络逐步转向利用已学习知识进行优化行为决策。 + +\subsection{算法优化策略} + +为提升DQN算法在复杂场景下的泛化能力与训练稳定性,本系统在目标值计算、状态特征表达与奖励机制设计方面进行多项优化,具体策略如下所述。 + +\textbf{目标值分离策略}:为缓解Q值估计过程中的过估计问题,系统引入独立的目标网络用于计算时间差分(TD)目标值。该目标网络的结构与在线网络保持一致,但其参数以固定步数间隔从主网络中复制而来,有效提升了目标估值的稳定性,从而减少策略震荡并加速收敛过程。 + +\textbf{状态归一化处理}:为确保不同量纲的状态特征在输入网络前具备相对均衡的尺度,系统对关键特征执行归一化操作:位置坐标采用 $x_{\text{norm}} = x/200.0 - 1.0$ 表达,将原始坐标映射至 $[-1, 1]$ 区间;速度向量归一化为 $v_{\text{norm}} = v/3.0$,避免速度数值主导状态向量;障碍物距离归一化处理为 $\min(d_{\text{obs}}/5.0, 1.0)$,限制极端远距值带来的梯度影响。该归一化策略提升了状态向量在神经网络中的表达能力与训练稳定性。 + +\textbf{奖励函数设计}:系统采用如下形式构建稀疏强化学习中的稠密奖励结构,以引导智能体行为学习: +\[ +r_t = \underbrace{2\Delta d}_{\text{进度奖励}} + \underbrace{\min(v/3.0, 0.5)}_{\text{速度奖励}} - \underbrace{0.05}_{\text{时间惩罚}} - \underbrace{20\cdot\mathbb{X}_{\text{collision}}}_{\text{碰撞惩罚}} +\] +$\Delta d$ 表示当前位置与目标位置之间的推进距离,速度奖励项抑制过慢移动行为并避免高速度带来的安全风险,时间惩罚项用于压缩到达时间以鼓励更快完成任务,碰撞惩罚项通过设置固定高权重显著惩戒与障碍物的碰撞行为以增强避障策略的学习强度。 + +图~\ref{fig:avoidance} 展示了 DQN 算法控制下智能体面对动态行人时采取的避障路径并可视化行为策略在复杂交互场景中的有效性。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/pedestrian_avoidance.pdf} + \caption{基于DQN的障碍物规避策略示意图} + \label{fig:avoidance} +\end{figure} + +\textbf{超参数配置}:如表~\ref{tab:dqn_params}所示,系统选用经验池大小为 $10^5$,隐藏层神经元维度为两层 [256, 256],其他关键参数也进行了针对性设置以匹配环境动态特征与收敛需求。 + +\begin{table}[H] +\centering +\caption{DQN超参数配置表} +\label{tab:dqn_params} +\begin{tabular}{llll} +\toprule +参数名称 & 符号表示 & 取值 & 取值范围 \\ +\midrule +学习率 & $\alpha$ & $1 \times 10^{-4}$ & $[1e^{-5}, 1e^{-3}]$ \\ +折扣因子 & $\gamma$ & 0.99 & $(0, 1]$ \\ +经验池容量 & $|\mathcal{D}|$ & $10^5$ & $[10^4, 10^6]$ \\ +目标网络更新间隔 & $N_{\text{update}}$ & 1000 steps & $[100, 5000]$ \\ +初始探索率 & $\epsilon_{\text{initial}}$ & 1.0 & $[0, 1]$ \\ +最终探索率 & $\epsilon_{\text{final}}$ & 0.05 & $[0, 1]$ \\ +探索衰减比例 & $f_{\epsilon}$ & 20\% & $[0.1, 0.5]$ \\ +学习起始步数 & $N_{\text{start}}$ & 1000 & $[0, 10^4]$ \\ +批量大小 & $B$ & 128 & $[32, 512]$ \\ +目标网络软更新系数 & $\tau$ & 1.0 & $[0.005, 1.0]$ \\ +网络隐藏层维度 & $d_{\text{hidden}}$ & [256, 256] & 自定义结构 \\ +激活函数 & $\phi$ & ReLU & ReLU/Tanh/etc. \\ +\bottomrule +\end{tabular} +\end{table} + +\vspace{0.5em} +\noindent \textbf{说明:}本系统采用硬同步方式更新目标网络,未实现软更新形式中的加权移动平均(代码中未启用 $\tau$ 参数);优化器选择Adam以提升梯度收敛效率;运行设备配置为自动选择,确保在不同硬件平台下具备良好的兼容性(对应代码设置 \texttt{device='auto'})。 + +\section{PPO(Proximal Policy Optimization)算法} + +\begin{algorithm}[H] + \caption{PPO训练算法} + \begin{algorithmic}[1] + \STATE 初始化环境与模型 + \STATE 设置动作空间与状态空间 + \WHILE{训练过程中} + \STATE 获取当前观测$O_t$ + \FOR{每个训练步骤} + \STATE 根据当前策略选择动作$a_t$ + \STATE 执行动作$a_t$,获得新的观测$O_{t+1}$,奖励$R_t$ + \STATE 使用PPO算法计算优势函数$A_t$ + \STATE 计算目标和损失,更新策略网络 + \ENDFOR + \ENDWHILE + \end{algorithmic} +\end{algorithm} + +\subsection{PPO算法概述} + +PPO(Proximal Policy Optimization,近端策略优化)是策略梯度方法基础上发展的强化学习算法,核心思想是提升策略优化效率并严格限制策略更新幅度以提高训练稳定性。“Proximal(近端)” 指 PPO 通过引入截断机制对策略更新幅度设置边界确保新策略不偏离旧策略过远以避免训练中性能骤降或策略崩坏;“Policy(策略)” 指智能体在给定状态下采取动作的概率分布即行为决策核心函数;“Optimization(优化)” 体现算法通过迭代调整策略参数使智能体在长期交互中获得更高期望回报的目标导向特征。 + +本研究基于\texttt{Stable-Baselines3}框架 PPO 模块实现行人智能体训练部署,PPO 算法通过最大化策略在环境中累计期望回报提升行为策略学习效率,同时通过限制策略变化范围抑制过度更新导致的不稳定问题,该特性使其在高维状态或动作空间中具备较好鲁棒性与泛化能力,适用于本项目构建的行人路径规划与避障控制任务。下一节将从数学公式层面介绍 PPO 优化原理并结合实现代码分析关键超参数设定依据与调整策略。 + +\subsection{最大化期望回报} +PPO 强化学习的目标是最大化智能体在环境中的期望累积回报: +\[ +J(\theta) = \mathbb{E}_{\tau \sim p_{\theta}(\tau)} \left[ \sum_{t=0}^{T} \gamma^t r_t \right] +\] +其中,$\theta$表示策略参数,$\gamma$为折扣因子,$\tau$为轨迹,$r_t$为即时奖励。 + +\subsection{策略梯度与重要性采样} +传统策略梯度方法的梯度估计为: +\[ +\nabla_{\theta} J(\theta) = \mathbb{E}_{\tau \sim p_{\theta}(\tau)} \left[ \nabla_{\theta} \log \pi_{\theta}(a_t|s_t) A_t \right] +\] +其中,$A_t$为优势函数(Advantage),衡量某一动作相对平均水平的好坏。PPO 引入重要性采样比率: +\[ +r_t(\theta) = \frac{\pi_{\theta}(a_t|s_t)}{\pi_{\theta_{\text{old}}}(a_t|s_t)} +\] +用旧策略生成的数据评估新策略。 + +\subsection{剪切目标函数} +为避免策略更新过大,PPO 使用剪切机制: +\[ +L_{\text{clip}}(\theta) = \mathbb{E}_t \left[ \min \left( r_t(\theta) A_t, \text{clip}(r_t(\theta), 1 - \epsilon, 1 + \epsilon) A_t \right) \right] +\] +其中,$\epsilon$是超参数(通常取0.1–0.2),$\text{clip}$函数会将比率截断在区间内,保证每次更新幅度不会过大。 + +\subsection{优势估计GAE(Generalized Advantage Estimation)} +为了在偏差与方差之间取得平衡,PPO 使用 GAE 计算优势: +\[ +A_t^{\text{GAE}} = \sum_{l=0}^{\infty} (\gamma \lambda)^l \delta_{t+l} +\] +其中,$\lambda$为平衡系数,$V(s_t)$为状态价值函数。 + +\subsection{完整的优化目标} + +在PPO(Proximal Policy Optimization)算法中,策略更新过程不仅关注动作选择的期望回报,还同时考虑价值函数的估计精度与策略的探索能力。因此,其总损失函数由三部分组成:策略损失、价值函数损失和熵正则项,具体形式如下: +\[ +L(\theta) = L_{\text{clip}}(\theta) - c_1 L_{\text{VF}}(\theta) + c_2 S[\pi_{\theta}](s_t) +\] +$\theta$ 表示当前策略网络参数且损失函数三项含义如下: + +第一项 $L_{\text{clip}}(\theta)$ 为衡量新旧策略偏离程度的剪切策略损失,通过截断策略概率比限制策略更新幅度以保证每轮更新在 “近端” 范围内并避免偏离过大导致的不稳定问题; + +第二项 $L_{\text{VF}}(\theta)$ 为采用均方误差形式评估当前价值估计与实际经验回报偏差的价值函数损失,通过引导价值网络准确拟合环境状态值提升训练稳定性与目标期望值估计精度,权重系数 $c_1$ 控制其在总目标函数中的占比。 + +第三项 $S[\pi_{\theta}](s_t)$ 为策略熵项,用于度量当前策略的不确定性。该项通过鼓励策略输出更为均匀的概率分布,增强智能体的探索能力,防止陷入局部最优。熵项权重 $c_2$ 决定其在整体优化中的影响程度。 + +通过引入上述三项,PPO算法在追求策略收益最大化的同时,兼顾值函数逼近质量与策略多样性,从而实现更为稳健和高效的策略优化过程。 + +\subsection{训练模型评估} +在 \texttt{Carla\_Pedestrian\_PPO.py} 中,关键超参数配置如下: +\begin{lstlisting}[language=Python] +model = PPO( + policy="MlpPolicy", # 使用多层感知机策略(MlpPolicy) + env=vec_env, # 训练环境 + # 核心参数 + learning_rate=1e-4, # 较小学习率,减缓更新步伐,避免模型过度拟合 + n_steps=1024, # 每次更新时收集的步骤数,减小批大小有助于稳定训练 + batch_size=256, # 每次训练时的批量大小 + gamma=0.99, # 折扣因子,控制未来奖励的权重 + gae_lambda=0.95, # GAE的lambda参数,控制优势估计的平滑程度 + clip_range=0.2, # 增大剪切范围,可以控制策略的更新幅度,避免过大的更新 + clip_range_vf=0.2, # 价值函数的剪切范围,用于稳定训练 + ent_coef=0.02, # 增强探索,控制熵损失的权重,增加探索性 + target_kl=0.05, # 放宽KL散度阈值,允许策略有更多的变化,以便更好地探索 + + # 网络结构 + policy_kwargs={ + "net_arch": { + "pi": [128, 128], # 策略网络的架构,使用两个128单元的全连接层 + "vf": [128, 128] # 价值函数网络的架构,使用两个128单元的全连接层 + }, + "activation_fn": torch.nn.ReLU, # 激活函数,使用ReLU函数提高非线性表现 + "ortho_init": True, # 正交初始化,确保网络权重的良好初始化 + "log_std_init": -0.3, # 初始标准差,调整初始化的噪声水平,避免探索过度 + }, + + # 设备强制使用GPU + device='cuda', # 强制使用GPU进行训练 + verbose=1 # 设置输出详细程度,1表示输出信息量适中 + ) + +\end{lstlisting} + +\subsubsection{训练效率} + +在系统训练过程中,运行帧率(Frames Per Second, FPS)波动范围为36至67之间,反映出在不同环境状态与模型参数配置下的运行负载变化。较高的帧率可提高训练样本采集效率,同时也有助于缩短总训练时间。训练步数方面,采用分批迭代方式完成总时间步(\texttt{total\_timesteps})为 10 万步的训练过程,该设定在覆盖充分样本同时保留不同阶段策略效果评估空间为模型优化与参数调整提供基础支持。 + +\subsubsection{策略稳定性} + +系统记录近似 Kullback-Leibler 散度(\texttt{approx\_kL})与剪切比例(\texttt{clip\_fraction})两项关键指标,其中\texttt{approx\_kL} 散度范围为 0.007 至 0.037、部分阶段略高表明策略更新幅度偏大需结合剪切策略抑制,剪切比例(\texttt{clip\_fraction})大多数稳定在 0.06 至 0.12 之间、个别阶段短时波动反映策略在某些迭代周期存在剧烈调整可能对训练收敛性产生影响,整体而言策略更新保持在可控区间但仍需进一步平衡更新速率与稳定性关系。 + +\subsubsection{探索与利用权衡} + +PPO 算法探索能力通过熵损失(\texttt{entropy\_loss})变化衡量,本实验中熵值从初期 - 1.6 上升至约 - 0.663 显示训练中智能体动作选择逐渐摆脱单一决策表现出更强探索行为,这一趋势说明策略逐步从随机试探过渡到以优化回报为目标的策略利用但过程仍存在轻微波动,表明策略学习初期至中期之间探索 - 利用动态平衡仍需进一步调节。 + +\subsubsection{价值函数性能评估} + +价值函数拟合能力是判断策略评估有效性的重要依据,实验数据显示解释方差(\texttt{explained\_variance})从初始 0.03 显著提升至 0.945 说明价值网络对环境状态与未来回报关系建模能力不断增强,价值损失(\texttt{value\_loss})由早期 718 下降至训练后期最低值 12.6、尽管某些阶段轻微反弹但整体趋势稳定下降验证模型收敛性与学习效果提升,最终测试日志显示 “成功到达目标!剩余距离:1.98m” 表明训练后策略具备较强目标导向性与执行能力,能够在复杂动态环境中完成路径规划与避障任务。 + +\begin{table}[H] + \centering + \caption{训练日志关键指标汇总} + \label{tab:metrics} + \begin{tabular}{lccccc} + \toprule + 指标名称 & 最小值 & 最大值 & 均值 & 关键变化 \\ + \midrule + approx\_kL & 0.007 & 0.037 & 0.015 & 波动大 \\ + value\_loss & 12.6 & 718 & 257.8 & 后期反弹 \\ + entropy\_loss & -1.6 & -0.663 & -1.1 & 探索不足 \\ + \bottomrule + \end{tabular} +\end{table}o + +虽然模型尚存在很多问题,但未来都可以继续优化,下图为PPO模型训练过程日志图\ref{fig:training},是实验过程中的部分数据。 + +\begin{figure}[H] + \centering + \begin{minipage}{0.24\textwidth} + \centering + \includegraphics[width=\textwidth]{images/training1.pdf} + \caption*{过程1} + \end{minipage}% + \begin{minipage}{0.24\textwidth} + \centering + \includegraphics[width=\textwidth]{images/training2.pdf} + \caption*{过程2} + \end{minipage}% + \begin{minipage}{0.24\textwidth} + \centering + \includegraphics[width=\textwidth]{images/training3.pdf} + \caption*{过程3} + \end{minipage}% + \begin{minipage}{0.25\textwidth} + \centering + \includegraphics[width=\textwidth]{images/training4.pdf} + \caption*{过程4} + \end{minipage} + + \vspace{0.5cm} + + \begin{minipage}{0.24\textwidth} + \centering + \includegraphics[width=\textwidth]{images/training5.pdf} + \caption*{过程5} + \end{minipage}% + \begin{minipage}{0.25\textwidth} + \centering + \includegraphics[width=\textwidth]{images/training6.pdf} + \caption*{过程6} + \end{minipage}% + \begin{minipage}{0.25\textwidth} + \centering + \includegraphics[width=\textwidth]{images/training7.pdf} + \caption*{过程7} + \end{minipage}% + \begin{minipage}{0.25\textwidth} + \centering + \includegraphics[width=\textwidth]{images/training8.pdf} + \caption*{过程8} + \end{minipage} + \caption{PPO模型训练过程日志图} + \label{fig:training} +\end{figure} + +训练得出了模型主要用于导航的使用,下图 \ref{fig:path_planning} 则为行人智能体通过PPO算法进行路径规划与避障的示意图。由 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/path_planning.pdf} + \caption{行人智能体通过PPO算法进行路径规划与避障的示意图} + \label{fig:path_planning} +\end{figure} + +\subsubsection{总结} + +PPO模型在路径规划中的任务完成率和价值函数预测方面表现稳定,表明策略网络具备较强的行为学习与回报估计能力。训练过程中仍出现策略更新波动、熵值不稳定和阶段性价值回退,影响了模型的收敛效果。 + +为提升系统性能与训练稳定性未来工作可从以下方向展开: + +\begin{enumerate} + \item 通过调整剪切区间参数限制策略更新幅度以缓解 KL 散度增长引发的策略不稳定问题; + \item 在价值函数网络中引入正则化或优化层级结构以提升模型泛化能力与拟合质量; + \item 引入基于熵损失与剪切比例等指标实时调整训练参数的动态超参数机制以增强适应性; + \item 应用学习率衰减策略以实现前期快速收敛与后期平稳调整并优化整体训练过程。 +\end{enumerate} + +这些改进将提升模型在多种场景中的适应能力并为强化学习方法的实际部署奠定基础。 + +\section{算法对比与分析} + +针对我们已经使用了的基于Carla平台的行人导航系统的三种算法,对比分析PID控制、DQN和PPO三种算法的性能特点,阐述其适用场景并从中选取一个座位我们导航系统的核心算法。 + +\subsection{算法特性对比} + +如表~\ref{tab:algorithm_comparison}所示,从控制方式、训练成本、环境适应性等维度对三种强化学习算法进行系统对比: + +\begin{table}[H] + \centering + \caption{行人控制算法对比} + \label{tab:algorithm_comparison} + \begin{tabular}{lccc} + \toprule + \textbf{特性} & \textbf{PID} & \textbf{DQN} & \textbf{PPO} \\ + \midrule + 控制方式 & 连续 & 离散 & 连续 \\ + 学习能力 & 无 & 有 & 有 \\ + 参数敏感性 & 高 & 中 & 低 \\ + 训练时间 & 0 & 长 & 中 \\ + 动态障碍适应性 & 差 & 一般 & 优 \\ + 长期策略优化 & 无 & 有限 & 强 \\ + 代码复杂度 & 低 & 高 & 中 \\ + \bottomrule + \end{tabular} +\end{table} + +\subsection{算法优劣分析} + +为全面评估不同控制算法在本系统中的适用性与表现差异,本文选取 PID 控制、DQN 和 PPO 三种算法,从实时性、适应性、训练需求与控制精度等维度展开对比分析。比较结果如表~\ref{tab:algo_analysis} 所示。 + +\begin{table}[H] +\centering +\caption{三种控制算法的优势与劣势比较} +\label{tab:algo_analysis} +\renewcommand{\arraystretch}{1.4} +\begin{tabular}{ + >{\centering\arraybackslash}p{2.8cm} + >{\centering\arraybackslash}p{6.2cm} + >{\centering\arraybackslash}p{6.2cm} +} +\toprule +\textbf{算法} & \textbf{优势} & \textbf{劣势} \\ +\midrule + +PID 控制算法 & +\begin{itemize}[leftmargin=4mm,noitemsep] + \item 具有较高实时性,平均响应延迟小于 10ms + \item 可直接部署,无需训练过程 + \item 实现逻辑简单,易于嵌入控制系统 +\end{itemize} & +\begin{itemize}[leftmargin=4mm,noitemsep] + \item 缺乏对环境动态变化的适应能力,在复杂障碍场景中成功率较低(仅为 32.7\%) + \item 控制器参数 $K_p, K_i, K_d$ 需人工调节,调优过程依赖经验 + \item 不具备长期路径规划能力,无法处理延迟反馈任务 +\end{itemize} \\ +\midrule + +DQN 算法 & +\begin{itemize}[leftmargin=4mm,noitemsep] + \item 支持离散动作控制,适用于有限动作空间建模(本研究设定 5 类基础动作) + \item 引入经验回放机制,提升训练收敛稳定性 + \item 能有效应对中等复杂度场景,实验成功率达 68.4\% +\end{itemize} & +\begin{itemize}[leftmargin=4mm,noitemsep] + \item 状态空间维度较高时($>10^5$)存在收敛困难 + \item 动作空间离散导致控制精度受限,轨迹易产生抖动 + \item 模型训练周期较长,需超过 $10^5$ 步迭代以获得有效策略 +\end{itemize} \\ +\midrule + +PPO 算法 & +\begin{itemize}[leftmargin=4mm,noitemsep] + \item 原生支持连续动作空间控制,精度可达 $0.1^\circ$ + \item 策略更新过程稳定,适应性强,实验成功率达 89.2\% + \item 可灵活引入多目标优化(如路径平滑、能耗最小化等) +\end{itemize} & +\begin{itemize}[leftmargin=4mm,noitemsep] + \item 策略网络结构较复杂(典型如两层 128 节点全连接网络) + \item 对超参数变化敏感,需精细调整学习率(一般位于 $[10^{-4}, 10^{-3}]$) + \item 对硬件资源需求高,完整训练过程需占用约 6GB GPU 显存 +\end{itemize} \\ +\bottomrule +\end{tabular} +\end{table} + +\section{本章小结} + +本章中基于强化学习的行人控制方法,描述了实验环境Carla的搭建,并选择了现实运用场景较多的城市环境-城市场景作为仿真模型场景,满足了对仿真的复杂性和真实性需求。描述了三种不同算法(分别为PPP、PID和DQN)如何在模型中训练,并使用行人的状态和传感器数据构建模型使其动态交互,从而对智能体进行最好的控制。对比了三种不同算法在不同情况下的避障效果、路径规划效果和稳定性等的优劣,验证了算法的有效性。为后续中强化学习方法和系统的搭建的进一步改进和优化奠定基础。 diff --git a/tactile/undergraduat/content/chapter4.tex b/tactile/undergraduat/content/chapter4.tex new file mode 100644 index 00000000..e42577bd --- /dev/null +++ b/tactile/undergraduat/content/chapter4.tex @@ -0,0 +1,243 @@ +\chapter{行人导航系统设计} + +\section{系统设计目标与需求分析} + +本行人导航系统设计目的是城市环境的行人导航,以智能的技术手段,为行人提供绕行障碍物、快速到达目标的路径规划,因此本行走式行人导航系统需满足以下要求:基于用户的起终点坐标信息,规划最短路径,包括:考虑道路距离、行人速度、路况、交通规则;实时感知、规避障碍物(包括其他行人、交通事故、施工工地等)、实时监控周边环境信息并调整路径、应对突发障碍物或路径更改;实时感知周边环境并调整路径和决策。 + +系统主要目标是构建一个可训练、可测试、可交互的行人导航平台,需在复杂动态环境中提供快速、精确、安全的行人导航服务,而这些也是如今虚拟人发展所需要的一个重要技术,可以分为功能需求和非功能需求。 + +\textbf{功能需求}:包括方向控制、速度控制、行走状态切换的真实感行人运动控制;路径规划、躲避障碍任务的学习环境搭建;基于激光雷达和碰撞探测器对动态障碍物进行感知与反馈;图形界面参数设置与训练进程控制。 + +\textbf{非功能需求}:系统应支持在Carla仿真平台运行并具备高鲁棒性与低资源消耗,强化学习训练过程需保持稳定并具备扩展能力,用户交互界面需具有人机交互性强与操作简洁的特点。 + +\section{系统结构设计} + +本系统采用三层结构设计,分别为底层感知层、中间控制逻辑层和用户交互层,各层之间关系如图~\ref{fig:system-architecture}所示: + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/nav_system_architecture.png} + \caption{系统总体结构图} + \label{fig:system-architecture} +\end{figure} + +\textbf{底层感知层}:该层负责Carla仿真平台的连接和初始化传感器,通过Python的API生成行人生成路径采样、目标点采样和路径采样的过程,激光雷达、碰撞传感器实时扫描环境。 + +\textbf{中间控制逻辑层}:该层为系统的内核逻辑层,即定义强化学习环境、奖励函数体系、PPO训练模型等。在学习的回合中,环境返回动作的奖励,并进行状态更新;在推理过程中,策略网络在状态上推理,并进行状态更新。 + +\textbf{用户交互层}:基于PyQt5构建GUI(v1.4版本以优化为基于PyQt6),用户可视化设置参数(如训练步数、目标点、导航模式),并实时查看导航状态、训练进度、路径规划图等。界面还支持导入模型与输出路径记录。如图 \ref{fig:location},当用户点击显示可生成行人位置时,地图上便会出现所有可以用来生成行人位置的地方,以方便用户进行初始地点和目标地点的选取。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/location_point.pdf} + \caption{可生成行人位置示意图} + \label{fig:location} +\end{figure} + +\section{模型训练奖励函数设计} + +强化学习任务中奖励函数设计至关重要,在行人导航系统中其直接影响智能体决策行为,合理设计奖励函数是实现高效稳定导航的关键,以下为本系统奖励函数的设计思想与实现细节: + +\subsection{目标达成奖励} +目标达成奖励的目的是鼓励行人尽快接近目标,并在接近时给出更高的奖励。通过根据目标距离的变化量来调整奖励,确保模型能够学习到快速、有效的路径规划。 + +\begin{equation} +R_{\text{target}} = +\begin{cases} +1000 \cdot \mathbb{X}(d_{\text{target}}<3) & \text{终止条件} \\ +\Delta d \times 50 \times \left(1 - \frac{d_{\text{target}}}{100}\right) & \text{常规状态} +\end{cases} +\end{equation} +其中: +\begin{itemize} + \item \( \Delta d = d_{\text{prev}} - d_{\text{target}} \) 表示单步距离变化量 + \item 动态系数强化近距离奖励:\( d_{\text{target}} \) 在 \([0, 100]\) 范围内时,系数从1.0线性衰减至0.0 +\end{itemize} + +\subsection{路径跟踪奖励} +路径跟踪奖励旨在鼓励行人沿着预定的路径行进。通过计算行人与路径的横向偏差来调整奖励,确保行人尽量沿着正确的路线行走。 + +\begin{equation} +R_{\text{path}} = +\begin{cases} +1.5 \cdot \left(1 - \frac{\Delta_{\text{dev}}}{2}\right) & \Delta_{\text{dev}} \leq 2\ \text{m} \\ +-1.0 & \Delta_{\text{dev}} > 2\ \text{m} +\end{cases} +\end{equation} +其中: +\begin{itemize} + \item \( \Delta_{\text{dev}} = \left\| \vec{p}_{\text{current}} \times \vec{v}_{\text{forward}} \right\| / \left\| \vec{v}_{\text{forward}} \right\| \) 为路径偏差的计算方法。 +\end{itemize} + +\subsection{安全避障机制} +安全避障机制的目的是通过惩罚碰撞事件和危险距离来确保行人安全,避免与障碍物发生碰撞。 + +\begin{equation} +R_{\text{safety}} = +\begin{cases} +-500 \cdot \mathbb{X}_{\text{collision}} & \text{碰撞事件} \\ +-\dfrac{0.5}{d_{\text{obs}} + 0.5} & d_{\text{obs}} \leq 2\ \text{m} \\ +-(v_{\text{prev}} - v_{\text{curr}}) & \Delta v > 1\ \text{m/s} +\end{cases} +\end{equation} +其中: +\begin{itemize} + \item \( \mathbb{X}_{\text{collision}} \) 表示碰撞事件,碰撞时给予-500的惩罚。 + \item \( d_{\text{obs}} \) 为障碍物的最小距离,若小于2米,则按距离反比例惩罚。 + \item \( \Delta v = v_{\text{prev}} - v_{\text{curr}} \) 为速度变化,若速度骤降超过1米每秒,则给予惩罚。 +\end{itemize} + +\subsection{运动模式优化} +运动模式优化的目的是确保行人的速度保持在合适范围内。通过设定不同速度区间的奖励,鼓励行人在不同距离的情境下选择合适的速度。 + +\begin{equation} +R_{\text{motion}} = +\begin{cases} +0.2 & \text{低速合规}(0.3 \leq v \leq 1.0)\ \cap\ d_{\text{target}} < 5\ \text{m} \\ +0.1 & \text{中速合规}(0.5 \leq v \leq 1.5) \\ +-0.2(v-1.0) & \text{超速状态}(v > 1.0)\ \cap\ d_{\text{target}} < 5\ \text{m} +\end{cases} +\end{equation} + +\subsection{时间效率惩罚} +时间效率惩罚的目的是防止模型做出过多无效的移动或徘徊,鼓励快速完成任务。 + +\begin{equation} +R_{\text{time}} = -0.01 \cdot t_{\text{step}} +\end{equation} +其中: +\begin{itemize} + \item 每一步都会施加一个固定的时间惩罚,以鼓励高效的路径规划。 +\end{itemize} + +\subsection{终止条件奖励} +终止条件奖励的目的是当模型达到目标位置时给予额外奖励,或者在碰撞时进行终止。 + +\begin{equation} +R_{\text{terminal}} = +\begin{cases} ++1000 \cdot \mathbb{X}(d_{\text{target}} < 2\ \text{m}\ \cap\ \theta_{\text{error}} < 45^\circ) & \text{精确到达} \\ +-500 \cdot \mathbb{X}_{\text{collision}} & \text{碰撞终止} +\end{cases} +\end{equation} +其中: +\begin{itemize} + \item \( \theta_{\text{error}} = \left| \arctan\left(\frac{-\Delta y}{\Delta x}\right) - \theta_{\text{current}} \right| \) 表示当前朝向与目标方向之间的角度偏差。 + \item 双重终止条件确保目标点朝向正确性。 +\end{itemize} + +\subsection{综合奖励架构} +综合奖励架构的目的是将各个独立的奖励信号进行加权求和,形成一个最终的奖励值。这可以确保模型在考虑多个目标时进行平衡。 + +\begin{equation} +R_{\text{total}} = R_{\text{target}} + R_{\text{path}} + R_{\text{safety}} + R_{\text{motion}} + R_{\text{time}} + R_{\text{terminal}} +\end{equation} + +该奖励函数由\( R_{\text{target}} \) 、\( R_{\text{path}} \) 、\( R_{\text{safety}} \) 、\( R_{\text{motion}} \)、 \( R_{\text{time}} \) 、\( R_{\text{terminal}} \)等部分构成,其中 \( R_{\text{target}} \) 为目标达成奖励旨在激励智能体尽快接近导航终点;\( R_{\text{path}} \) 为路径跟踪奖励鼓励智能体沿预设路径平稳前进;\( R_{\text{safety}} \) 为安全奖励用于约束行人规避碰撞与危险区域;\( R_{\text{motion}} \) 为运动模式奖励通过引导合理速度与姿态优化行进行为;\( R_{\text{time}} \) 为时间效率惩罚用于约束过慢行为提升总体路径效率;\( R_{\text{terminal}} \) 为终止条件奖励用于在任务完成时给予最终正向激励。 + +\subsection{具体实现} +通过上述奖励函数的设计,使行人导航系统实现智能体在环境中的避障,快速到达目标,对自身的行动决策方案不断优化来寻找最优路径。本节通过环境中具体场景的设定和相应传感器的帮助完成导航,如:观测空间耦合,动态奖励系数计算,路径可视化等。 + +本系统的路径规划与训练环境具有多项关键特征。观测空间采用12维特征向量形式,集成了局部路径点坐标 \(x_{\text{wp}}, y_{\text{wp}}\)、障碍物距离 \(d_{\text{obs}}\) 等状态信息,增强了状态表示能力与感知精度。奖励函数中引入目标距离因子 \(1 - \frac{d}{100}\),实现奖励强度随导航进展自适应变化,提升训练灵敏度与稳定性。安全机制设计为分层结构,依次包括碰撞检测模块、障碍物距离判断与速度变化分析,三者构成对复杂环境中行人行为的全方位保护。路径点通过Carla平台调试接口实时渲染与可视化,为模型训练提供可观测的反馈支撑。 + +\section{路径规划与避障设计} + +为了实现行人从起点自主导航至终点的位置,本系统基于 Carla 仿真平台的人行道地图信息实现了路径规划模块,并结合激光雷达传感器与碰撞检测机制设计了避障逻辑,从而使得训练与推理过程具备高度的真实交互性与安全性。 + +\subsection{路径规划机制} + +\subsubsection{Waypoint路径规划} + +本系统的v1.2和v1.3版本的路径规划机制采用 Carla 提供的人行道导航信息,基于其地图 Waypoint 系统进行路径规划。行人生成后,通过设定的起点和终点位置,路径规划模块使用以下流程自动生成一条可通行的人行道路径: + +首先将生成的起点与目标位置映射为距离最近的人行道类型(Sidewalk)Waypoint,确保路径生成遵循场景中的通行规则。路径拓展采用基于距离阈值的前向搜索策略,从起点出发调用 \texttt{waypoint.next(distance)} 方法连续生成多个路径点,直到所生成路径接近目标位置为止。所有路径点以 \texttt{planned\_waypoints} 列表形式保存,并通过Carla平台的Debug模块以箭头形式绘制于场景中,提供路径可视化支持与调试依据。 + +该路径规划策略具备多方面优势,能够确保路径始终沿合法人行道生成以避免穿越非通行区域并符合交通规则与仿真约束,同时路径生成精度可通过调整采样分辨率进一步优化以满足不同任务场景精细化需求,遇到异常或失败情况时系统触发回退或重试逻辑以提升整体鲁棒性与容错能力。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/path_waypoint1.pdf} + \caption{旧版红色箭头路径示意图} + \label{fig:way1} +\end{figure} + +如图 \ref{fig:way1}所示地图上生成的红色箭头为路径规划标记,因生成箭头限制在 200 个以内且采用强制到达终点设计导致导航路径显得较为生硬,这些可通过后期硬件提升和版本优化改善。 + +\subsubsection{A*启发式搜索算法} + +A*算法是一种启发式搜索算法,用于在加权图中高效寻找两点间最短路径。其核心通过综合评估路径代价优化搜索方向,特征如下: + +\paragraph{算法原理:} +\begin{enumerate} + \item \textbf{代价函数}:算法以总代价函数作为路径评估依据,形式为 + \[ + f(n) = g(n) + h(n) + \] + 其中,$g(n)$表示从起点到当前节点$n$的累计实际代价,$h(n)$表示从节点$n$到目标位置的估算代价,常以欧氏距离进行计算。 + + \item \textbf{数据结构}:算法维护两个核心节点集合。开放列表按照总代价$f(n)$排序,用于存放尚未扩展的节点;封闭列表用于记录已被探索的节点,从而避免重复搜索。 + + \item \textbf{搜索流程}:将起点纳入开放列表后,反复选取总代价最小的节点进行处理,若该节点为目标位置则开始路径回溯,否则扩展其所有邻接节点,更新这些节点的总代价并调整开放与封闭列表。 +\end{enumerate} + +\paragraph{关键性质:} + +\begin{enumerate} + \item \textbf{可接受性}:启发函数必须满足估算代价不超过最短实际代价 + \[ + h(n) \leq h^*(n) + \] + 其中$h^*(n)$为从节点$n$到目标的真实最短代价,此条件保证算法能够得到最优路径。 + + \item \textbf{一致性}:若启发函数满足 + \[ + h(n) \leq c(n, n') + h(n') + \] + 其中$c(n, n')$为节点$n$到其邻接节点$n'$的移动代价,则算法在搜索过程中不会重复扩展任何节点,提升效率。 +\end{enumerate} + +\paragraph{代码实现:} +\begin{enumerate} + \item \textbf{启发函数选择}:使用欧氏距离$h(n) = \|n_{\text{current}} - n_{\text{target}}\|_2$,满足可接受性 + \item \textbf{路径搜索}:调用NetworkX库函数\texttt{nx.astar\_path},输入图结构、起点、终点及启发函数 + \item \textbf{异常处理}:路径搜索失败时记录错误日志,检查起点终点是否位于同一连通子图 +\end{enumerate} + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/path_waypoint2.pdf} + \caption{新版红色箭头路径示意图} + \label{fig:way2} +\end{figure} + +如图 \ref{fig:way2}所示的路径规划机制基于预先生成的静态可行走点构建导航图,通过A*算法实现路径搜索与优化。具体流程如下:可行走点数据从CSV文件加载,每个点包含坐标与唯一索引。利用k近邻方法将每个点与其最近的6个相邻点连接形成无向图,边权重为欧氏距离。通过提取最大连通子图确保路径可达性,避免无效路径生成。A*算法以欧氏距离为启发函数搜索起点至终点的最短路径,调用NetworkX库实现路径节点序列生成。路径需满足长度约束(20-200个点)且起点终点索引必须属于最大连通图合法编号集合。规划结果转换为虚拟路径点序列,行人控制器根据路径点动态设定目标位置。激光雷达实时检测障碍物距离,结合路径偏差计算与强化学习奖励机制调整行人转向及速度。路径可视化通过Carla调试工具实现,红色箭头标记规划路径,绿色点显示行人轨迹,起点与终点分别标注为“Start”和“Goal”,由于此标记为限时显示故此图中未标出,但可以看到一个绿色小点即为初始行人生成点。系统通过合法性检测功能验证路径对有效性,确保训练与演示的可行性。代码核心模块包含图构建、A*搜索、路径更新及控制逻辑,其特点为静态环境假设、障碍物实时避障与多维度可视化支持。图 \ref{fig:perspective1}和图\ref{fig:perspective2}展示了其他视角下路径规划出来的红色箭头,便于用户更直观的理解。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/nav_perspective1.pdf} + \caption{起点视角} + \label{fig:perspective1} +\end{figure} + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/nav_perspective2.pdf} + \caption{终点视角} + \label{fig:perspective} +\end{figure} + +\subsubsection{避障与动态反应机制} + +避障模块主要是根据激光雷达传感器从 Carla 平台实时返回的回传点云信息进行避障响应,在每次获取到的点云数据中寻找离障碍物最近点的最小值\texttt{min\_obstacle\_d\\istance},作为当前避障初始化值,若小于 2.0m 则速度减小,将行人的当前避障初始化值减小至小于 0.8m/s,降低行人的碰撞概率。在奖励函数中增加避障的惩罚,如果行人离障碍物太近且速度较快的话,扣减一定的奖励值,从奖励角度避免智能体采取危险动作。同时,如果检测到碰撞传感器,则立即退止出小节,对智能体进行大惩罚(-500),增加对碰撞信息的反馈权重。 + +该机制将传感器、速度控制器、奖励函数调整三个部分算法结合起来,构成一个完整的避障控制算法。Agent在训练中动态复杂的环境中学习如何规划路径,在避障和路径规划之间寻找一个平衡点,使路径规划更安全稳定。 + +\subsection{路径规划与避障的协同工作} + +路径规划模块和避障模块之间是紧密相连的,为了保证路径的安全可靠,行人在沿着规划路径行走的同时,不断在路径中利用激光雷达和碰撞传感器等进行障碍物探测,遇到阻挡物时进行避让处理,避免碰撞,避免偏离规划路径,并在进行避障处理后,路径规划模块及时重新寻找最优路径并继续向着目标路径行走,确保行人在复杂的路径环境中向着目标方向行走,安全有效的完成路径任务。 + +\section{本章小结} + +本章介绍了行人导航系统的设计方案,以构建具备环境感知、路径规划及避障功能的行人智慧导航应用平台作为系统最终目标,对复杂城市场景中的行人导航应用系统进行场景化设计。首先明确了系统实现的快速路径规划、避障感知与避障控制、交互与可视化等主要功能,从非功能性、功能性角度进行系统需求分析;设计感知、控制与交互三部分构成的三层系统模型,对系统各部分进行分工与相互关系说明;设计奖励函数作为强化学习的关键内容,并从实现目标达成、路径追踪、安全规划与效率规划等子问题出发,提升行人导航学习的实时收敛效率;对行人路径规划模型、避障控制策略与训练环境设置等核心实现部分进行描述,为之后实验分析及模型效果评估提供系统平台。 + + diff --git a/tactile/undergraduat/content/chapter5.tex b/tactile/undergraduat/content/chapter5.tex new file mode 100644 index 00000000..3ebbb9db --- /dev/null +++ b/tactile/undergraduat/content/chapter5.tex @@ -0,0 +1,152 @@ +\chapter{行人导航系统实现} + +\section{编码与实现} + +\subsection{环境模块实现} + +底层的系统环境包含一个\texttt{EnhancedPedestrianEnv}类,它是系统和虚拟仿真平台交互的底座。实现系统与虚拟仿真平台的稳定连接CarIa、地图的加载、模拟行人对象的生成与销毁、路径上起终点的设置、路径上的规划与可视化、路径上搜索时的反馈信息以及智能体对环境的感知;通过合理编码状态空间、运行控制动作、为后续算法学习和策略推理提供支持。 + +\subsection{奖励函数实现} + +为了能够使智能体顺利地在复杂环境中完成导航任务以及避开障碍物,设计了一系列的奖励项,由于是目标导向,当智能体到达终点就给予+1000的奖励,同时为了使智能体在到达终点之前不能偏离轨迹,设计了一个在智能体偏离轨迹时就会给-500的奖励项,这个奖励项可以约束智能体沿着预设的轨迹前进,此外,在智能体与障碍物发生碰撞后给予-500的重奖,可以减少危险动作;对于智能体的避障动作以及智能体移动的速度给予奖励,使智能体在完成避障的同时以较快的速度前进,确保智能体的导航效率。 + +\subsection{PPO模型集成} + +本系统采用\texttt{Stable-Baselines3}库中实现的 PPO算法作为主要控制策略模型。该算法在高维状态空间中表现出良好的稳定性和适应性,适用于本项目中的行人控制任务。完成状态空间与动作空间的定义后,系统对算法进行封装并结合\texttt{DummyVecEnv}接口进行训练,使模型能够连续接收来自环境的状态输入并输出相应动作决策。训练完成后,模型保存为\texttt{.zip}文件格式,以便后续部署与调用。 + +\subsection{GUI实现} + +系统界面基于 PyQt6 开发,提供图形化操作平台,详情的用户界面截图可见附录。界面支持模型训练的控制与管理,实时显示路径导航信息,支持模型文件的导入操作,并可直接启动仿真过程。同时,日志信息以可视化方式输出,方便开发者监控系统运行状态并进行调试,提升整体使用体验。 + +\section{系统测试} + +\subsection{测试方法} + +为确保系统完整性可靠性进行测试工作采用模块单元测试与集成系统测试结合的方式。路径生成模块测试首先测试在起点终点不同组合下均能规划出一条路径,以验证路径算法的跨场景适用性,如图 \ref{fig:progress_bar}所示即在路径点范围内可用路径。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/available_path.pdf} + \caption{可用路径} + \label{fig:available_path} +\end{figure} + +其次,对传感器测试感知,分别测试激光雷达和碰撞检测模块,通过不同障碍物触发条件测试激光雷达和碰撞检测模块是否及时响应和记录事件,测试传感器的数据逻辑是否处理正确。再次,奖励系统,通过不同的典型情况测试实际输出的奖励值是否和设计一致,如达到目标、偏离路径、发生碰撞、避障成功,判断奖励的激励是否合理。最后,界面交互,测试用户的操作是否被正确操作执行,各个交互按键是否正常执行,导航的路径是否正常显示在界面上,日志和状态的输出是否正常显示在界面上,测试图形界面是否完整,交互可用,通过如图 \ref{fig:progress_bar}所示的进度条管理来反馈此时的训练进程给用户。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/progress_bar.pdf} + \caption{运行进度条} + \label{fig:progress_bar} +\end{figure} + +\subsection{测试结果} + +系统经不同路径,场景的测试,在路径规划、障碍检测、UI交互、奖励回馈等关键方面都具备较强的稳定性、高效性。表 \ref{tab:test-results} 汇总了主要测试模块的结果。 + +\begin{table}[H] + \centering + \caption{系统测试结果汇总} + \label{tab:test-results} + \renewcommand{\arraystretch}{1.3} + \begin{tabular}{ + >{\centering\arraybackslash}p{4cm} + >{\centering\arraybackslash}p{3cm} + >{\centering\arraybackslash}p{6cm} + } + \toprule + \textbf{测试模块} & \textbf{结果} & \textbf{备注} \\ + \midrule + 路径规划 & 成功 & 最长路径点数 96 个 \\ + 避障检测 & 正确响应 & 成功避障率 95\% \\ + GUI 交互 & 正常 & 控件无卡顿 \\ + 奖励反馈 & 正确计算 & 终止条件有效 \\ + \bottomrule + \end{tabular} +\end{table} + +路径规划实验过程中,所有起始点和目标点都不相同的情况下,都能够规划出一条路径,路径最长点数为96,表明路径规划算法适应性强,稳定性好。避障检测实验,分别设置不同种类的静态、动态障碍物,系统检测与避障均能够被触发,系统避障率为95\%,表明避障检测实验能够较好检测到障碍物,对环境的适应性强。图形界面操作实验测试,交互按键均能够被系统快速识别,系统的训练、导入、模拟等操作没有出现卡帧、延时情况,图形界面显示的按键都能正常使用,系统交互操作较为稳定。奖励反馈方面,系统在满足结束条件(到达、碰撞)时均能够及时显示出相应的结果与惩罚,系统奖励与惩罚功能逻辑清晰准确,且稳定工作,对智能体的学习具有较好的指导意义。 + +\section{系统数据管理} + +行人在进行导航系统的训练与测试中,会涉及到大量与行走、路径规划、避障、强化学习相关的数据,为了便于保存,便于统一管理,便于后期分析,设计了轻量级数据库。 + +本节介绍数据库架构、数据来源、表结构设计、记录逻辑以及数据库在模型训练与评估中的应用。 + +\subsection{地图与可行走区域设置} + +导航系统使用CARLA平台中的Town01地图作为基础环境,地图结构包含道路、建筑、人行道与交通标志等元素。为构建有效导航起点与终点,系统预先提取可行走区域点集,并将其以CSV格式保存为walkable\_points\_Town01.csv。该文件记录了地图中经过筛选的可通行坐标点,字段包含x、y、z三维坐标,其中z值统一为0.3表示地面层高度,如下表所示。 + +\begin{table}[H] + \centering + \caption{部分可通行坐标点数据表} + \label{tab:coord_data} + \begin{tabular}{cccc} + \toprule + index & $x$ & $y$ & $z$ \\ + \midrule + 0 & 335.4899 & 273.7433 & 0.3000 \\ + 5 & 272.2900 & 59.3301 & 0.3000 \\ + 6 & 272.2900 & 55.8400 & 0.3000 \\ + 9 & 202.5500 & 59.3301 & 0.3000 \\ + 10 & 202.5500 & 55.8400 & 0.3000 \\ + 11 & 92.1100 & 227.2200 & 0.3000 \\ + 13 & 191.0800 & 55.8400 & 0.3000 \\ + 17 & 158.0800 & 27.1800 & 0.3000 \\ + 18 & 295.0818 & 199.0603 & 0.3000 \\ + 19 & 295.0818 & 195.5703 & 0.3000 \\ + \bottomrule + \end{tabular} +\end{table} + +地图的原始格式存储为.pcd和.bin文件,分别表示点云文件和生成地图路径图文件,在路径生成和障碍物探测方面进行。根据实际情况,有些区域障碍物比较多,系统就跳过障碍物,路径生成以目标点在无障碍的区域内为原则。 + +\subsection{模型与数据融合} + +系统采用PPO强化学习算法进行路径控制训练,训练过程中使用EnhancedPedestrianEnv作为交互环境,执行策略动作后将轨迹反馈、奖励变化与环境观测存储至数据库。模型训练模块封装于TrainingWrapper类,周期性保存模型参数至.zip格式,并记录每轮训练的统计指标。 + +系统训练流程中由trajectory\_log写入路径轨迹,collision\_events记录碰撞反馈,training\_summary跟踪整体表现。模型文件最终保存为pedestrian\_ppo.zip,包含策略网络权重与环境配置,便于复现与迁移。图\ref{fig:progress_bar}即为保存下来的模型压缩包内部文件。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/model.pdf} + \caption{模型文件} + \label{fig:model} +\end{figure} + +GUI系统提供演示功能,加载模型并自动运行路径导航,期间继续采集数据并补充至数据库,支持实验复验与可视化重构。 + +该流程构建数据生成、模型训练与效果评估闭环,数据库不仅承担记录任务还作为策略分析与系统评估的基础核心。 + +\section{系统部署与维护} + +\subsection{部署方案} + +本文系统支持本地部署,硬件环境推荐 CPU 为英特尔 i7、硬盘 16G 及以上,部署前需预先安装 Carla 仿真平台及 PyQt6、stable-baselines3、gymnasium 等 Python 依赖库以确保系统正常运行,整个部署流程简洁,用户可按附录用户手册操作,主要步骤如下: + +\begin{enumerate} + \item 启动 Carla 仿真服务以初始化虚拟环境; + \item 运行系统图形界面程序,进入主控制面板; + \item 在界面中选择起始点与目标点,用户可选择重新训练强化学习模型,或加载已有模型直接进入导航仿真流程。 +\end{enumerate} + +上述部署过程可在具备基础开发经验的条件下快速完成,模块化架构设计也为系统的跨平台适配与扩展提供了便利。 + +\subsection{后期维护与优化} + +系统发生的所有重要的事件、状态的日志被记录在日志系统中,并且在图形化界面的状态栏中显示,如图 \ref{fig:gui-log} 所示。日志显示系统正在进行什么操作,或者检测到错误正在报警。当系统检测到错误或者报警时,在系统中会出现位置和类型,开发人员可以依据位置在源代码中定位修复错误。 + +\begin{figure}[H] + \centering + \includegraphics[width=1\textwidth]{images/gui_log.pdf} + \caption{日志显示截图} + \label{fig:gui-log} +\end{figure} + +为了提高系统可维护性,源程序的结构采用模块式的结构,对系统进行数据处理、策略学习、图形界面、仿真交互的划分,降低了它们之间的耦合性,让用户在维护的过程中便于对系统进行修改,并且便于使用者对系统进行个性化修改。 + +在完善方面,系统是可拓展的,后续可以设计多智能体协作,在更密集的交通环境中展开行人合作博弈实验;系统可以加载更复杂的仿真地图(Town02、Town03、Town04、Town05、Gender5),进一步测试模型在高密度交通环境中的泛化能力。同时,通过结合目标检测(如YOLO系列),动态识别对象、设计行为预测模块实现前瞻性规避障碍策略,能进一步提升系统应对动态变化的鲁棒性与智能性。 + +\section{本章小结} + +本章主要对行人导航系统的具体搭建进行详细说明,在虚幻引擎和Carla的基础上,对系统的环境生成、模型部署、界面设计、数据管理等进行了实现。首先对系统的代码流程以及具体模块进行介绍,完成了PPO模型的部署以及多维奖励函数,然后设计了键盘和GUI操作进行用户体验,最后完成了仿真环境内行人导航过程的显示。最后对路径长短、避障情况和路径正确与否等指标进行了测试和分析,在系统具体实现方面,本文对系统复杂环境的适应性以及可靠性进行了证明,对日后的研究工作有很大的借鉴意义。本章完成了系统的初步实现,为之后系统分析工作做出了铺垫。本系统的初步实现说明系统具备一定的完整性和可开发性,之后可以进行系统分析和系统改进工作。 diff --git a/tactile/undergraduat/content/chapter6.tex b/tactile/undergraduat/content/chapter6.tex new file mode 100644 index 00000000..57ec0537 --- /dev/null +++ b/tactile/undergraduat/content/chapter6.tex @@ -0,0 +1,35 @@ +\chapter{结果与展望} + +\section{实验结果} + +本文以CARLA模拟平台为实验环境,采用先进的基于增强学习算法训练行人路径规划模型的方法,构建可规避障碍物从而提升行人步行效率和步行安全的深度学习行人路径规划系统,通过多种天气、多种时间、多种交通密度等多种情况下的训练和实验,确保了其在各种复杂情况下的表现,取得了可供借鉴的实验效果,为行人路径规划研究提供参考意义。 + +1.\textbf{训练过程与效果:} + +本项目基于 CARLA 仿真平台设计实现行人导航系统,运用 PPO、DQN、PID 等多种强化学习算法训练行人移动并开展不同策略对比实验,结果显示基于 PPO 和 DQN 的模型在避障与目标导航任务中性能优异,不同训练阶段行人导航的成功率、路径效率和速度等指标有效提升,PPO 算法使行人在复杂环境中较稳定避障并快速找到目标位置,DQN 模型目标导向性和避障灵活性好但在复杂障碍物环境中响应迟缓,PID 控制策略稳定性高但面对多变障碍物灵活性不足。实验核心是用强化学习算法控制行人在模拟环境行进并避障,基于 PPO 算法训练行人模型并设置多场景模拟现实情况,训练中模型逐渐适应环境变化且多数情况下成功完成起点到目标的导航,PPO 算法适应能力良好,训练中模型提升对障碍物的感知与避让能力和行进效率,数万步训练后行人模型能在给定环境高效避开车辆、行人等动态障碍物到达目标位置。 + +2.\textbf{模型评估与性能分析:} + +通过测试在训练后模型在实际场景中的表现来验证模型的关键性指标,模型在复杂、动态的场景中能迅速规划出有效路径并规避无效绕行停顿,在可接受的时间内到达目标点;不受行人、车辆等其他动态障碍物的干扰有良好的避障能力,通过多次训练来适应各种障碍物所处位置和运动趋势而规划出正确路径避免碰撞。模型采用 PPO 算法在训练过程中稳定高效,训练通过几步就靠近最终目标,一般可以无碰撞在多个实验环境中达成目标。为了充分验证模型性能,评估了从简单到复杂多个难度等级的多种环境,训练后模型行人模型在复杂城市街道场景和简单开放场景中的成功率都很高,模型验证了复杂度不高的鲁棒性。 + +3.\textbf{实时控制效果:} + +模型训练后,在真实场景下仿真测试,检测实时控制效果。实时路径控制通过实时环境信息调整行人行走的速度和方向,确保行人方向可以正确避开障碍物并朝目标方向行进。模型在多种实验条件下均很好适应环境信息的变化,在复杂多变的障碍物场景中或环境信息切换的情况下,均能很好适应环境信息变化。 + +\section{未来工作与展望} + +虽然本论文完成了基于强化学习的行人导航控制系统,并在多个仿真环境中得到了比较满意的实验结果,但是仍有很多方面需要继续完善和改进。未来的研究工作可以从以下几个方向进行深入探索和扩展: + +1.\textbf{优化和增强算法:}本次研究中的 PPO 算法控制较好,但是也存在局限性,面对更难的交通场景,在完成训练并收敛需要耗费较长时间,后续研究可以将其与深度 Q 网络、基于模型的强化学习等算法结合,提高训练效率,加速收敛。深度 Q 网络、基于模型的强化学习等算法可继续研究,将其和 PPO 结合,可以提升算法在复杧行为环境中的算法性能,或者将混合强化学习的算法进行结合更多的场景,更为复杂的环境。 + +2.\textbf{多智能体协作与调度:}目前学术界和工业界研究重点多集中于单一行人导航控制技术,而随着智慧城市与智能交通系统的发展进步,未来研究方向有望拓展至多智能体系统。在多智能体系统中多个行人、车辆及其他智能体间的协作愈发关键,因此研究多人环境中行人与行人、行人与车辆的协作协调机制十分重要。采用多智能体强化学习(MARL)方法模拟不同智能体相互作用并优化其路径选择以提高系统运行效率是一个潜在研究方向。 + +3.\textbf{传感器环境认知能力提升:}已有的研究多使用激光雷达、摄像头这两种常用传感器进行感知认知,在后续的研究中可以引入更多种类的传感器来增强行人智能体对环境的感知能力,例如深度摄像头、红外传感器等。这些高层次的传感器能够提供低光、雨雾雪情况下更丰富的环境数据,感知能力增强后可以辅助行人智能体实现更好的避障、减少碰撞、获得更丰富更准确的环境信息,而环境信息又对智能体的路径规划决策起重要作用,辅助智能体更智能的规划出最优路径、提高效率、保障安全。 + +4.\textbf{复杂场景的应用与测试:}当前实验包括不同环境、不同障碍物等情况,由于仿真的限制,无法对真实场景中复杂的真实影响因素进行考验,今后工作中将系统投入到真实世界,在城市道路、繁忙地点、各种公共场所等复杂交通环境对实际障碍物更加复杂的情况进行考验,同时考虑交通环境中天气、光线等复杂影响因素对系统的影响。行人控制系统在真实世界的实时性和稳定性有更多考验,如何在实时高效率寻路的同时对复杂的外界变化进行处理是今后工作中的重点。 + +5.\textbf{集成与系统优化:}智能城市与自动驾驶技术的进步普及对行人导航控制系统提出多系统集成需求,需与自动驾驶、交通管理等系统协同以确保行人在自动驾驶环境中与车辆及其他元素协调共存,这成为未来研究的重要焦点。硬件部署、通信延迟、传感器精度等技术细节深刻影响系统实际应用效果,有效开展系统集成与优化以保障行人安全和交通流畅是未来研究不可忽视的关键课题。 + +\section{结论} + +本研究应用强化学习领域的 PPO 算法,基于 CARLA 平台开发行人路径规划与障碍物规避控制系统,通过模型训练及测试验证了系统在复杂环境中的稳定性与避障能力。未来研究将围绕算法改进、传感器算法优化、多智能体合作及实际场景测试展开,以拓展系统在实际应用中的广度与深度,适应更广泛环境。随着技术进步与多学科交叉融合,基于智能算法的行人控制系统在智能交通和智慧城市建设中的重要性愈发凸显,将为城市交通智能化与安全化发展贡献重要价值。​ \ No newline at end of file diff --git a/tactile/undergraduat/content/cmdel.bat b/tactile/undergraduat/content/cmdel.bat new file mode 100644 index 00000000..c9642e0a --- /dev/null +++ b/tactile/undergraduat/content/cmdel.bat @@ -0,0 +1,2 @@ +del /a /f *.xml *.bcf *.out *.log *.sav *.gz *.aux *.bbl *.bak *.dvi *.blg + diff --git a/tactile/undergraduat/content/content.tex b/tactile/undergraduat/content/content.tex new file mode 100644 index 00000000..6c2cd357 --- /dev/null +++ b/tactile/undergraduat/content/content.tex @@ -0,0 +1,29 @@ +%!TEX root = ../hutbthesis_main.tex + +%子章节为了便于查找和修改,建议通过input拆分文件 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\input{content/chapter1.tex} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\input{content/chapter2.tex} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\input{content/chapter3.tex} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\input{content/chapter4.tex} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\input{content/chapter5.tex} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\input{content/chapter6.tex} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/tactile/undergraduat/content/cover.tex b/tactile/undergraduat/content/cover.tex new file mode 100644 index 00000000..c172eec7 --- /dev/null +++ b/tactile/undergraduat/content/cover.tex @@ -0,0 +1,24 @@ +%!TEX root = ../hutbthesis_main.tex +% 文章信息(同时也是页眉) +\titlecn{基于虚幻引擎的行人强化学习控制和导航系统} +\headertitle{湖南工商大学毕业论文} +\titleen{Hunan University of Technology and Business Thesis \LaTeX{} Template v2.0} + + +%\minormajor{通信工程} +%\interestmajor{通信工程} +\author{张瀚驰} +\subsupervisor{} +\studentid{2123030023} +\priormajor{大数据与人工智能} +\myclass{数智2101班} +\supervisor{王海东} +\title{讲师} +\department{人工智能与先进计算学院} +\thesisdate{year=2025, month=5} + +%以下的对本科生没有用 +\clcnumber{TP391} % 中图分类号 Chinese Library Classification +\schoolcode{10533} % 学校代码 +\udc{004.9} % UDC +\academiccategory{学术学位} % 学术类别 diff --git a/tactile/undergraduat/content/declarationzh.tex b/tactile/undergraduat/content/declarationzh.tex new file mode 100644 index 00000000..b617c7d6 --- /dev/null +++ b/tactile/undergraduat/content/declarationzh.tex @@ -0,0 +1,28 @@ +%!TEX root = ../hutbthesis_main.tex + +\begin{declarationzh} + +本人郑重声明:所呈交的本科毕业论文是本人在指导老师的指导下,独立进行研究工作所取得的成果,成果不存在知识产权争议,除文中已经注明引用的内容外,本论文不含任何其他个人或集体已经发表或撰写过的作品成果。 +对本文的研究做出重要贡献的个人和集体均已在文中以明确方式标明。 +本人完全意识到本声明的法律结果由本人承担。 +\\ +\\ +\\ +\\ +\\ +\\ +\\ +\\ + + \vspace{30pt} + \begin{tabular}{ll} + %\renewcommand{\arraystretch}{2} + \makebox[4em][s]{作者签名:} & \makebox[100pt][c]{ } \\ + \\ + \makebox[2em][s]{日期:} & + \makebox[100pt][c]{\qquad 年\quad 月\quad 日 } \\ + \end{tabular} + + + +\end{declarationzh} diff --git a/tactile/undergraduat/content/info.tex b/tactile/undergraduat/content/info.tex new file mode 100644 index 00000000..17f826ad --- /dev/null +++ b/tactile/undergraduat/content/info.tex @@ -0,0 +1,16 @@ +%!TEX root = ../csuthesis_main.tex +% 文章信息 +\titlecn{湖南工商大学大学学位论文 \LaTeX{} } +\titleen{Hunan University Of Technology and Business Thesis \LaTeX{} } + +\priormajor{} +\minormajor{} +\interestmajor{} +\author{张瀚驰} +\supervisor{王海东\ 讲师} +\subsupervisor{} +\department{人工智能与先进计算学院} +\studentid{2123030023} +\thesisdate{year=2025,month=5} +\myclass{大数据与人工智能} + diff --git a/tactile/undergraduat/content/reference.bib b/tactile/undergraduat/content/reference.bib new file mode 100644 index 00000000..588035ad --- /dev/null +++ b/tactile/undergraduat/content/reference.bib @@ -0,0 +1,338 @@ +@article{qian2024sac, + author = {钱立军 and 宣亮 and 陈健 and others}, + title = {基于SAC算法的多交叉口交通信号控制研究}, + journal = {天津大学学报(自然科学与工程技术版)}, + year = {2024}, + volume = {57}, + number = {1}, + pages = {105--111} +} + +@article{wei2021survey, + author = {Wei, H and Zheng, G and Gayah, V and others}, + title = {Recent advances in reinforcement learning for traffic signal control: A survey of models and evaluation}, + journal = {ACM SIGKDD Explorations Newsletter}, + year = {2021}, + volume = {22}, + number = {2}, + pages = {12--18} +} + +@article{tao2024motion, + author = {陶幸 and 俞帆山 and 宋越杰 and others}, + title = {基于惯性传感器的免对准动作的人体上肢运动捕捉方法}, + journal = {飞控与探测}, + year = {2024}, + volume = {7}, + number = {2}, + pages = {28--35} +} + +@inproceedings{chen2018ionet, + author = {Chen, Chao and Lu, Xiaoxuan and Markham, Andrew}, + title = {IONet: Learning to cure the curse of drift in inertial odometry}, + booktitle = {Proceedings of the 32nd AAAI Conference on Artificial Intelligence}, + year = {2018}, + pages = {3146--3152}, + location = {New Orleans, USA}, + series = {AAAI'18} +} + +@inproceedings{herath2020ronin, + author = {Herath, S and Yan, H and Furukawa, Y}, + title = {RoNIN: Robust neural inertial navigation in the wild: Benchmark, evaluations, \& new methods}, + booktitle = {Proceedings of the 2020 IEEE International Conference on Robotics and Automation (ICRA)}, + year = {2020}, + location = {Paris, France}, + pages = {3146--3152} +} + +@article{liu2020tlio, + author = {Liu, W and Caruso, D and Ilg, E and others}, + title = {TLIO: Tight learned inertial odometry}, + journal = {IEEE Robotics and Automation Letters}, + year = {2020}, + volume = {5}, + number = {4}, + pages = {5653--5660} +} + +@article{mnih2013dqn, + author = {Mnih, V and Kavukcuoglu, K and Silver, D and others}, + title = {Playing Atari with deep reinforcement learning}, + journal = {arXiv preprint arXiv:1312.5602}, + year = {2013}, + eprint = {arXiv:1312.5602} +} + +@article{yazdani2023ivpl, + author = {Yazdani, M and Sarvi, M and Bagloee, S A and others}, + title = {Intelligent vehicle pedestrian light (IVPL): A deep reinforcement learning approach for traffic signal control}, + journal = {Transportation Research Part C: Emerging Technologies}, + year = {2023}, + volume = {149}, + pages = {103991} +} + +@article{zhang2019pedestrian, + author = {Zhang, Y and Zhang, Y and Su, R}, + title = {Pedestrian-safety-aware traffic light control strategy for urban traffic congestion alleviation}, + journal = {IEEE Transactions on Intelligent Transportation Systems}, + year = {2019}, + volume = {22}, + number = {1}, + pages = {178--187} +} + +@inproceedings{mourikis2007msckf, + author = {Mourikis, A I and Roumeliotis, S I}, + title = {A multi-state constraint Kalman filter for vision-aided inertial navigation}, + booktitle = {Proceedings of the IEEE International Conference on Robotics and Automation}, + year = {2007}, + location = {Rome, Italy}, + pages = {3565--3572} +} + +@article{zhao2014crossing, + author = {赵靖 and 马万经 and 杨晓光}, + title = {考虑下游交叉口的路段行人过街优化控制模型}, + journal = {同济大学学报(自然科学版)}, + year = {2014}, + volume = {42}, + number = {10}, + pages = {1536--1542} +} + +@article{foxlin2005tracking, + author = {Foxlin, E}, + title = {Pedestrian tracking with shoe-mounted inertial sensors}, + journal = {IEEE Computer Graphics and Applications}, + year = {2005}, + volume = {25}, + number = {6}, + pages = {38--46} +} + +@article{campos2021orbslam3, + author = {Campos, C and Elvira, R and Rodr{\'i}guez, J J G and others}, + title = {ORB-SLAM3: An accurate open-source library for visual, visual-inertial, and multimap SLAM}, + journal = {IEEE Transactions on Robotics}, + year = {2021}, + volume = {37}, + number = {6}, + pages = {1874--1890} +} + +@article{guo2020pdr, + author = {Guo, S and Zhang, Y and Gui, X and others}, + title = {An improved PDR/UWB integrated system for indoor navigation applications}, + journal = {IEEE Sensors Journal}, + year = {2020}, + volume = {20}, + number = {14}, + pages = {8046--8061} +} + +@article{wang2023llio, + author = {Wang, Y and Kuang, J and Niu, X and others}, + title = {LLIO: Lightweight learned inertial odometer}, + journal = {IEEE Internet of Things Journal}, + year = {2023}, + volume = {10}, + number = {3}, + pages = {2508--2518} +} + +@inproceedings{simonyan2014action, + author = {Simonyan, K and Zisserman, A}, + title = {Two-stream convolutional networks for action recognition in videos}, + booktitle = {Advances in Neural Information Processing Systems}, + year = {2014} +} + +@article{bochkovskiy2020yolov4, + author = {Bochkovskiy, A and Wang, C Y and Liao, H}, + title = {YOLOv4: Optimal speed and accuracy of object detection}, + journal = {arXiv preprint arXiv:2004.10934}, + year = {2020}, + eprint = {arXiv:2004.10934} +} + +@article{arulkumaran2017deeprl, + author = {Arulkumaran, K and Deisenroth, M P and Brundage, M and others}, + title = {Deep reinforcement learning: A brief survey}, + journal = {IEEE Signal Processing Magazine}, + year = {2017}, + volume = {34}, + number = {6}, + pages = {26--38} +} + +@article{ren2017fasterrcnn, + author = {Ren, S and He, K and Girshick, R and others}, + title = {Faster R-CNN: Towards real-time object detection with region proposal networks}, + journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence}, + year = {2017}, + volume = {39}, + number = {6}, + pages = {1137--1149} +} + +@article{redmon2017yolo9000, + author = {Redmon, Joseph and Farhadi, Ali}, + title = {YOLO9000: Better, faster, stronger}, + journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence}, + year = {2017}, + volume = {39}, + number = {6}, + pages = {6517--6525} +} + +@article{reid1980tracking, + author = {Reid, D B}, + title = {An algorithm for tracking multiple targets}, + journal = {IEEE Transactions on Automatic Control}, + year = {1980}, + volume = {24}, + number = {6}, + pages = {843--854} +} + +@article{howard2017mobilenets, + author = {Howard, A G and Zhu, M and Chen, B and others}, + title = {MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications}, + journal = {arXiv preprint arXiv:1704.04861}, + year = {2017}, + eprint = {arXiv:1704.04861} +} + +@article{dai2017temporalcontext, + author = {Dai, X and Singh, B and Zhang, G and others}, + title = {Temporal Context Network for Activity Localization in Videos}, + journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence}, + year = {2017} +} + +@article{lian2023inverseql, + author = {Lian, B and Xue, W and Xie, Y and others}, + title = {Off-policy inverse Q-learning for discrete-time antagonistic unknown systems}, + journal = {Automatica}, + year = {2023}, + volume = {155}, + pages = {111171} +} + +@article{clifton2020qlearning, + author = {Clifton, J and Laber, E}, + title = {Q-learning: Theory and applications}, + journal = {Annual Review of Statistics and Its Application}, + year = {2020}, + volume = {7}, + pages = {279--301} +} + +@article{zhang2023shapeiou, + author = {Zhang, H and Zhang, S J}, + title = {Shape-IoU: More accurate metric considering bounding box shape and scale}, + journal = {arXiv preprint arXiv:2312.17663}, + year = {2023}, + eprint = {arXiv:2312.17663} +} + +@article{wang2013densetrajectory, + author = {Wang, H and Kläser, A and Schmid, C and others}, + title = {Dense trajectories and motion boundary descriptors for action recognition}, + journal = {International Journal of Computer Vision}, + year = {2013}, + volume = {103}, + number = {1}, + pages = {60--79} +} + +@article{dsryolo2025, + author = {Anonymous}, + title = {DSR-YOLO: A lightweight and efficient YOLOv8 model for enhanced pedestrian detection}, + journal = {Cognitive Robotics}, + year = {2025}, + volume = {8}, + number = {4}, + pages = {105--120}, + note = {DOI: 10.1016/j.cogrob.2025.04.005} +} + +@article{ye2023fusion, + author = {Ye, Junhua}, + title = {Research on multi-sensor fusion pedestrian navigation and localization algorithm based on intelligent terminal}, + journal = {Acta Geodaetica et Cartographica Sinica}, + year = {2023}, + volume = {52}, + number = {1}, + pages = {170--170}, + doi = {10.11947/j.AGCS.2023.20210188} +} + +@inproceedings{luo2023adaptive, + author = {Luo, X. and Chen, W.}, + title = {Adaptive road configurations for improved autonomous vehicle-pedestrian interactions using reinforcement learning}, + booktitle = {Proceedings of the IEEE International Conference on Robotics and Automation}, + year = {2023}, + pages = {3146--3152}, + location = {London, UK} +} + +@techreport{sti2025, + author = {Shanghai Jiao Tong University}, + title = {STI-Bench: Are MLLMs Ready for Precise Spatial-Temporal World Understanding?}, + institution = {MIRA Lab}, + year = {2025}, + url = {https://arxiv.org/pdf/2503.23765} +} + +@patent{xiamen2025, + author = {Xiamen Road and Bridge Information Co., Ltd.}, + title = {Collision prediction method and system based on multi-agent reinforcement learning}, + number = {CN119091686B}, + year = {2025}, + date = {2025-01-29} +} + +@article{zhang2025traffic, + author = {Zhang, Q. and Lin, B.}, + title = {Joint imputation of multi-source traffic data based on shared multi-dimensional spatiotemporal feature}, + journal = {Journal of Sun Yat-sen University (Natural Science Edition)}, + year = {2025}, + volume = {63}, + number = {5}, + pages = {167--176} +} + +@article{changsha2021, + author = {Yuan, W.}, + title = {Intelligent pedestrian integrated signal light system in Changsha}, + journal = {Changsha Evening News}, + year = {2021}, + url = {http://hunan.sina.com.cn/news/2021-12-23/detail-ikyakumx5846490.shtml} +} + +@article{chen2025moo, + author = {Chen, W. and Zhang, X. and Lin, B.}, + title = {Gradient-based multi-objective deep learning: Algorithms, theories, applications, and beyond}, + journal = {arXiv preprint arXiv:2501.10945}, + year = {2025} +} + +@misc{openhutb2025, + author = {OpenHutB}, + title = {CARLA 行人导航教程[EB/OL]}, + howpublished = {\url{https://openhutb.github.io/carla_doc/tuto_G_pedestrian_navigation/}}, + year = {2025}, + note = {访问日期: 2025-04-27} +} + +@misc{csdn2023carla, + author = {CSDN 博客}, + title = {Carla 行人模型介绍与使用[EB/OL]}, + howpublished = {\url{https://blog.csdn.net/weixin_44983780/article/details/137682087?ops_request_misc=&request_id=&biz_id=102&utm_term=carla%E8%A1%8C%E4%BA%BA%E6%A8%A1%E6%8B%9F&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-137682087.142\^v102\^control&spm=1018.2226.3001.4187}}, + year = {2023}, + note = {访问日期: 2025-04-27} +} diff --git a/tactile/undergraduat/github/workflows/latex.yml b/tactile/undergraduat/github/workflows/latex.yml new file mode 100644 index 00000000..22a9393b --- /dev/null +++ b/tactile/undergraduat/github/workflows/latex.yml @@ -0,0 +1,27 @@ + +name: latex Windows CI/CD + +on: + push: + branches: + - "*" + pull_request: + branches: + - master + +jobs: + windows-dev: + name: Windows CI/CD + timeout-minutes: 1440 + runs-on: self-hosted:windows + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: build + run: | + call build_latex_tactile.bat + shell: cmd \ No newline at end of file diff --git a/tactile/undergraduat/hutbthesis.cls b/tactile/undergraduat/hutbthesis.cls new file mode 100644 index 00000000..ab75e033 --- /dev/null +++ b/tactile/undergraduat/hutbthesis.cls @@ -0,0 +1,1264 @@ +% +% 本模版根据湖南工商大学本科生学位论文撰写规范创建 +% 论文内容一般应由十一个主要部分组成,依次为: +% 1.封面 +% 2.中文摘要; +% 3.英文摘要; +% 4.目录; +% 5.符号说明(必要时); +% 6.论文正文; +% 7.参考文献; +% 8.致谢。 +% +% +% 重构 +% 参考CSU Thesis,以及SJTU Thesis和WHU Thesis Latex模板进行重构。 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 声明部分(Identification) +% +% 指定模板使用的 Latex 版本,标识输出模板名 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{hutbthesis}[v0.1, edited by tp2008] + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 预先定义(Preliminary declarations) +% +% 定义kv对,在模板文件中使用的指令并引入依赖的包 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +% 定义一些命令用于写文档 +% /cs 在ltxdoc 包中也提供,剩下是自定义的 +% 借鉴自thuthesis和ustcthesis模板 +\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}} +\DeclareRobustCommand\file{\nolinkurl} +\DeclareRobustCommand\env{\textsf} +\DeclareRobustCommand\pkg{\textsf} +\DeclareRobustCommand\cls{\textsf} + +% 模板类型选取 +\newif\ifhutb@type@bachelor +\hutb@type@bachelortrue +\newif\ifhutb@type@master +\hutb@type@masterfalse +\newif\ifhutb@type@doctor +\hutb@type@doctorfalse +\newif\ifhutb@type@course +\hutb@type@coursefalse +\newif\ifhutb@type@print +\hutb@type@printfalse +\newif\ifhutb@type@graduate +\hutb@type@graduatefalse +\ifhutb@type@master + \hutb@type@graduatetrue +\fi +\ifhutb@type@doctor + \hutb@type@graduatetrue +\fi + +% 定义致谢环境,盲审下隐藏致谢 +\newif\ifhutb@review +\hutb@reviewfalse + +% 定义模板选项 +\DeclareOption{doctor}{\hutb@type@doctortrue} +\DeclareOption{master}{\hutb@type@mastertrue} +\DeclareOption{bachelor}{\hutb@type@bachelortrue} +\DeclareOption{course}{\hutb@type@coursetrue} +%\DeclareOption{forprint}{\hutb@type@printtrue} +% 使用 \XeTeX{} 引擎时,\pkg{fontspec} 宏包会被 \pkg{xeCJK} 自动调用。传递给 +% \pkg{fontspec} 宏包 \opt{no-math} 选项,避免部分数学符号字体自动调整为 CMR。 +% 并使用 \opt{quiet} 忽略警告。 +% \begin{macrocode} +% \PassOptionsToPackage{no-math,quiet}{fontspec} +\PassOptionsToPackage{no-math}{fontspec} + +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} +\ProcessOptions\relax + + +% 读取基类 +% \LoadClass[a4paper,12pt]{article} +\LoadClass[UTF8,openany,a4paper,oneside,zihao=-4]{ctexbook} +% 注意openany和oneside参数,默认是无空白页不区分双面印。 + +% 加载宏包 +% 引擎执行判断宏包 +\RequirePackage{ifxetex} +% 加载xparse宏包 +\RequirePackage{xparse} +% 报错与警告 +\NewDocumentCommand{\hutb@error}{ m o }{ + \ClassError{hutbthesis_error}{#1}{#2} +} +\NewDocumentCommand{\hutb@warning}{m o }{ + \ClassWarning{hutbthesis_warning}{#1}{#2} +} + +\RequireXeTeX +\ifxetex + % Pass +\else + \hutb@error{Please use xelatex driver instead of pdflatex.} +\fi + +% 支持中文的 ctex 宏包 +\RequirePackage{ctex} +% 页面布局 +\RequirePackage{geometry} +% 使用 \pkg{amsmath} 处理数学公式 +\RequirePackage{amsmath} +% 下面的数学宏包和unicode-math 冲突 +% \RequirePackage{amsfonts} +% \RequirePackage{amssymb} +% \RequirePackage{bm} +% 使用 \pkg{unicode-math} 处理数学字体 +\RequirePackage{unicode-math} +% 算法排版宏包 +\RequirePackage[chapter]{algorithm} +\RequirePackage{algorithmic} +\floatname{algorithm}{算法} + +% 自定义关键词 +\RequirePackage{pgfkeys} +% 设置目录 +\RequirePackage{titletoc} +% 设置字体 +\RequirePackage{fontenc} +% 设置颜色 +\RequirePackage{xcolor} +% 下划线换行 +\RequirePackage{ulem} +% 设置页眉和页脚 +\RequirePackage{fancyhdr} +% 代码高亮 +% 注:该包依赖python环境Pygments语法高亮显示工具包 +% 并且需要 -shell-escape参数 +% TODO: 日后需要修改为可配置 + +% 超链接 hyperref 的设置 +% 提供书签与链接 +\RequirePackage{hyperref} +% 插入图片 +\RequirePackage{graphicx} +% 表格 +\RequirePackage{array} +% 长表格 +\RequirePackage{longtable} +% booktabs 提供了\toprule 等命令. +\RequirePackage{booktabs} +% multirow 支持在表格中跨行 +\RequirePackage{multirow} +% 调整间隔, 让表格更好看些 +\RequirePackage{bigstrut} +%在跨行表格中输入定界符 +\RequirePackage{bigdelim} +% 保护脆弱命令 +\RequirePackage{cprotect} +% 设置代码高亮 +% \RequirePackage{minted} +% 设置代码环境 +\RequirePackage{listings} +\lstset{ + breaklines, + columns=fixed, + numbers=none, % 在左侧显示行号 + numberstyle=\tiny\color{gray}, % 设定行号格式 + frame=single, % 不显示背景边框 + rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. commens (green here)) +% backgroundcolor=\color[RGB]{245,245,244}, % 设定背景颜色 + keywordstyle=\color[RGB]{40,40,255}, % 设定关键字颜色 + numberstyle=\footnotesize\color{darkgray}, + commentstyle=\it\color[RGB]{0,96,96}, % 设置代码注释的格式 + stringstyle=\rmfamily\slshape\color[RGB]{128,0,0}, % 设置字符串格式 + showstringspaces=false, % 不显示字符串中的空格 + language=c++, % 设置语言 + aboveskip=20pt +} + + +% jing: ccaption宏包不能出现在 caption 宏包之后 +% 设置浮动体的标题 +\RequirePackage[justification=centering]{caption} +\RequirePackage[justification=centering]{subcaption} +% 定制列表环境 +\RequirePackage{enumitem} +% 提供\AtBeginEnvironment以方便全局调整一些结构的设置 +\RequirePackage{etoolbox} +% 确定宏定义的位置 +\RequirePackage{filehook} +% 枚举 +\RequirePackage{enumitem} +% 末尾页 +\RequirePackage{lastpage} +% +% \RequirePackage{hypdoc} + +% 参考文献格式 GB/T7714-2015 +% 来自https://github.com/hushidong/biblatex-gb7714-2015 +\RequirePackage[backend=biber,gbpub=false, style=gb7714-2015]{biblatex} + +\AtEndOfClass{ +% 根据模板类型加载不同配置 + +%\input{undergraduate.cls} +%\ifhutb@type@graduate +% \input{graduate.cls} +%\else +% \input{undergraduate.cls} +% % \input{test.cls} +%\fi +} + + +% 字体配置 +\let\sjtu@font@family@xits\@empty +\newcommand\sjtu@font@set@xits@names{% + \ifx\sjtu@font@family@xits\@empty + \IfFontExistsTF{XITSMath-Regular.otf}{% + \gdef\sjtu@font@family@xits{XITS}% + \gdef\sjtu@font@style@xits@rm{Regular}% + \gdef\sjtu@font@style@xits@bf{Bold}% + \gdef\sjtu@font@style@xits@it{Italic}% + \gdef\sjtu@font@style@xits@bfit{BoldItalic}% + \gdef\sjtu@font@name@xits@math@rm{XITSMath-Regular}% + \gdef\sjtu@font@name@xits@math@bf{XITSMath-Bold}% + }{% + \gdef\sjtu@font@family@xits{xits}% + \gdef\sjtu@font@style@xits@rm{regular}% + \gdef\sjtu@font@style@xits@bf{bold}% + \gdef\sjtu@font@style@xits@it{italic}% + \gdef\sjtu@font@style@xits@bfit{bolditalic}% + \gdef\sjtu@font@name@xits@math@rm{xits-math}% + \gdef\sjtu@font@name@xits@math@bf{xits-mathbold}% + }% + \fi +} +\let\sjtu@font@family@libertinus\@empty +\newcommand\sjtu@font@set@libertinus@names{% + \ifx\sjtu@font@family@libertinus\@empty + \IfFontExistsTF{LibertinusSerif-Regular.otf}{% + \gdef\sjtu@font@family@libertinus@serif{LibertinusSerif}% + \gdef\sjtu@font@family@libertinus@sans{LibertinusSans}% + \gdef\sjtu@font@name@libertinus@math{LibertinusMath-Regular}% + \gdef\sjtu@font@style@libertinus@rm{Regular}% + \gdef\sjtu@font@style@libertinus@bf{Bold}% + \gdef\sjtu@font@style@libertinus@it{Italic}% + \gdef\sjtu@font@style@libertinus@bfit{BoldItalic}% + }{% + \gdef\sjtu@font@family@libertinus@serif{libertinusserif}% + \gdef\sjtu@font@family@libertinus@sans{libertinussans}% + \gdef\sjtu@font@name@libertinus@math{libertinusmath-regular}% + \gdef\sjtu@font@style@libertinus@rm{regular}% + \gdef\sjtu@font@style@libertinus@bf{bold}% + \gdef\sjtu@font@style@libertinus@it{italic}% + \gdef\sjtu@font@style@libertinus@bfit{bolditalic}% + }% + \fi +} +\newcommand\sjtu@set@font@xits{% + \sjtu@font@set@xits@names + \setmainfont{\sjtu@font@family@xits}[ + Extension = .otf, + UprightFont = *-\sjtu@font@style@xits@rm, + BoldFont = *-\sjtu@font@style@xits@bf, + ItalicFont = *-\sjtu@font@style@xits@it, + BoldItalicFont = *-\sjtu@font@style@xits@bfit, + ] +} +\newcommand\sjtu@set@font@times{% + \setmainfont{Times New Roman}[Ligatures = Rare] + \setsansfont{Arial} + \setmonofont{Courier New}[Scale = MatchLowercase] +} +\newcommand\sjtu@set@font@stix{% + \setmainfont{STIX2Text}[ + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Italic, + BoldItalicFont = *-BoldItalic, + ] +} +\newcommand\sjtu@set@font@step{% + \setmainfont{STEP}[ + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = *-Italic, + BoldItalicFont = *-BoldItalic, + ] +} +\newcommand\sjtu@set@font@source@sans@mono{% + \setsansfont{SourceSansPro}[ + Extension = .otf, + UprightFont = *-Regular , + ItalicFont = *-RegularIt , + BoldFont = *-Bold , + BoldItalicFont = *-BoldIt, + ] + \setmonofont{SourceCodePro}[ + Extension = .otf, + UprightFont = *-Regular , + ItalicFont = *-RegularIt , + BoldFont = *-Bold , + BoldItalicFont = *-BoldIt, + Scale = MatchLowercase, + ] +} +\newcommand\sjtu@set@font@termes{% + \setmainfont{texgyretermes}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, + ]% +} +\newcommand\sjtu@set@font@pagella{% + \setmainfont{texgyrepagella}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, + ]% +} +\newcommand\sjtu@set@font@texgyre@sans@mono{% + \setsansfont{texgyreheros}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, + ]% + \setmonofont{texgyrecursor}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, + ]% +} +\newcommand\sjtu@set@font@cambria{% + \setmainfont{Cambria} + \setsansfont{Calibri} + \setmonofont{Consolas}[Scale = MatchLowercase] +} +\newcommand\sjtu@set@font@libertinus{% + \sjtu@font@set@libertinus@names + \setmainfont{\sjtu@font@family@libertinus@serif}[ + Extension = .otf, + UprightFont = *-\sjtu@font@style@libertinus@rm, + BoldFont = *-\sjtu@font@style@libertinus@bf, + ItalicFont = *-\sjtu@font@style@libertinus@it, + BoldItalicFont = *-\sjtu@font@style@libertinus@bfit, + ]% + \setsansfont{\sjtu@font@family@libertinus@sans}[ + Extension = .otf, + UprightFont = *-\sjtu@font@style@libertinus@rm, + BoldFont = *-\sjtu@font@style@libertinus@bf, + ItalicFont = *-\sjtu@font@style@libertinus@it, + ]% + \setmonofont{lmmonolt10}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-oblique, + BoldItalicFont = *-boldoblique, + ]% +} +\newcommand\sjtu@set@font@lm{% + \setmainfont{lmroman10}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-italic, + BoldItalicFont = *-bolditalic, + ]% + \setsansfont{lmsans10}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-oblique, + BoldItalicFont = *-boldoblique, + ]% + \setmonofont{lmmonolt10}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-oblique, + BoldItalicFont = *-boldoblique, + ]% +} +% 使用 \pkg{unicode-math} 配置数学字体。 +\unimathsetup{ + math-style = ISO, + bold-style = ISO, + nabla = upright, + partial = upright, +} +\newcommand\sjtu@set@math@font@xits{% + \sjtu@font@set@xits@names + \setmathfont{\sjtu@font@name@xits@math@rm}[ + Extension = .otf, + BoldFont = \sjtu@font@name@xits@math@bf, + StylisticSet = 8, + ]% + \setmathfont{\sjtu@font@name@xits@math@rm}[ + Extension = .otf, + BoldFont = \sjtu@font@name@xits@math@bf, + StylisticSet = 1, + range = {cal,bfcal}, + ]% +} +\newcommand\sjtu@set@math@font@stix{% + \setmathfont{STIX2Math}[ + Extension = .otf, + StylisticSet = 8, + ]% + \setmathfont{STIX2Math}[ + Extension = .otf, + StylisticSet = 1, + range = {cal,bfcal}, + ]% +} +\newcommand\sjtu@set@math@font@step{% + \setmathfont{STEPMath-Regular}[ + Extension = .otf, + BoldFont = STEPMath-Bold, + StylisticSet = 8, + ]% + \setmathfont{STEPMath-Regular}[ + Extension = .otf, + BoldFont = STEPMath-Bold, + StylisticSet = 1, + range = {cal,bfcal}, + ]% +} +\newcommand\sjtu@set@math@font@termes{% + \setmathfont{texgyretermes-math.otf} +} +\newcommand\sjtu@set@math@font@pagella{% + \setmathfont{texgyrepagella-math.otf} +} +\newcommand\sjtu@set@math@font@cambria{% + \setmathfont{Cambria Math} +} +\newcommand\sjtu@set@math@font@libertinus{% + \sjtu@font@set@libertinus@names + \setmathfont{\sjtu@font@name@libertinus@math .otf}% +} +\newcommand\sjtu@set@math@font@lm{% + \setmathfont{latinmodern-math.otf}% +} +% \end{macrocode} +% +% 设置西文字体集。 +% \begin{macrocode} +\newcommand\sjtu@load@fontset@xits{% + \sjtu@set@font@xits + \sjtu@set@font@source@sans@mono + \sjtu@set@math@font@xits +} +\newcommand\sjtu@load@fontset@times{% + \sjtu@set@font@times + \sjtu@set@math@font@xits +} +\newcommand\sjtu@load@fontset@stix{% + \sjtu@set@font@stix + \sjtu@set@font@source@sans@mono + \sjtu@set@math@font@stix +} +\newcommand\sjtu@load@fontset@step{% + \sjtu@set@font@step + \sjtu@set@font@source@sans@mono + \sjtu@set@math@font@step +} +\newcommand\sjtu@load@fontset@termes{% + \sjtu@set@font@termes + \sjtu@set@font@texgyre@sans@mono + \sjtu@set@math@font@termes +} +\newcommand\sjtu@load@fontset@pagella{% + \sjtu@set@font@pagella + \sjtu@set@font@texgyre@sans@mono + \sjtu@set@math@font@pagella +} +\newcommand\sjtu@load@fontset@cambria{% + \sjtu@set@font@cambria + \sjtu@set@math@font@cambria +} +\newcommand\sjtu@load@fontset@libertinus{% + \sjtu@set@font@libertinus + \sjtu@set@math@font@libertinus +} +\newcommand\sjtu@load@fontset@lm{% + \sjtu@set@font@lm + \sjtu@set@math@font@lm +} +\newcommand\sjtu@load@fontset@none{\relax} +% \end{macrocode} +% +% 载入西文字体集。 +% \begin{macrocode} +% \newcommand\sjtu@load@fontset{% + % \@nameuse{sjtu@load@fontset@\sjtu@latinfontset} + % } +% latinfontset 是hutb的key 使用 对应的kv接口调用 现在没有实现 +% \sjtu@load@fontset@latinfontset +\sjtu@load@fontset@times +% linux系统请使用 stix +% \sjtu@load@fontset@stix +% \sjtu@option@hook{sjtu}{latinfontset}{% + % \sjtu@load@fontset + % } + + +\newcommand\hutb@pdfbookmark[2]{} +% 定义通用的chapter命令 +\NewDocumentCommand{\hutb@chapter}{s m}{ + \if@openright\cleardoublepage\else\clearpage\fi +% \addcontentsline{toc}{chapter}{#1}% +% \hutb@pdfbookmark{0}{#1} + \IfBooleanTF{#1}{ + \hutb@pdfbookmark{0}{#2} + }{ + \addcontentsline{toc}{chapter}{#2} + } + \chapter*{#2} +} + + +\AtEndOfPackageFile*{hyperref}{ + \hypersetup{ + linktoc = all, + bookmarksdepth = 2, + bookmarksnumbered = true, + bookmarksopen = true, + bookmarksopenlevel = 1, + unicode = true, + psdextra = true, + breaklinks = true, + plainpages = false, + pdfdisplaydoctitle = true, + hidelinks, + } + \newcounter{hutb@bookmark} + \renewcommand\hutb@pdfbookmark[2]{% + \phantomsection + \stepcounter{hutb@bookmark}% + \pdfbookmark[#1]{#2}{hutbchapter.\thehutb@bookmark}% + } +% \renewcommand\sjtu@phantomsection{% +% \phantomsection +% } +% \pdfstringdefDisableCommands{% +% \let\\\@empty +% \let\quad\@empty +% \let\hspace\@gobble +% } +% \@ifpackagelater{hyperref}{2019/04/27}{}{% +% \g@addto@macro\psdmapshortnames{\let\mu\textmu} +% }% +% \AtBeginDocument{% +% \hypersetup{ +% pdftitle = \sjtu@info@title, +% pdfsubject = \sjtu@name@subject, +% pdfkeywords = \sjtu@info@keywords, +% pdfauthor = \sjtu@info@author, +% pdfcreator = {LaTeX with SJTUThesis \version} +% } +% }% +} + + +% 定制titlepage +% 定义命令和定义相应的宏。 +%----------------------------------------------------------------------% +% 预定义全局使用的文字,如姓名、专业等信息,在content/info.tex中定义 +%----------------------------------------------------------------------% +% 以下定义封面相关命令和相应的宏,以titleen为例,\titleen为实际在源码中使用的命令,一旦执行就会因为\gdef\@titleen{#1}使得其产生一个\@titleen的宏,而该宏能够在后续的环境中使用。 +% TODO: 之后版本迁移至公共模板入口hutbthesis.cls 处(放置在引入子模版之后) +\newcommand*{\titlecn}[1]{\gdef\@titlecn{#1}} % 中文标题 +\newcommand*{\titleen}[1]{\gdef\@titleen{#1}} % 英文标题 +\newcommand*{\priormajor}[1]{\gdef\@priormajor{#1}} % 一级学科(学科专业) +\newcommand*{\minormajor}[1]{\gdef\@minormajor{#1}} % 二级学科(学科方向) +\newcommand*{\interestmajor}[1]{\gdef\@interestmajor{#1}} % 研究方向,关键词组 +\newcommand*{\department}[1]{\gdef\@department{#1}} % 二级培养单位 +\newcommand*{\supervisor}[1]{\gdef\@supervisor{#1}} % 导师 +\newcommand*{\myclass}[1]{\gdef\@myclass{#1}} % 班级 +\newcommand*{\subsupervisor}[1]{\gdef\@subsupervisor{#1}} % 副导师 +\newcommand*{\studentid}[1]{\gdef\@studentid{#1}} % 学号 + +\newcommand*{\clcnumber}[1]{\gdef\@clcnumber{#1}} % 中图分类号 Chinese Library Classification +\newcommand*{\schoolcode}[1]{\gdef\@schoolcode{#1}} % 学校代码 +\newcommand*{\udc}[1]{\gdef\@udc{#1}} % UDC +\newcommand*{\academiccategory}[1]{\gdef\@academiccategory{#1}} % 学术类别 +\newcommand*{\headertitle}[1]{\gdef\@headertitle{#1}} % 页眉字符串 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 页面布局 +% +% 设置页边距以及版芯行间距设置 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 边距要求上2.5cm,下2.5cm,左3cm,右2cm +\geometry{top=2.5cm,bottom=2.5cm,left=3cm,right=2cm} +% 本科生从摘要开始就要有 +% 设置页眉和页脚 % +\pagestyle{fancy} +% 本科学位论文底部样式 +\newcommand{\hutb@thepage@format@zh}[2]{第~{#1}~页 共~{#2}~页} +\newcommand{\hutb@thepage@format@en}[1]{#1} +% 空白页清空页眉页脚 +\patchcmd{\cleardoublepage}{\newpage}{\thispagestyle{empty}\newpage}{}{} +% 对章节首页的特殊page style清除页眉页脚 +\patchcmd{\chapter}{\thispagestyle}{\@gobble}{}{} +% 内芯页眉设置 +\ifhutb@type@print +%\fancyhead[L]{\includegraphics[scale=0.10]{hutb_logo_maoti.png}} +\else +%\fancyhead[L]{\includegraphics[scale=0.10]{hutb_logo_maoti.png}} +\fi +% \fancyhf[RH]{\heiti \zihao{-5} {图像与激光融合的轨道扣件脱落检测}} % 设置所有(奇数和偶数)右侧页眉 +% UPDATE 更新配置为论文标题 +% 清空页眉,具体设置规则参考:https://www.overleaf.com/learn/latex/Headers_and_footers +\fancyhf{}% +\fancyhf[HC]{\heiti \zihao{-5} {\@headertitle}} +% frontmatter设置 +\renewcommand{\frontmatter}{ + \cleardoublepage + \@mainmatterfalse + % 根据学校要求使用大罗马编号 + \pagenumbering{Roman} + \def\hutb@thepage{\thepage} + \def\hutb@lastpageref{\pageref{LastPage}} + \fancyfoot[C]{\zihao{-5} \hutb@thepage@format@en{\hutb@thepage}} +} +% mainmatter设置 +\renewcommand{\mainmatter}{ + \cleardoublepage + \@mainmattertrue + % 正文部分启用阿拉伯数字编号 + \pagenumbering{arabic} + \def\hutb@thepage{\thepage} + \def\hutb@lastpageref{\pageref{LastPage}} + \fancyfoot[C]{\zihao{-5} \songti \hutb@thepage@format@zh{\hutb@thepage}{\hutb@lastpageref}} +} +% 给页眉留足空间(否则会有 \headheight is too small的warning) +\setlength{\headheight}{14.5pt} +% “磅”是衡量印刷字体大小的单位,约等于七十二分之一英寸。 +% 而 1英寸=25.4毫米,则1磅=25.4/72≈0.353毫米。 +% 磅和 LaTeX的 pt- points (大约 1/72 inch) 是一致的。 +% 基本行间距设置 +\renewcommand*{\baselinestretch}{1.3} % 几倍行间距 +\setlength{\baselineskip}{20pt} % 基准行间距 +% \setlength{\bibsep}{0.5ex} % 参考文献条目间距 + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 字体设置 +% +% 进行相关字体设置,定义必须的新字体 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% TODO: Times New Roman目前只能在Windows上使用,需要增加Linux系统字体 +% \setmainfont{Times New Roman} +% \setmonofont{Courier New} +% \setsansfont{Arial} +% \newfontfamily{\enheiti}{SimHei} % 解决标题英文括号不显示黑体 +% \newfontfamily{\enheiti}{\heiti} +% \renewcommand\normalsize{% + % \@setfontsize\normalsize{12.05}{14.45}% + % \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ + % \abovedisplayshortskip \z@ \@plus3\p@ + % \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ + % } +% 协议页的标题按模板是华文新魏 +% \setCJKfamilyfont{hwxw}{STXinwei} +% \newcommand{\huawenxinwei}{\CJKfamily{hwxw}} +% 实现楷体GB_2312 +% \setCJKfamilyfont{kaitigb}{KaiTi_GB2312.ttf} +% \newcommand{\kgb}{\CJKfamily{kaitigb}} +% 重定义ctex定义好的宋体和黑体,以支持伪加粗AutoFakeBold +% 即支持类似word里的给黑体、宋体等中文字体加粗的操作,用\bfseries +% \let\heiti\relax +% \newCJKfontfamily[hei]\heiti{SimHei}[AutoFakeBold] +% \let\songti\relax +% \newCJKfontfamily[song]\songti{SimSun}[AutoFakeBold] +% \newcommand{\kaiti}{\CJKfamily{kai}} +% \newcommand{\kgb}{\CJKfamily{kai}} +% 设置参考文献的字体格式 +% \renewcommand{\bibfont}{\zihao{5} \kgb} + + +% 预定义名称 +\newcommand*{\hutb@name@cover}{扉页} +\newcommand*{\hutb@name@declaration@zh}{声明} +\newcommand*{\hutb@name@authorization@zh}{声明} +\newcommand*{\hutb@name@abstract@zh}{中文摘要} +\newcommand*{\hutb@name@abstract@en}{英文摘要} +\newcommand*{\hutb@name@keywords}{关键字} +\newcommand*{\hutb@name@contents}{目录} +\newcommand*{\hutb@name@listfigure}{插图清单} +\newcommand*{\hutb@name@listtable}{附表清单} +\newcommand*{\hutb@name@index}{索引} +\newcommand*{\hutb@name@figure}{图} +\newcommand*{\hutb@name@table}{表} +\newcommand*{\hutb@name@appendix}{附录} +\newcommand*{\hutb@name@acknowledge}{致谢} + +%--------------------------------------------- +%控制引用格式,选用上标引用 +% \newcommand\supercite[2][]{% + % \textsuperscript{\cite[#1]{#2}}} + + +% 定义命令:参数1=颜色,参数2=实线长度,参数3=空白长度 +\newcommand{\adjustabledashunderline}[4][black]{% + \tikz[baseline=(text.base)]{% + \node[inner sep=0pt, outer sep=0pt] (text) {#4}; + \draw[color=#1, dash pattern=on #2 off #3] (text.south west) -- (text.south east); + }% +} + + + +%\newCJKfontfamily\sonti{SimSun}[BoldFont=FandolSong-Bold] + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 封面扉页 +% +% 提供本科毕业论文封面扉页设计 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 论文日期 +% 采用key-value对的方式来制定存储信息的pgf路径 +\pgfkeys{/thesisdate/pgf/.cd, % 定义pgf路径 + year/.store in = \year, % 指定关键词year的存储位置为\year + month/.store in = \month % 指定关键词month的存储位置为\month +} +% 利用上述的pgf的key-value定制论文日期命令 +\newcommand{\thesisdate}[1] { + \pgfkeys{/thesisdate/pgf/.cd,#1} % 指定使用/thesisdate/pgf/.cd来解释参数,然后在后文能直接使用存储位置来指定解释的内容 + \gdef\@thesisdate{\year{} 年 \month{} 月} % 将构建好的日期存储到宏(\@thesisdate)中 +} +% 重定义\maketitle实现封面(扉页)绘制 +\RenewDocumentCommand{\maketitle}{}{% + \hutb@pdfbookmark{0}{\hutb@name@cover} + \hutb@make@cover@zh% +} +% 构建封面绘制宏 +\NewDocumentCommand{\hutb@make@cover@zh}{} { + \thispagestyle{empty} + \begin{center} + \vspace*{0pt} + \begin{figure}[hbt] + % \noindent 表示logo靠左对齐j + \centering % logo居中对齐 + \ifhutb@type@print + \includegraphics[width=0.7\textwidth]{hutb_and_log.png} + \else + \includegraphics[width=0.7\textwidth]{hutb_and_log.png} + \fi + \end{figure} + \vspace{40pt} + \begingroup + % 做系统的用“毕业设计”,做算法的用毕业论文 + \fontsize{50.0}{50}\selectfont 毕业设计 \par + % 45磅,黑体 + \endgroup + \vspace*{6pt} + \begingroup + % \zihao{1} \setmainfont{SimHei} GRADUATION DESIGN(THESIS) \par + % \zihao{1} GRADUATION DESIGN(THESIS) \par + % 1号,黑体 + \endgroup + \begin{figure}[hbt] + \centering + \vspace{55pt} % 空行 + \ifhutb@type@print + %\includegraphics[width=0.2\textwidth]{hutb_logo.png} + \else + %\includegraphics[width=0.2\textwidth]{hutb_logo.png} + \fi + \end{figure} + \vspace{10pt} % 空行 + \begingroup + \linespread{1.3} + \zihao{-2} + \songti + \begin{tabular}{ll} % 实线是 \underline;虚线的 \hdashrule + \hspace{12pt} \makebox[4em][s]{\textbf{题\qquad 目}} & \underline{\parbox[b][][c]{250pt}{\center \kaishu \@titlecn}} \\ + \hspace{12pt} \makebox[4em][s]{\textbf{学生姓名}} & \underline{\makebox[250pt][c]{\kaishu \@author}} \\ + \hspace{12pt} \makebox[4em][s]{\textbf{学\qquad 号}} & \underline{\makebox[250pt][c]{\kaishu \@studentid}} \\ + \hspace{12pt} \makebox[4em][s]{\textbf{学\qquad 院}} & \underline{\makebox[250pt][c]{\kaishu \@department}} \\ + \hspace{12pt} \makebox[4em][s]{\textbf{专业班级}} & \underline{\makebox[250pt][c]{\kaishu \@priormajor}} \\ + % \hspace{12pt} \makebox[4em][s]{\textbf{班\qquad 级}} & \underline{\makebox[250pt][c]{\kaishu \@myclass}} \\ + \hspace{12pt} \makebox[4em][s]{\textbf{指导教师}} & \underline{\makebox[250pt][c]{\kaishu \@supervisor}} \\ + \hspace{12pt} \makebox[4em][s]{\textbf{职\qquad 称}} & \underline{\makebox[250pt][c]{\kaishu \@title}} \\ + + \end{tabular} + \endgroup + \par + \vspace{40pt} + % \vfill + \begingroup + % {\zihao{2} \heiti 人工智能与先进计算学院 \par} + \vspace{10pt} + {\zihao{-2} \heiti \@thesisdate \par} + \endgroup + \end{center} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 诚信声明 +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newenvironment{declarationzh} { + %\begin{titlepage}% + \hutb@pdfbookmark{0}{\hutb@name@declaration@zh} + %\renewcommand*{\headsep}{20pt} + \vspace*{0pt} + % \begin{center} \zihao{-2} \heiti \@titlecn \end{center} + \vspace{0pt} + \begin{center} \zihao{2} \heiti 湖南工商大学本科毕业设计诚信声明 \end{center} % 摘要为三号黑体 + \vspace{12pt} + \linespread{1.5} + \zihao{4}\songti % 内容为四号宋体 + + %\end{titlepage}% + +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 诚信声明 +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newenvironment{authorizationzh} { + %\begin{titlepage}% + \hutb@pdfbookmark{0}{\hutb@name@authorization@zh} + %\renewcommand*{\headsep}{20pt} + \vspace*{0pt} + % \begin{center} \zihao{-2} \heiti \@titlecn \end{center} + \vspace{0pt} + \begin{center} \zihao{2} \heiti 湖南工商大学本科毕业设计\\版权使用授权书 \end{center} % 摘要为三号黑体 + \vspace{12pt} + \linespread{1.5} + \zihao{4}\songti % 内容为四号宋体 + + %\end{titlepage}% + +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 摘要 +% +% 提供中英文摘要样式 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ---------------------------------------------- +% 中文摘要 +% ---------------------------------------------- +% 中文摘要格式具体见样例8,居中打印论文题名(三号黑体) +% 换行顶格编排“摘要”(四号黑体)及摘要内容(四号宋体)、 +% 每段开头空二格。摘要内容后下换行顶格编排“关键词”和“分类号”(四号黑体)。 +% 每篇论文应选取3-8个关键词,每一关键词之间用分号分开,最后一个关键词后不打标点符号。 +\newcommand*{\keywordscn}[1]{\gdef\@keywordscn{#1}} % 定义中文关键词 +%\newcommand*{\categorycn}[1]{\gdef\@categorycn{#1}} % 定义中文分类 +% 定义中文摘要环境 +\newenvironment{abstractzh} { + \hutb@pdfbookmark{0}{\hutb@name@abstract@zh} + \renewcommand*{\headsep}{0pt} + \vspace*{0pt} + %\begin{center} \zihao{-2} \heiti \@titlecn \end{center} + \vspace{0pt} + \begin{center} \zihao{3} \heiti 摘\qquad 要 \end{center} % 摘要为三号黑体 + \vspace{12pt} + \linespread{1.5} + \zihao{-4}\songti % 内容为四号宋体 +} +% 显示中文关键词和分类号 +{ + \begin{flushleft} + \noindent {\zihao{-4} \bfseries \songti 关键词:} {\zihao{-4} \songti \@keywordscn} \par % 关键词为小四号宋体加粗,内容为小四号宋体 + \end{flushleft} +} + +% ---------------------------------------------- +% 英文摘要 +% ---------------------------------------------- +% 英文摘要格式和内容与中文摘要相对应,另起一页,具体见样例9。居中打印论文英文题名(三号Times New Roman字体),换行顶格编排“Abstract”及英文摘要内容(四号Times New Roman字体),摘要内容每段开头留四个字符空格。摘要内容后下换行顶格编排“Keywords”和“Classification”。 +% 定义英文摘要,字体全部为timesnewroman +\newcommand*{\keywordsen}[1]{\gdef\@keywordsen{#1}} % 英文关键词 + +\newenvironment{abstracten} { % 新建英文摘要环境 + \hutb@pdfbookmark{0}{\hutb@name@abstract@en} + \vspace*{0pt} + %\begin{center} \zihao{-2} \bfseries \@titleen \end{center} + + \begin{center} \zihao{3} \bfseries ABSTRACT \end{center} + \vspace{12pt} + \linespread{1.5} + \zihao{-4} % 内容为四号宋体 +} +{ + \begin{flushleft} + \noindent {\zihao{4} \bfseries Key\ words:~} {\zihao{4} \@keywordsen} \par % 关键词为四号黑体,内容为四号宋体 + \end{flushleft} +} + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 5. 目录 % +% -----------------------------------------------% +% 目录应列出论文的大标题、一级和二级节标题,逐项标明页码(具体见样例10)。各级标题应简明扼要、点出各部分主要内容。学位论文的页码编排为:正文和后置部分用阿拉伯数字编连续码,前置部分用罗马数字单独编连续码(封面除外)。 +% “目录”两字居中(三号黑体),下空两行为章、节、小节及其开始页码(靠右顶格)。章、节、小节分别以阶梯式排列:1(第1章)、1.1、1.1.1依次标出。章、节、小节的题名与页码之间用“......”连接。除“目录”两字外,其余字体均为小四号宋体。 + +%TODO: 本科和硕博目录格式要求不同 +% \renewcommand{\contentsname}{\hfill \heiti \zihao{3} 目\quad 录\hfill} +% \renewcommand{\contentsname}{目录} +% \renewcommand*{\baselinestretch}{1.5} % 行间距 +% \tableofcontents +% } +\renewcommand\tableofcontents{ +\hutb@chapter*{\contentsname} +% \hutb@pdfbookmark{0}{\contentsname} + +% \chapter*{目录} +% \hutb@pdfbookmark{0}{\hutb@name@contents} +\@starttoc{toc} +} + + + +\setcounter{secnumdepth}{3} +% 定义作为标题的格式 +% \titleformat{command}[shape]%定义标题类型和标题样式 +% {format}%定义标题格式 +% {label}%定义标题的标签,即标题的标号等 +% {sep}%定义标题和标号之间的水平距离 +% {before-code}%定义标题前的内容 +% [after-code]%定义标题后的内容 + +% TODO: 修复章节标题样式 +% \renewcommand{\chaptername}{第{\thesection}章} +% \titleformat{\chapter}{\zihao{3} \heiti \centering}{\chaptername}{1em}{} +% \titleformat{\section}{\zihao{-4} \heiti}{\thesection}{1em}{} +% \titleformat{\subsection}{\zihao{-4} \kaishu}{\thesubsection}{1em}{} + +% 定义在目录中的格式 +% \titlecontents{标题名} +% [左间距] +% {标题格式} +% {标题标志} +% {无序号标题} +% {指引线与页码} +% [下间距] + +% \titlecontents{section} +% [0em] % 按样例目录左侧是和前置部分文字左侧对齐的 +% {\zihao{-4} \songti} +% %{\contentslabel {1em}} +% {第\thecontentslabel\ 章\quad}% +% {\hspace*{-1em}} +% {\titlerule*[0.5pc]{.}\contentspage} + +% \titlecontents{subsection} +% [4em] +% {\zihao{-4} \songti} % note that 3.8 = 1.5 + 2.3 +% {\contentslabel{2.2em}} +% {\hspace*{-3.5em}} +% {\titlerule*[0.5pc]{.}\contentspage} + +% \titlecontents{subsubsection} +% [7em] +% {\zihao{-4} \songti} % note that 3.8 = 1.5 + 2.3 +% {\contentslabel{3.0em}} +% {\hspace*{-5em}} +% {\titlerule*[0.5pc]{.}\contentspage} + +% 6. 符号说明(必要时)% +% ---------------------------------------------------------% +% TODO: +% +% 如果论文中使用了大量的物理量符号、标志、缩略词、专门计量单位、自定义名词和术语等,应编写成注释说明汇集表,说明论文中所用符号所表示的意义及单位(或量纲)。若上述符号和缩略词使用数量不多,可以不设专门的注释说明汇集表,仅在论文中出现时加以说明。 +% “符号说明”四字居中(三号黑体)。 + + +% 7. 论文正文 % +% -------------------------------------------------------% +% 论文正文是主体,主体部分应从另页右页开始,每一章应另起页。一般由序号标题、文字叙述、图、表格和公式等五个部分构成。 +% 写作形式可因研究内容的性质不同而变化,一般可包括绪论(或综述)、理论分析、计算方法、实验装置和测试方法、实验结果分析和讨论、研究成果、结论及意义等。 +% 该部分由用户编写 + +% 图表等浮动环境设置 % +% ----------------------------------------------------------% +% TODO % +% 图、表、公式:文中的图、表、附注、公式一律采用阿拉伯数字分章(或连续)编号,如:图2-5,表3-2,公式(5-1)等。 +% 图序及图名居中置于图的下方,如果图中含有几个不同部分,应将分图号标注在分图的左上角,并在图解下列出各部分内容。图中的术语、符号、单位等应与正文表述所用一致。 +% 表序及表名置于表的上方,表中参数应标明量和单位的符号。表的编排应采用国际通用的三线表。续表均应重复表头,如表需转页接排,随后各页应重复表的编号,其后跟表题(可省略)和“续”置于表上方。 +% 图序及图名、表序及表名采用五号楷体字。若图或表中有附注,采用英文小写字母顺序编号,附注写在图或表的下方。公式的编号用括号括起写在右边行末,其间不加虚线。 +% 图、表、公式等与正文之间要有一定的行间距。 +% \RequirePackage{caption} +% 默认情况下, \LaTeX{} 要求每页的文字至少占据 20%,否则该页就只单独放置一个浮动环境, +% 而这通常不是我们想要的, 我们将这个要求降低到 5%. +\renewcommand*{\textfraction}{0.05} +% 有时如果多个浮动环境连续放在一起, \LaTeX{} +% 会将它们分在几个不同页,即使它们可在同一页放 +% 得下. 我们可以通过修改 |\topfraction| 和 |\bottomfraction| 分别设置顶端和底端的浮 +% 动环境的最大比例. +\renewcommand*{\topfraction}{0.9} +\renewcommand*{\bottomfraction}{0.8} +% 有时\LaTeX{}会把一个浮动环境单独放在一页, +% 我们要求这个环境至少要占据 85% 才能单独放在一页. +% 注意: |\floatpagefraction| 的数值必须小于 |\topfraction|. +\renewcommand*{\floatpagefraction}{0.85} +% 关于图片 graphicx +% 如果图片没有指定后缀, 依次按下列顺序搜索 +\DeclareGraphicsExtensions{.pdf,.eps,.jpg,.png,.tif} +% 设置图表搜索路径, 可以给图表文件夹取如下名字 +\graphicspath{{figures/}{figure/}{pictures/}% +{picture/}{pic/}{pics/}{image/}{images/}} + + + + +% 插图格式 +% ------------------------------------------------------% +% \captionsetup[subfigure]{labelfont=normalfont,textfont=normalfont,singlelinecheck=off,justification=raggedright} +% singlelinecheck=off 表示即使caption只有一行, justification 也生效 +% justification=raggedright 使子图 caption 靠左对齐,而caption的上下位置由\caption标签的位置决定,以此实现了学校要求的子图标签在左上角显示。 +% 这部分功能由 subcaption 这个包实现,而这个包不能和 subfigure 同时使用,所以子图的写法也与 subfigure 包的不大一样。 +\captionsetup[subfigure]{singlelinecheck=off,justification=raggedright} + +% 图下方描述的黑体 +\DeclareCaptionFont{hei}{\heiti} +\DeclareCaptionFont{five}{\zihao{5}} +\renewcommand{\thefigure}{\arabic{chapter}-\arabic{figure}} +% \renewcommand{\thefigure} {\thesection-\arabic{figure}} + +\captionsetup[figure]{ +format=plain, % 标题从第二行开始是否缩进,plain无缩进,hang有缩进 +labelsep=quad, % 分隔符是一个空格 +font={hei,five}, +position=bottom % position=bottom, 不代表标题放在下面, 标题仍放在你放\caption的位置. +} +% 表格格式 +% ------------------------------------------------------% +\renewcommand{\thetable}{\arabic{chapter}-\arabic{table}} +% \renewcommand {\thetable} {\thesection-\arabic{table}} +\captionsetup[table]{ +format=plain, % 标题从第二行开始是否缩进,plain无缩进,hang有缩进 +labelsep=quad, % 分隔符是一个空格 +font={hei,five}, % 表的字体, 宋体小四 +position=top +} + + + +% 列表环境设置 % +% ------------------------------------------------------------------% +\setlist{% +topsep=0.3em, % 列表顶端的垂直空白 +partopsep=0pt, % 列表环境前面紧接着一个空白行时其顶端的额外垂直空白 +itemsep=0ex plus 0.1ex, % 列表项之间的额外垂直空白 +parsep=0pt, % 列表项内的段落之间的垂直空白 +leftmargin=1.5em, % 环境的左边界和列表之间的水平距离 +rightmargin=0em, % 环境的右边界和列表之间的水平距离 +labelsep=0.5em, % 包含标签的盒子与列表项的第一行文本之间的间隔 +labelwidth=2em % 包含标签的盒子的正常宽度;若实际宽度更宽,则使用实际宽度。 +} + +% 表格 % +% ------------------------------------------------------% +% 修改tabular 环境, 设置表格中的行间距为正文行间距. +\let\hutb@oldtabular\tabular +\let\hutb@endoldtabular\endtabular +\renewenvironment{tabular} { +\bgroup +\renewcommand{\arraystretch}{0.92} +\hutb@oldtabular +} { +\hutb@endoldtabular\egroup +} + +% 表格字号应比正文小,一般五号/10.5pt,但是暂时没法再cls里设置(不然会影响到封面等tabular环境) +% 所以目前只好在主文件里局部\AtBeginEnvironment + +% 数学环境, 定理等设置 % +% -------------------------------------------------------% +\newtheorem{definition}{\hutb@cap@definition} +\newtheorem{theorem}{\hutb@cap@theorem} +\newtheorem{lemma}{\hutb@cap@lemma} +\newtheorem{corollary}{\hutb@cap@corollary} +\newtheorem{assumption}{\hutb@cap@assumption} +\newtheorem{conjecture}{\hutb@cap@conjecture} +\newtheorem{axiom}{\hutb@cap@axiom} +\newtheorem{principle}{\hutb@cap@principle} +\newtheorem{problem}{\hutb@cap@problem} +\newtheorem{example}{\hutb@cap@example} +\newtheorem{proof}{\hutb@cap@proof} +\newtheorem{solution}{\hutb@cap@solution} + +% 数学定理相关的常量 +\newcommand*{\hutb@cap@definition}{定义} +\newcommand*{\hutb@cap@theorem}{定理} +\newcommand*{\hutb@cap@lemma}{引理} +\newcommand*{\hutb@cap@corollary}{推论} +\newcommand*{\hutb@cap@assumption}{假设} +\newcommand*{\hutb@cap@conjecture}{猜想} +\newcommand*{\hutb@cap@axiom}{公理} +\newcommand*{\hutb@cap@principle}{定律} +\newcommand*{\hutb@cap@problem}{问题} +\newcommand*{\hutb@cap@example}{例} +\newcommand*{\hutb@cap@proof}{证明} +\newcommand*{\hutb@cap@solution}{解} + + +% TODO 测试段落后间距 +% 各级标题格式设置。 +\ctexset{% +chapter = {% + % 居中 \centering + format = \zihao{3} \heiti, + % {第, 章} + name = {,.}, + nameformat = {}, + number = \arabic{chapter}, + numberformat = {}, + titleformat = {}, + aftername = \quad, + afterindent = true, + % beforeskip 默认为 50pt 适当缩减 + fixskip = true, + beforeskip = {15pt}, + % beforeskip = {\ifhutb@type@graduate 20pt \else 5pt\fi} + % afterskip 默认为 40pt 适当缩减 + afterskip = {40pt}, + % afterskip = {\ifhutb@type@graduate 30pt\else 20pt\fi}, +}, +% 二级标题 +section = {% + format = \zihao{4} \bfseries \songti, + afterindent = true, + % beforeskip 默认为 3.5ex plus 1ex minus .2ex 适当缩减 + % beforeskip = {20pt}, + % beforeskip = {\ifhutb@type@graduate 30pt \else 20pt\fi} + % afterskip 默认为 2.3ex plus .2ex 适当缩减 + afterskip = {1ex \@plus .2ex}, +}, +% 三级标题 +subsection = {% + format = \zihao{-4} \songti, + afterindent = true, + % afterskip 默认为 2.3ex plus .2ex 适当缩减 + afterskip = {1ex \@plus .2ex}, + %fixskip = true, +}, +% 四级标题 +subsubsection = {% + format = \zihao{-4} \songti, + afterindent = true, + afterskip = {1ex \@plus .2ex}, + %fixskip = true, +}, +} + +% 定义描述距离的变量 +\newlength{\hutb@headings@indent@fixed} +\setlength{\hutb@headings@indent@fixed}{2\ccwd} +\newcommand{\hutb@style@set@indent@heading}{% +\gdef\hutb@headings@indent{\hutb@headings@indent@fixed} +% \ifsjtu@type@graduate\relax\else +% 本科毕设设置四级标题 +\ctexset{% + subsubsection/name = {(,)}, + subsubsection/number = \arabic{subsubsection}, +} +% \fi +% 设标题的缩进 +\ctexset{% + section/indent = \hutb@headings@indent, + subsection/indent = \hutb@headings@indent, + subsubsection/indent = \hutb@headings@indent, +} +} +\hutb@style@set@indent@heading + +% 全文首行缩进 2 字符, 标点符号用全角 +% \ctexset{% +% punct = quanjiao, +% space = auto, +% autoindent = true, +% } + +% % 编号分章节。如需要连续编号,注释\makeatletter下面对应内容即可。 +% \renewcommand{\theequation}{\arabic{section}-\arabic{equation}} +% \makeatletter +% \@addtoreset{figure}{section} +% \@addtoreset{table}{section} +% \@addtoreset{equation}{section} +% \makeatother + +% 8. 参考文献 % +% ------------------------------------------------------% +% TODO % +% 文后参考文献只列出作者直接阅读过、在正文中被引用过的文献资料,务必实事求是。参考文献一律列在正文的末尾,不得放在各章之后。人文社科类学位论文中不宜用文后参考文献列出的注释可采用页下注,包括对学位论文中某些关键词句、论点的详细说明。在引用别人的科研成果时,应在引用处加以说明,遵循学术道德规范,严禁论文抄袭、剽窃等学术不端行为。 +% 参考文献可以采用顺序编码制组织,也可以按“著者-出版年”制组织。建议按顺序编码制,即按中文引用的顺序将参考文献附于文末。作者姓名写到第三位,余者写“,等”或“,et al.”。“参考文献”四字居中(三号黑体),空一行左起按顺序依次列出参考文献,将序号置于方括号内(如[1]),用小四号宋体字,所有符号均用半角编排。 +% 目前采用bgt7714-2005标准进行文献索引,详见gbt7714-2005.bst. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 附录 +% +% 附录中主要列入正文内不便列出的过分冗长的公式推导,供查读方便所需的辅助性数学工具或表格、重复性数据图表、计算程序及说明等。 +% 附录依次为附录1,附录2……等,“附录X”三字居中(三号黑体)。附录中的图表公式另编排序号,与正文分开。 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 定义附录环境 +% 在\appendix 后直接使用 chapter +% 暂不需要 +% \newenvironment{appendixs}{ +% % \ifhutb@review\else +% \hutb@chapter{\hutb@name@appendix} +% % \fi +% } + + +% 10. 攻读学位期间主要研究成果 % +% --------------------------------------------------------% +% 分类按时间顺序列出作者在攻读学位期间取得的与学位论文相关的研究成果,含参加的研究项目、获奖情况、专利、专著、发表学术论文(含正式录用论文)等,书写格式参照参考文献格式。“攻读学位期间主要研究成果”字体居中(三号黑体) + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 致谢 +% +% 作者对给予指导、各类资助和协助完成研究工作以及提供各种对论文工作有利条件的单位及个人表示感谢。“致谢”二字居中(三号黑体)。 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 定义致谢环境 +\newenvironment{acknowledgements}{ +% \ifhutb@review\relax\else +\ifhutb@review\else +% \hutb@chapter{\hutb@name@acknowledgements} +\hutb@chapter{\hutb@name@acknowledge} +\fi +} + + +% 篇眉和页码要求 % +% ---------------------------------------------------------% +% 篇眉从正文开始至全文结束,采用宋体五号字左起书写“博(或硕)士学位论文”,靠右写章标题。 +% 页码从正文开始至全文结束按阿拉伯数字连续编排,前置部分(如学位论文原创性声明和版权使用授权书、中文摘要、英文摘要、目录、符号说明等)用罗马数字分别单独编排。页码位于页面底端,居中书写。 + + + + +%\endinput diff --git a/tactile/undergraduat/hutbthesis_main.tex b/tactile/undergraduat/hutbthesis_main.tex new file mode 100644 index 00000000..27022f56 --- /dev/null +++ b/tactile/undergraduat/hutbthesis_main.tex @@ -0,0 +1,142 @@ +%!TEX program = xelatex +% !BIB program = biber +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 载入模版 +% +% 载入 hutbthesis.cls文件定义的模板 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\documentclass[AutoFakeBold]{hutbthesis} + +\addbibresource{content/reference.bib} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 基本信息 +% +% 用户自行输入标题、作者等基本信息 +% 都存储在\content\info.tex文件中 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\include{content/cover} + + + +\begin{document} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 封面绘制 +% +% 1.5版本重新编写了封面绘制宏,并用latex使用者更习惯的 +% \maketitle代替之前的\makecoverpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\maketitle + +%\declarationzh + +% 启用大罗马字母进行编号 +\frontmatter +% 设置页眉和页脚 + +%\include{content/info} + +\include{content/declarationzh} + +% 授权书 +\include{content/authorizationzh} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 中文摘要 +% +% 存储在\content\abstractzh.tex文件中 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\include{content/abstractzh} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 英文摘要 +% +% 存储在\content\abstracten.tex文件中 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\include{content/abstracten} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 目录 +% +% 使用重定义的tableofcontents宏绘制目录 +% 满足学校的样式要求 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\tableofcontents + + +% 启用数字编号,改为第 x 页 共 x 页格式 +\mainmatter + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 正文 +% +% 存储在\content\content.tex文件中 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 正文 +%\include{content/content} + + +\include{content/chapter1.tex} +\include{content/chapter2.tex} +\include{content/chapter3.tex} +\include{content/chapter4.tex} +\include{content/chapter5.tex} + +% % 主文件有代码去掉页眉章节编号的“.”,但这会因为bug导致无编号章节显示一个错误编号,所以这里在无编号章节之前再次重定义sectionmark。 +% \renewcommand{\sectionmark}[1]{\markright{#1}} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 参考文献 +% +% 存储在\content\acknowledgements.tex文件中 +% 根据本科生院的要求,致谢应该在参考文献的前面,不编章号,而附录应该位于参考文献后。 +% 有待修复 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \section{参考文献} % bibliography会自动显示参考文献四个字 +\addcontentsline{toc}{chapter}{参考文献} % 由于参考文献不是chapter,这句把参考文献加入目录 +% \nocite{*} % 该命令用于显示全部参考文献,即使文中没引用 +% cls文件中已经引入package,这里不需要调用 \bibliographystyle 了。 +%\bibliographystyle{gbt7714-2005} +%\bibliography{reference} + +\printbibliography + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 附录部分 +% +% 根据学校要求,正文中不应出现长篇幅的代码段或公式推证 +% 应单独放置在正文后的附录部分 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% https://www.zhihu.com/question/29413517/answer/44358389 % +% 说明如下: +% secnumdepth 这个计数器是 LaTeX 标准文档类用来控制章节编号深度的。 +% 在 article 中,这个计数器的值默认是 3,对应的章节命令是 \subsubsection。 +% 也就是说,默认情况下,article 将会对 \subsubsection 及其之上的所有章节标题进行编号,也就是 \part, \section, \subsection, \subsubsection。LaTeX 标准文档类中,最大的标题是 \part。它在 book 和 report 类中的层级是「-1」,在 article 类中的层级是「0」。这里,我们在调用 \appendix 的时候将计数器设置为 -2,因此所有的章节命令都不会编号了。不过,一般还是会保留 \part 的编号的。所以在实际使用中,将它设置为 0 就可以了。 + +% 在修改过程中请注意不要破环命令的完整性 + +% \renewcommand\appendix{\setcounter{secnumdepth}{-2}} +\appendix +\include{content/appendix} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% 致谢 +% +% 存储在\content\acknowledgements.tex文件中 +% 根据本科生院的要求,致谢应该在参考文献的前面,不编章号,而附录应该位于参考文献后。 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\include{content/acknowledgements} + +%\bibliography{hutbtheisi_main} +\newpage + + + +\end{document} diff --git a/tactile/undergraduat/images/Carla.pdf b/tactile/undergraduat/images/Carla.pdf new file mode 100644 index 00000000..fe4150e4 Binary files /dev/null and b/tactile/undergraduat/images/Carla.pdf differ diff --git a/tactile/undergraduat/images/Progress_bar.pdf b/tactile/undergraduat/images/Progress_bar.pdf new file mode 100644 index 00000000..226e4a46 Binary files /dev/null and b/tactile/undergraduat/images/Progress_bar.pdf differ diff --git a/tactile/undergraduat/images/Town1.pdf b/tactile/undergraduat/images/Town1.pdf new file mode 100644 index 00000000..27987696 Binary files /dev/null and b/tactile/undergraduat/images/Town1.pdf differ diff --git a/tactile/undergraduat/images/Unreal_Engine.pdf b/tactile/undergraduat/images/Unreal_Engine.pdf new file mode 100644 index 00000000..a7f1284a Binary files /dev/null and b/tactile/undergraduat/images/Unreal_Engine.pdf differ diff --git a/tactile/undergraduat/images/available_path.pdf b/tactile/undergraduat/images/available_path.pdf new file mode 100644 index 00000000..29a6a32b Binary files /dev/null and b/tactile/undergraduat/images/available_path.pdf differ diff --git a/tactile/undergraduat/images/collision_detection.pdf b/tactile/undergraduat/images/collision_detection.pdf new file mode 100644 index 00000000..3a7db1cc Binary files /dev/null and b/tactile/undergraduat/images/collision_detection.pdf differ diff --git a/tactile/undergraduat/images/crossing_path1.pdf b/tactile/undergraduat/images/crossing_path1.pdf new file mode 100644 index 00000000..5f65ce7a Binary files /dev/null and b/tactile/undergraduat/images/crossing_path1.pdf differ diff --git a/tactile/undergraduat/images/crossing_path2.pdf b/tactile/undergraduat/images/crossing_path2.pdf new file mode 100644 index 00000000..3264e5b4 Binary files /dev/null and b/tactile/undergraduat/images/crossing_path2.pdf differ diff --git a/tactile/undergraduat/images/crossing_walking1.pdf b/tactile/undergraduat/images/crossing_walking1.pdf new file mode 100644 index 00000000..0d5e1951 Binary files /dev/null and b/tactile/undergraduat/images/crossing_walking1.pdf differ diff --git a/tactile/undergraduat/images/crossing_walking2.pdf b/tactile/undergraduat/images/crossing_walking2.pdf new file mode 100644 index 00000000..2fd94fb7 Binary files /dev/null and b/tactile/undergraduat/images/crossing_walking2.pdf differ diff --git a/tactile/undergraduat/images/crossing_walking3.pdf b/tactile/undergraduat/images/crossing_walking3.pdf new file mode 100644 index 00000000..49a48f31 Binary files /dev/null and b/tactile/undergraduat/images/crossing_walking3.pdf differ diff --git a/tactile/undergraduat/images/crossing_walking4.pdf b/tactile/undergraduat/images/crossing_walking4.pdf new file mode 100644 index 00000000..c12e05fa Binary files /dev/null and b/tactile/undergraduat/images/crossing_walking4.pdf differ diff --git a/tactile/undergraduat/images/crossing_walking5.pdf b/tactile/undergraduat/images/crossing_walking5.pdf new file mode 100644 index 00000000..0cf38c6f Binary files /dev/null and b/tactile/undergraduat/images/crossing_walking5.pdf differ diff --git a/tactile/undergraduat/images/crossing_walking6.pdf b/tactile/undergraduat/images/crossing_walking6.pdf new file mode 100644 index 00000000..d5c9ec23 Binary files /dev/null and b/tactile/undergraduat/images/crossing_walking6.pdf differ diff --git a/tactile/undergraduat/images/crossing_walking7.pdf b/tactile/undergraduat/images/crossing_walking7.pdf new file mode 100644 index 00000000..4010c3ba Binary files /dev/null and b/tactile/undergraduat/images/crossing_walking7.pdf differ diff --git a/tactile/undergraduat/images/crossing_walking8.pdf b/tactile/undergraduat/images/crossing_walking8.pdf new file mode 100644 index 00000000..5d3d9565 Binary files /dev/null and b/tactile/undergraduat/images/crossing_walking8.pdf differ diff --git a/tactile/undergraduat/images/gui_interface.pdf b/tactile/undergraduat/images/gui_interface.pdf new file mode 100644 index 00000000..79453871 Binary files /dev/null and b/tactile/undergraduat/images/gui_interface.pdf differ diff --git a/tactile/undergraduat/images/gui_layout.pdf b/tactile/undergraduat/images/gui_layout.pdf new file mode 100644 index 00000000..4b48fa8b Binary files /dev/null and b/tactile/undergraduat/images/gui_layout.pdf differ diff --git a/tactile/undergraduat/images/gui_log.pdf b/tactile/undergraduat/images/gui_log.pdf new file mode 100644 index 00000000..19dd6897 Binary files /dev/null and b/tactile/undergraduat/images/gui_log.pdf differ diff --git a/tactile/undergraduat/images/hutb_and_log.png b/tactile/undergraduat/images/hutb_and_log.png new file mode 100644 index 00000000..6f3c9c63 Binary files /dev/null and b/tactile/undergraduat/images/hutb_and_log.png differ diff --git a/tactile/undergraduat/images/hutb_building.png b/tactile/undergraduat/images/hutb_building.png new file mode 100644 index 00000000..4e9cedde Binary files /dev/null and b/tactile/undergraduat/images/hutb_building.png differ diff --git a/tactile/undergraduat/images/hutb_eim.png b/tactile/undergraduat/images/hutb_eim.png new file mode 100644 index 00000000..57ca9ea6 Binary files /dev/null and b/tactile/undergraduat/images/hutb_eim.png differ diff --git a/tactile/undergraduat/images/hutb_logo.png b/tactile/undergraduat/images/hutb_logo.png new file mode 100644 index 00000000..6a1adca1 Binary files /dev/null and b/tactile/undergraduat/images/hutb_logo.png differ diff --git a/tactile/undergraduat/images/hutb_logo_maoti.png b/tactile/undergraduat/images/hutb_logo_maoti.png new file mode 100644 index 00000000..09216382 Binary files /dev/null and b/tactile/undergraduat/images/hutb_logo_maoti.png differ diff --git a/tactile/undergraduat/images/location_point.pdf b/tactile/undergraduat/images/location_point.pdf new file mode 100644 index 00000000..98699b18 Binary files /dev/null and b/tactile/undergraduat/images/location_point.pdf differ diff --git a/tactile/undergraduat/images/location_select.pdf b/tactile/undergraduat/images/location_select.pdf new file mode 100644 index 00000000..579b1ce2 Binary files /dev/null and b/tactile/undergraduat/images/location_select.pdf differ diff --git a/tactile/undergraduat/images/model.pdf b/tactile/undergraduat/images/model.pdf new file mode 100644 index 00000000..84c6c2f1 Binary files /dev/null and b/tactile/undergraduat/images/model.pdf differ diff --git a/tactile/undergraduat/images/nav_perspective1.pdf b/tactile/undergraduat/images/nav_perspective1.pdf new file mode 100644 index 00000000..ad998b9c Binary files /dev/null and b/tactile/undergraduat/images/nav_perspective1.pdf differ diff --git a/tactile/undergraduat/images/nav_perspective2.pdf b/tactile/undergraduat/images/nav_perspective2.pdf new file mode 100644 index 00000000..6243dc1d Binary files /dev/null and b/tactile/undergraduat/images/nav_perspective2.pdf differ diff --git a/tactile/undergraduat/images/nav_system_architecture.pdf b/tactile/undergraduat/images/nav_system_architecture.pdf new file mode 100644 index 00000000..093543d4 Binary files /dev/null and b/tactile/undergraduat/images/nav_system_architecture.pdf differ diff --git a/tactile/undergraduat/images/nav_system_architecture.png b/tactile/undergraduat/images/nav_system_architecture.png new file mode 100644 index 00000000..b4a466ce Binary files /dev/null and b/tactile/undergraduat/images/nav_system_architecture.png differ diff --git a/tactile/undergraduat/images/obstacle_avoidance.pdf b/tactile/undergraduat/images/obstacle_avoidance.pdf new file mode 100644 index 00000000..fe3a9573 Binary files /dev/null and b/tactile/undergraduat/images/obstacle_avoidance.pdf differ diff --git a/tactile/undergraduat/images/path_planning.pdf b/tactile/undergraduat/images/path_planning.pdf new file mode 100644 index 00000000..e9ae0311 Binary files /dev/null and b/tactile/undergraduat/images/path_planning.pdf differ diff --git a/tactile/undergraduat/images/path_waypoint.pdf b/tactile/undergraduat/images/path_waypoint.pdf new file mode 100644 index 00000000..a714bad1 Binary files /dev/null and b/tactile/undergraduat/images/path_waypoint.pdf differ diff --git a/tactile/undergraduat/images/path_waypoint1.pdf b/tactile/undergraduat/images/path_waypoint1.pdf new file mode 100644 index 00000000..b8fff6b7 Binary files /dev/null and b/tactile/undergraduat/images/path_waypoint1.pdf differ diff --git a/tactile/undergraduat/images/path_waypoint2.pdf b/tactile/undergraduat/images/path_waypoint2.pdf new file mode 100644 index 00000000..8b2376e7 Binary files /dev/null and b/tactile/undergraduat/images/path_waypoint2.pdf differ diff --git a/tactile/undergraduat/images/pedestrain_navgation.pdf b/tactile/undergraduat/images/pedestrain_navgation.pdf new file mode 100644 index 00000000..3b56009a Binary files /dev/null and b/tactile/undergraduat/images/pedestrain_navgation.pdf differ diff --git a/tactile/undergraduat/images/pedestrian_avoidance.pdf b/tactile/undergraduat/images/pedestrian_avoidance.pdf new file mode 100644 index 00000000..d2d8a7e8 Binary files /dev/null and b/tactile/undergraduat/images/pedestrian_avoidance.pdf differ diff --git a/tactile/undergraduat/images/pedestrian_skeleton.pdf b/tactile/undergraduat/images/pedestrian_skeleton.pdf new file mode 100644 index 00000000..010ac64b Binary files /dev/null and b/tactile/undergraduat/images/pedestrian_skeleton.pdf differ diff --git a/tactile/undergraduat/images/sensor_architecture.pdf b/tactile/undergraduat/images/sensor_architecture.pdf new file mode 100644 index 00000000..4ba9736f Binary files /dev/null and b/tactile/undergraduat/images/sensor_architecture.pdf differ diff --git a/tactile/undergraduat/images/system_architecture.pdf b/tactile/undergraduat/images/system_architecture.pdf new file mode 100644 index 00000000..3928abc6 Binary files /dev/null and b/tactile/undergraduat/images/system_architecture.pdf differ diff --git a/tactile/undergraduat/images/system_architecture.png b/tactile/undergraduat/images/system_architecture.png new file mode 100644 index 00000000..612674ce Binary files /dev/null and b/tactile/undergraduat/images/system_architecture.png differ diff --git a/tactile/undergraduat/images/tech_route.pdf b/tactile/undergraduat/images/tech_route.pdf new file mode 100644 index 00000000..3b9cec98 Binary files /dev/null and b/tactile/undergraduat/images/tech_route.pdf differ diff --git a/tactile/undergraduat/images/training1.pdf b/tactile/undergraduat/images/training1.pdf new file mode 100644 index 00000000..a46ee837 Binary files /dev/null and b/tactile/undergraduat/images/training1.pdf differ diff --git a/tactile/undergraduat/images/training2.pdf b/tactile/undergraduat/images/training2.pdf new file mode 100644 index 00000000..037b5267 Binary files /dev/null and b/tactile/undergraduat/images/training2.pdf differ diff --git a/tactile/undergraduat/images/training3.pdf b/tactile/undergraduat/images/training3.pdf new file mode 100644 index 00000000..2dd72f24 Binary files /dev/null and b/tactile/undergraduat/images/training3.pdf differ diff --git a/tactile/undergraduat/images/training4.pdf b/tactile/undergraduat/images/training4.pdf new file mode 100644 index 00000000..9726124b Binary files /dev/null and b/tactile/undergraduat/images/training4.pdf differ diff --git a/tactile/undergraduat/images/training5.pdf b/tactile/undergraduat/images/training5.pdf new file mode 100644 index 00000000..fe0a2ead Binary files /dev/null and b/tactile/undergraduat/images/training5.pdf differ diff --git a/tactile/undergraduat/images/training6.pdf b/tactile/undergraduat/images/training6.pdf new file mode 100644 index 00000000..8e6167a8 Binary files /dev/null and b/tactile/undergraduat/images/training6.pdf differ diff --git a/tactile/undergraduat/images/training7.pdf b/tactile/undergraduat/images/training7.pdf new file mode 100644 index 00000000..03b38f5e Binary files /dev/null and b/tactile/undergraduat/images/training7.pdf differ diff --git a/tactile/undergraduat/images/training8.pdf b/tactile/undergraduat/images/training8.pdf new file mode 100644 index 00000000..c02fcb73 Binary files /dev/null and b/tactile/undergraduat/images/training8.pdf differ diff --git a/tactile/undergraduat/images/walking_back_and_forth.pdf b/tactile/undergraduat/images/walking_back_and_forth.pdf new file mode 100644 index 00000000..b45a6e5a Binary files /dev/null and b/tactile/undergraduat/images/walking_back_and_forth.pdf differ diff --git a/tactile/undergraduat/init_proj.m b/tactile/undergraduat/init_proj.m new file mode 100644 index 00000000..84bb4ecf --- /dev/null +++ b/tactile/undergraduat/init_proj.m @@ -0,0 +1,40 @@ +% 初始化工程 +% 测试:init_proj('calligraphy_score') +function init_proj(proj_name) + +cur_dir = fileparts(mfilename('fullpath')); + +home_dir = fileparts(cur_dir); + +proj_dir = fullfile(home_dir, proj_name); + +if ~exist(proj_dir, 'dir') + mkdir(proj_dir); +end + +cd(proj_dir); + +% 创建一个空的README.md文件 +fid = fopen('README.md', 'w'); +fclose(fid); + +system('git init') +system('git add README.md') +system('git submodule add https://github.com/OpenHUTB/undergraduate.git') +system('git commit -m init') + +% 添加远程链接 +remote_url = ['https://github.com/OpenHUTB/' proj_name '.git']; +system(['git remote add origin ' remote_url]) + +% 推送到远端 +system('git push --set-upstream origin master') + +cd(cur_dir); + +end + + + + + diff --git a/tactile/undergraduat/latexmkrc b/tactile/undergraduat/latexmkrc new file mode 100644 index 00000000..5212721e --- /dev/null +++ b/tactile/undergraduat/latexmkrc @@ -0,0 +1,3 @@ +$pdflatex = 'pdflatex --halt-on-error %O %S'; +$lualatex = 'lualatex --halt-on-error %O %S'; +$xelatex = 'xelatex --halt-on-error %O %S'; \ No newline at end of file diff --git a/tactile/undergraduat/reference.bib b/tactile/undergraduat/reference.bib new file mode 100644 index 00000000..e62a87cb --- /dev/null +++ b/tactile/undergraduat/reference.bib @@ -0,0 +1,258 @@ +@article{qian2024sac, + author = {钱立军 and 宣亮 and 陈健 and others}, + title = {基于 SAC 算法的多交叉口交通信号控制研究}, + journal = {天津大学学报(自然科学与工程技术版)}, + year = {2024}, + volume = {57}, + number = {01}, + pages = {105--111} +} + +@article{wei2021survey, + author = {Wei, H and Zheng, G and Gayah, V and others}, + title = {Recent advances in reinforcement learning for traffic signal control: A survey of models and evaluation}, + journal = {ACM SIGKDD Explorations Newsletter}, + year = {2021}, + volume = {22}, + number = {2}, + pages = {12--18} +} + +@article{tao2024motion, + author = {陶幸 and 俞帆山 and 宋越杰 and others}, + title = {基于惯性传感器的免对准动作的人体上肢运动捕捉方法}, + journal = {飞控与探测}, + year = {2024}, + volume = {7}, + number = {2}, + pages = {28--35} +} + +@inproceedings{chen2018ionet, + author = {Chen, C and Lu, X and Markham, A and others}, + title = {IONet: Learning to cure the curse of drift in inertial odometry}, + booktitle = {Proceedings of 32nd AAAI Conference on Artificial Intelligence}, + year = {2018}, + location = {New Orleans} +} + +@inproceedings{herath2020ronin, + author = {Herath, S and Yan, H and Furukawa, Y}, + title = {RoNIN: Robust neural inertial navigation in the wild: Benchmark, evaluations, & new methods}, + booktitle = {Proceedings of 2020 IEEE International Conference on Robotics and Automation (ICRA)}, + year = {2020}, + location = {Paris}, + pages = {3146--3152} +} + +@article{liu2020tlio, + author = {Liu, W and Caruso, D and Ilg, E and others}, + title = {TLIO: Tight learned inertial odometry}, + journal = {IEEE Robotics and Automation Letters}, + year = {2020}, + volume = {5}, + number = {4}, + pages = {5653--5660} +} + +@article{mnih2013dqn, + author = {Mnih, V and Kavukcuoglu, K and Silver, D and others}, + title = {Playing Atari with deep reinforcement learning}, + journal = {arXiv preprint arXiv:1312.5602}, + year = {2013} +} + +@article{yazdani2023ivpl, + author = {Yazdani, M and Sarvi, M and Bagloee, S A and others}, + title = {Intelligent vehicle pedestrian light (IVPL): A deep reinforcement learning approach for traffic signal control}, + journal = {Transportation Research Part C: Emerging Technologies}, + year = {2023}, + volume = {149}, + pages = {103991} +} + +@article{zhang2019pedestrian, + author = {Zhang, Y and Zhang, Y and Su, R}, + title = {Pedestrian-safety-aware traffic light control strategy for urban traffic congestion alleviation}, + journal = {IEEE Transactions on Intelligent Transportation Systems}, + year = {2019}, + volume = {22}, + number = {1}, + pages = {178--187} +} + +@inproceedings{mourikis2007msckf, + author = {Mourikis, A I and Roumeliotis, S I}, + title = {A multi-state constraint Kalman filter for vision-aided inertial navigation}, + booktitle = {Proceedings of IEEE International Conference on Robotics and Automation}, + year = {2007}, + location = {Rome}, + pages = {3565--3572} +} + +@article{zhao2014crossing, + author = {赵靖 and 马万经 and 杨晓光}, + title = {考虑下游交叉口的路段行人过街优化控制模型}, + journal = {同济大学学报(自然科学版)}, + year = {2014}, + volume = {42}, + number = {10}, + pages = {1536--1542} +} + +@article{foxlin2005tracking, + author = {Foxlin, E}, + title = {Pedestrian tracking with shoe-mounted inertial sensors}, + journal = {IEEE Computer Graphics and Applications}, + year = {2005}, + volume = {25}, + number = {6}, + pages = {38--46} +} + +@article{campos2021orbslam3, + author = {Campos, C and Elvira, R and Rodr{\\'i}guez, J J G and others}, + title = {ORB-SLAM3: An accurate open-source library for visual, visual-inertial, and multimap SLAM}, + journal = {IEEE Transactions on Robotics}, + year = {2021}, + volume = {37}, + number = {6}, + pages = {1874--1890} +} + +@article{guo2020pdr, + author = {Guo, S and Zhang, Y and Gui, X and others}, + title = {An improved PDR/UWB integrated system for indoor navigation applications}, + journal = {IEEE Sensors Journal}, + year = {2020}, + volume = {20}, + number = {14}, + pages = {8046--8061} +} + +@article{wang2023llio, + author = {Wang, Y and Kuang, J and Niu, X and others}, + title = {LLIO: Lightweight learned inertial odometer}, + journal = {IEEE Internet of Things Journal}, + year = {2023}, + volume = {10}, + number = {3}, + pages = {2508--2518} +} + +@inproceedings{simonyan2014action, + author = {Simonyan, K and Zisserman, A}, + title = {Two-stream convolutional networks for action recognition in videos}, + booktitle = {Advances in Neural Information Processing Systems}, + year = {2014} +} + +@article{bochkovskiy2020yolov4, + author = {Bochkovskiy, A and Wang, C Y and Liao, H}, + title = {YOLOv4: Optimal speed and accuracy of object detection}, + journal = {arXiv preprint arXiv:2004.10934}, + year = {2020} +} + +@article{arulkumaran2017deeprl, + author = {Arulkumaran, K and Deisenroth, M P and Brundage, M and others}, + title = {Deep reinforcement learning: A brief survey}, + journal = {IEEE Signal Processing Magazine}, + year = {2017}, + volume = {34}, + number = {6}, + pages = {26--38} +} + +@article{ren2017fasterrcnn, + author = {Ren, S and He, K and Girshick, R and others}, + title = {Faster R-CNN: Towards real-time object detection with region proposal networks}, + journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence}, + year = {2017}, + volume = {39}, + number = {6}, + pages = {1137--1149} +} + +@article{redmon2017yolo9000, + author = {Redmon, J and Farhadi, A}, + title = {YOLO9000: Better, faster, stronger}, + journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence}, + year = {2017}, + pages = {6517--6525} +} + +@article{reid1980tracking, + author = {Reid, D B}, + title = {An algorithm for tracking multiple targets}, + journal = {IEEE Transactions on Automatic Control}, + year = {1980}, + volume = {24}, + number = {6}, + pages = {843--854} +} + +@article{howard2017mobilenets, + author = {Howard, A G and Zhu, M and Chen, B and others}, + title = {MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications}, + journal = {arXiv preprint arXiv:1704.04861}, + year = {2017} +} + +@article{dai2017temporalcontext, + author = {Dai, X and Singh, B and Zhang, G and others}, + title = {Temporal Context Network for Activity Localization in Videos}, + journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence}, + year = {2017} +} + +@article{lian2023inverseql, + author = {Lian, B and Xue, W and Xie, Y and others}, + title = {Off-policy inverse Q-learning for discrete-time antagonistic unknown systems}, + journal = {Automatica}, + year = {2023}, + volume = {155}, + pages = {111171} +} + +@article{clifton2020qlearning, + author = {Clifton, J and Laber, E}, + title = {Q-learning: Theory and applications}, + journal = {Annual Review of Statistics and Its Application}, + year = {2020}, + volume = {7}, + pages = {279--301} +} + +@article{zhang2023shapeiou, + author = {Zhang, H and Zhang, S J}, + title = {Shape-IoU: More accurate metric considering bounding box shape and scale}, + journal = {arXiv preprint arXiv:2312.17663}, + year = {2023} +} + +@article{wang2013densetrajectory, + author = {Wang, H and Kläser, A and Schmid, C and others}, + title = {Dense trajectories and motion boundary descriptors for action recognition}, + journal = {International Journal of Computer Vision}, + year = {2013}, + volume = {103}, + number = {1}, + pages = {60--79} +} + +@misc{openhutb2025, + author = {OpenHutB}, + title = {CARLA 行人导航教程[EB/OL]}, + howpublished = {\url{https://openhutb.github.io/carla_doc/tuto_G_pedestrian_navigation/}}, + year = {2025}, + note = {访问日期: 2025-04-27} +} + +@misc{csdn2023carla, + author = {CSDN 博客}, + title = {Carla 行人模型介绍与使用[EB/OL]}, + howpublished = {\url{https://blog.csdn.net/weixin_44983780/article/details/137682087?ops_request_misc=&request_id=&biz_id=102&utm_term=carla%E8%A1%8C%E4%BA%BA%E6%A8%A1%E6%8B%9F&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-137682087.142\^v102\^control&spm=1018.2226.3001.4187}}, + year = {2023}, + note = {访问日期: 2025-04-27} +}