《计算平台部署与测试(双语)》课件-项目二:智能网联软件开发环境构建_第1页
《计算平台部署与测试(双语)》课件-项目二:智能网联软件开发环境构建_第2页
《计算平台部署与测试(双语)》课件-项目二:智能网联软件开发环境构建_第3页
《计算平台部署与测试(双语)》课件-项目二:智能网联软件开发环境构建_第4页
《计算平台部署与测试(双语)》课件-项目二:智能网联软件开发环境构建_第5页
已阅读5页,还剩38页未读, 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

UnderstandingC++C++的认知程序无处不在SoftwareIsEverywhere这些日常生活场景的背后,是什么在控制它们的运行?What’sbehindtheoperationoftheseeverydaysituations?什么是C++?WhatIsC++?2026年1998年2023年1983年BjarneStroustrup开发"CwithClasses",为C++雏形·BjarneStroustrupdeveloped“CwithClasses,”theprototypeofwhatwouldlaterbecomeC++.首个国际标准C++98发布,包含STLThefirstinternationalstandard,C++98,wasreleased,includingtheStandardTemplateLibrary(STL).C++23发布,增强格式化、错误处理等实用功能C++23wasreleased,enhancingpracticalfeaturessuchasformattinganderrorhandling.(计划):C++26开发中,将完善现有特性并扩展新工具

(Planned):C++26isunderdevelopment,aimingtorefineexistingfeaturesandintroducenewtools.应用领域:游戏开发、操作系统、嵌入式系统ApplicationAreas:GameDevelopment,OperatingSystems,EmbeddedSystems基本语法要点KeyPointsofBasicGrammar数据类型DataTypesint、double、char、stringExamplesofVariableDefinitions变量定义示例:运算符Operators+-*/%ExamplesofControlStatements:控制语句示例:程序示例——求两个数的和ProgramExample—CalculatingtheSumofTwoNumbers编程技巧与调试方法ProgrammingTechniquesandDebuggingMethods调试技巧:DebuggingTips▶1.逐步调试:修改程序后,每次运行测试,查看输出结果,避免一次性修改太多地方,难以找出错误。Step-by-StepDebugging:Aftermodifyingyourprogram,testitaftereachchangeandchecktheoutput.Avoidmakingtoomanychangesatonce,asthiscanmakeitdifficulttolocateerrors.2.合理使用cout:调试时,可以在程序中加入cout语句,输出变量的值和程序执行到哪一步。UsecoutEffectively:Duringdebugging,youcaninsertcoutstatementsintoyourprogramtodisplayvariablevaluesandtracktheexecutionflow.例如Forexample3.检查括号配对:C++中,{}、()和[]都是非常重要的符号,必须成对出现。如果丢失了一个括号,程序就会出错。CheckBracketPairing:InC++,{},(),and[]areveryimportantsymbolsandmustalwaysappearinpairs.Ifabracketismissing,theprogramwillproduceanerror.这样就可以查看a和b的值是否正确Thisallowsyoutocheckwhetherthevaluesofaandbarecorrect.4.注意分号:每条语句后面要加上分号。编译器会因为缺少分号报错。PayAttentiontoSemicolons:Eachstatementmustendwithasemicolon(;).Ifasemicolonismissing,thecompilerwillreportanerror.5.理解错误提示:当程序出错时,编译器会给出错误信息,要学会阅读这些信息,查找错误所在。UnderstandErrorMessages:Whenanerroroccurs,thecompilerwilldisplayanerrormessage.Itisimportanttolearnhowtoreadandinterpretthesemessagesinordertolocateandfixtheerrors.编程技巧与调试方法ProgrammingTechniquesandDebuggingMethods常见错误类型:CommonTypesofErrors▶1.语法错误:如缺少分号、括号未配对等。SyntaxErrors:TheseoccurwhentheprogramviolatesthegrammaticalrulesofC++,suchasmissingsemicolonsorunmatchedbrackets.2.运行时错误:如除以0、访问不存在的数组元素等。RuntimeErrors:Theseoccurwhiletheprogramisrunning—forexample,dividingbyzerooraccessinganarrayelementthatdoesnotexist.3.逻辑错误:程序没有按照预期工作,但没有语法错误(例如:写了错误的公式,计算结果不正确)。LogicalErrors:Theseoccurwhentheprogramrunsbutdoesnotproducetheexpectedresult.Therearenosyntaxerrors,butthelogicisincorrect(forinstance,usingthewrongformula,leadingtoanincorrectcalculation).调试工具DebuggingToolsIDE(集成开发环境)IDE(IntegratedDevelopmentEnvironment)ToolssuchasVisualStudioandCode::Blocksprovidebuilt-indebuggingfeatures.Theyallowyoutoexecuteprogramsstepbystepandinspectthevaluesofvariablesduringruntime.如VisualStudio、Code::Blocks等,它们提供了调试功能,可以逐步执行程序,检查变量的值。编译器错误信息CompilerErrorMessagesLearntounderstandtheerrormessagesprovidedbythecompilerandusethemtoidentifyandcorrectproblemsinyourcode.学习理解编译器的错误提示,并能够根据提示修正程序。总结Summarize了解C++语言的特点和用途UnderstandingtheFeaturesandApplicationsoftheC++Language学习了C++的基本语法(数据类型、运算符、控制结构)LearnedtheBasicSyntaxofC++(DataTypes,Operators,andControlStructures)编写了简单的C++程序(输入两个数,求和)WroteaSimpleC++Program(InputTwoNumbersandCalculateTheirSum)学会了基本的调试技巧(逐步调试、使用cout输出)LearnedBasicDebuggingTechniques(Step-by-StepDebuggingandUsingcoutforOutput)UnderstandingPythonPython的认知为什么要学习Python编程?WhyLearnPythonProgramming?简单易学:语法接近英语,适合初学者EasytoLearn:ItssyntaxisclosetonaturalEnglish,makingitidealforbeginners.跨平台:可在Windows、Mac、Linux上运行Cross-Platform:PythoncanrunonWindows,macOS,andLinuxoperatingsystems.丰富的库:支持数据分析、机器学习等RichLibraries:Itprovidesextensivelibrariesthatsupportdataanalysis,machinelearning,andmanyotherapplications.Python的基本语法概述OverviewofPythonBasicSyntax代码示例CodeExample语法要点KeySyntaxPoints缩进:Python通过缩进表示代码块,缩进必须一致。Indentation:Pythonusesindentationtodefinecodeblocks,andtheindentationmustbeconsistent.注释Comments逐步单行注释:#Single-linecomment:#多行注释:'''或"""Multi-linecomment:'''or"""区分大小写:Python区分大小写,print与Print不同。CaseSensitivity:Pythoniscase-sensitive—forexample,printandPrintaredifferentidentifiers.无分号:Python语句末尾不需要分号;NoSemicolons:InPython,statementsdonotneedtoendwithasemicolon(;).动态类型:变量类型根据赋值自动推断,无需提前声明。DynamicTyping:Variabletypesaredeterminedautomaticallybasedontheassignedvalue;nopriordeclarationisrequired.变量与数据类型VariablesandDataTypes变量定义VariableDefinitionname←"李华"name←"LiHua"age←18age←18score←95.5score←95.5数据类型DataTypes整型(int)-123-整数Integer

(int)—e.g.,123—representswholenumbers.浮点型(float)-3.14-小数Floating-point(float)—e.g.,3.14—representsdecimalnumbers.字符串(str)-"Python"-文本String(str)—e.g.,"Python"—representstext.布尔型(bool)-True/False-真/假Boolean(bool)—e.g.,True/False—representslogicalvalues(trueorfalse).条件控制语句ConditionalStatementsif-elif-else结构流程图Flowchartoftheif-elif-elseStructure▶开始→条件1→代码块1→结束↓条件2→代码块2→结束↓其他→代码块3→结束Flowchartoftheif-elif-elseStructure:Start→Condition1→CodeBlock1→End↓Condition2→CodeBlock2→End↓Else→CodeBlock3→End变量与数据类型VariablesandDataTypesfor循环forLoop循环变量in序列→执行代码块→下一个元素Loopvariableinsequence→Executecodeblock→Nextelementfor循环forLoop条件判断→执行代码块→更新条件Conditioncheck→Executecodeblock→Updatecondition函数定义与使用FunctionDefinitionandUsage输入参数→函数处理→返回值Inputparameters→Functionprocessing→Returnvalue函数结构FunctionStructure面向对象编程基础FundamentalsofObject-OrientedProgramming运行结果ProgramOutput代码示例CodeExample类(模板)→实例化→对象(实例)Class(Template)→Instantiation→Object(Instance)类与对象关系图Class–ObjectRelationshipDiagram数据结构与算法基础FundamentalsofDataStructuresandAlgorithms创建:scores=[85,92,78]Creation:scores=[85,92,78]列表操作ListOperations访问:scores[0]→85Access:scores[0]→85添加:scores.append(90)AddElement:scores.append(90)字典操作:DictionaryOperations:创建:student={"name":"张三","age":18}Creation:student={"name":"ZhangSan","age":18}访问:student["name"]→"张三"Access:student["name"]→"ZhangSan"总结Summarize程序示例ProgramExampleUnderstandingROSROS的认知自动驾驶车是怎么“自己开”的?HowDoSelf-DrivingCars“DriveThemselves”?自动驾驶汽车如何识别道路与障碍?Howdoself-drivingcarsrecognizeroadsandobstacles?它如何规划安全路线?Howdoesitplanasaferoute?软件系统之间又是如何协同工作的?Howdosoftwaresystemsworktogethercollaboratively?ROS:自动驾驶的“操作中枢”ROS:The“OperatingHub”ofAutonomousDrivingROS≠操作系统ROS≠OperatingSystem它是一个机器人/智能车辆的软件开发平台Itisasoftwaredevelopmentplatformforrobotsandintelligentvehicles.提供通信机制、算法库、可视化与仿真环境Itprovidescommunicationmechanisms,algorithmlibraries,andenvironmentsforvisualizationandsimulation.ROS的核心特点CoreFeaturesofROS特点Features模块化ModularDesign感知、定位、规划、控制可独立开发Perception,localization,planning,andcontrolcanbedevelopedseparatelyasindividualmodules.自动驾驶中的体现ApplicationsinAutonomousDriving通信高效EfficientCommunication资源共享ResourceSharing可扩展Scalability节点之间通过Topic实时交换数据Nodescommunicatethroughtopicstoshareinformationinrealtime.可复用全球开源自动驾驶算法Globalopen-sourceautonomousdrivingalgorithmscanbereusedandintegrated.支持多传感器融合与多车辆协同Supportsmulti-sensorfusionandcoordinationamongmultiplevehicles.ROS在自动驾驶系统中的框架TheFrameworkofROSinAutonomousDrivingSystems底层:车辆传感器(LiDAR、Camera、IMU)、控制器LowerLayer:VehicleSensors(LiDAR,Camera,IMU)andControllers中间层:ROS节点通信(Topic、Service、Action)MiddleLayer:ROSNodeCommunication(Topic,Service,Action)上层:感知、定位、规划、控制算法UpperLayer:Perception,Localization,Planning,andControlAlgorithmsROS通信:车载系统的神经网络ROSCommunication:TheNeuralNetworkofIn-VehicleSystemsTopic(主题):传输数据,如“/lidar_points”、“/cmd_vel”Topic:Usedfordatatransmission,suchas"/lidar_points"or"/cmd_vel".Publisher:发送节点(如雷达)Publisher:Thesendingnode(e.g.,LiDAR).Subscriber:接收节点(如感知模块)Subscriber:Thereceivingnode(e.g.,perceptionmodule).车载开发常用ROS工具CommonlyUsedROSToolsforIn-VehicleDevelopmentROS在移动机器人导航系统中的架构设计ArchitectureDesignofROSinMobileRobotNavigationSystems1.感知模块PerceptionModule激光雷达与摄像头发布环境数据。LiDARandcameraspublishenvironmentaldata.2.定位与路径规划模块LocalizationandPathPlanningModule定位节点估算机器人位置,路径规划节点计算最优路径。Thelocalizationnodeestimatestherobot’sposition,andthepathplanningnodecalculatestheoptimalroute.3.控制模块ControlModule控制节点根据规划路径驱动机器人。Thecontrolnodedrivestherobotaccordingtotheplannedpath.4.模块化设计优势AdvantagesofModularDesign每个模块独立开发、测试,便于系统扩展与维护。Eachmodulecanbedevelopedandtestedindependently,makingthesystemeasiertoextendandmaintain.ROS在自动驾驶中的实际应用PracticalApplicationsofROSinAutonomousDrivingAutoware:基于ROS的开源自动驾驶系统

支持感知、定位、路径规划与控制Itsupportsperception,localization,pathplanning,andcontrol.Autoware:AnOpen-SourceAutonomousDrivingSystemBasedonROS广泛用于教学、科研与测试车辆Itiswidelyusedineducation,research,andtestvehicles.总结Summarize让ROS驱动未来出行SummaryandReflection:EmpoweringtheFutureofMobilitywithROSInstallationandUsageofROSROS的安装与使用为什么需要安装ROS?WhyDoWeNeedtoInstallROS?自动驾驶系统包含感知、定位、规划、控制四大模块Anautonomousdrivingsystemconsistsoffourmainmodules:perception,localization,planning,andcontrol.这些模块之间需要统一通信平台Thesemodulesrequireaunifiedcommunicationplatform.ROS就是让模块协作的“操作系统ROSservesasthe“operatingsystem”thatenablescollaborationamongmodules.安装前的准备工作PreparationBeforeInstallation环境检测流程图EnvironmentalTestingFlowchart配置要求:SystemRequirements操作系统:Ubuntu18.04/20.04/22.04OperatingSystem:Ubuntu18.04/20.04/22.04内存:至少4GBMemory:Atleast4GB存储空间:至少30GB可用空间Storage:Atleast30GBofavailablespace网络连接:需要联网下载安装包NetworkConnection:Internetaccessisrequiredtodownloadinstallationpackages.ROS安装流程ROSInstallationProcess1.添加ROS软件源到sources.listAddtheROSrepositorytothesources.list2.导入密钥ImportthekeyROS安装流程ROSInstallationProcess3.更新UpdateROS安装流程ROSInstallationProcess4.安装ROS完整版InstalltheFullVersionofROS此指令代表安装桌面完整版本,包括:ROS,rqt,rviz,机器人通用库,2D/3D仿真器,导航及2D/3D感知。Thiscommandinstallsthedesktopfullversion,whichincludes:R

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论