Java Python CS 6613 Fall 2024 Project 1: Robot Path Planning E. K. Wong
Total # points = 100.
Project Description: Implement the A* search algorithm with graph search (no repeated states) for the robot path planning problem as described below. The inputs to your program are the start and goal positions of a point robot, and a 2D integer array that represents the robot workspace. The robot can move from cell to cell in any of the eight directions as shown in Figure 2. The goal is to find the lowest-cost path between the start position and the goal position, and avoiding obstacles along the path. The workspace is represented as an occupancy grid as shown in Figure 1, where the black cells represent obstacles. The red line in the figure depicts a path from the start position to the goal position. (Note: the path in the figure is not the lowest-cost path as required in our project.)
where
Formulation: The problem can be formulated in the following way. Each cell in the workspace is a state. The white cells are legal states and the black cells are illegal states. The actions are the eight moves as defined in Figure 2. The step cost for the actions is the sum of the angle cost and the distance cost; i.e.,
𝑐𝑐(𝑠𝑠, 𝑎𝑎, 𝑠𝑠′) = 𝑐𝑐𝑎𝑎(𝑠𝑠, 𝑎𝑎, 𝑠𝑠′) + 𝑐𝑐𝑑𝑑(𝑠𝑠, 𝑎𝑎, 𝑠𝑠′)
3, 5, 7.
𝑐𝑐𝑎𝑎(𝑠𝑠, 𝑎𝑎, 𝑠𝑠′) = 𝑘𝑘 ∗ ∆𝜃𝜃 ; let 𝑐𝑐𝑎𝑎(𝑠𝑠, 𝑎𝑎, 𝑠𝑠′) = 0 if s is the initial state (start position) 180
∆𝜃𝜃 = |(𝜃𝜃(𝑠𝑠′) − 𝜃𝜃(𝑠𝑠)|; if ∆𝜃𝜃 > 180, let ∆𝜃𝜃 equals 360 − ∆𝜃𝜃
𝑐𝑐𝑑𝑑(𝑠𝑠, 𝑎𝑎, 𝑠𝑠′) = 1 for horizontal and vertical moves 0, 2, 4, 6 and √2 for diagonal moves 1,
In the above, s is the current state, a is the action and s’ is the next state. The angle cost is to penalize any change in the direction of the robot between two consecutive moves. k is a constant that we can set to control the amount of penalty we want to impose for angle change. For the initial state (start position), we let the angle cost between the initial state s and next state s’ equals to 0. The distance cost is for the distance travelled in an action. Let h(𝑛𝑛) be the Euclidian distance between the current position and the goal position. h(𝑛𝑛) thus defined is admissible in this problem. During the search, only legal states (cells without obstacles) will be added to the tree.
Input and output formats: The workspace in the test input files is of size 30 × 50 (rows x columns.) We will use the coordinate system as shown in Figure 3 below. The coordinates of the lower-left corner cell are (𝑖𝑖, 𝑗𝑗) = (0,0). The input file contains 31 lines of integers as shown in Figure 4 below. Line 1 contains the (𝑖𝑖, 𝑗𝑗) coordinates of the start and goal positions of the point robot. Lines 2 to 31 contain the cell values of the robot workspace, with 0’s representing white cells, 1’s representing black cells, 2 representing the start position and 5 representing the goal position. Line 2 contains values for (𝑖𝑖, 𝑗𝑗) = (𝑖𝑖, 29), with 𝑖𝑖 = 0 to 49. Line 31 contains values for (𝑖𝑖, 𝑗𝑗) = (𝑖𝑖, 0), with 𝑖𝑖 = 0 to 49, etc. The integers in each line are separated by blank spa java、 c++,python ces.
Your program will produce an output text file that contains 34 lines of text as shown in Figure 5 below. Line 1 contains the depth level d of the goal node as found by the A* algorithm (assume that the root node is at level 0.) Line 2 contains the total number of nodes N generated in your tree (including the root node.) Line 3 contains the solution (a sequence of moves from the root node to the goal node) represented by a’s. The a’s are separated by blanks. Each a is a move from the set {0,1,2,3,4,5,6,7}. Line 4 contains the f(n) values of the nodes (separated by blanks,) from the root node to the goal node, along the solution path. There should be d number of a values in line 3 and
CS 6613 Fall 2024 Project 1: Robot Path Planning E. K. Wong
d+1 number of f values in line 4. Lines 5 to 34 contain values for the robot workspace, with 0’s representing white cells, 1’s representing black cells, 2 representing the start position, 5 representing the goal position, and 4’s representing cells along the solution path (excluding the start position and the goal position.)
Figure 3. Coordinate system of the work space.
CS 6613 Fall 2024 Project 1: Robot Path Planning E. K. Wong
Testing your program: Three input test files will be provided on Brightspace for you to test your program. For each input file, try two different runs: one with k = 2 and one with k =4. You can let k be an interactive input parameter in your program.
Recommended languages: Python, C++/C or Java. If you would like to use a different language, send me an email first.
Teammate: You can work on the project by yourself or form a team of two to work on the project. You can discuss with your classmates how to do the project, but every team is expected to write their own code and submit their own project.
Submit on Brightspace:
• Your source code file. Put comments in your source code to make it easier for someone else to read your program. Points will be taken off if you do not have comments in your source code.
• The output files generated by your program for the three input test files.
• A PDF report that contains instructions on how to run your program. If your program requires compilation, instructions on how to compile your program should also be provided. Also, copy and paste your output files and your source code onto the PDF file. This is in addition to the source code file and output files that you have to hand in
separately, as described in items (1) and (2) above.
• If you work in a team of two, only one partner needs to submit the project on Brightspace
but put down both partners’ names on the source code and the PDF report.
d
N
a a a ....a
f f f .....f
m m m m m m ....m m m m m m m ....m ...
m m m m m m ....m
Figure 5. Output file format (34 lines.) d, N, a’s, and m’s are integers. f’s are floating point numbers. The a’s, f’s and m’s are separated by blanks.
nnnn
m m m m m m ....m m m m m m m ....m ...
m m m m m m ....m
Figure 4. Input file format (31 lines.) n’s and m’s are integers separated by blanks
相关推荐
编程语言C、C++、Java、python、matlab的区别
C++、Java和Python都是面向对象的编程语言。其中C++和Java都是强类型语言,而Python是一种弱类型语言。 C++需求效率的软件 C++更接近于底层,方便直接操作内存。C++不仅拥有计算机高效运行的实用性特征,同时还致力于提高大规模程序的编程质量与程序设计语言的问题描述能力。 C++不仅是C和java特点的结合。实际上C++是多范式编程语言。它不仅支持传统的面向过程编程,也支持面向...
C、C++、Java、Python之间的区别
C、C++、Java、Python介绍 C++、Java和Python都是面向对象的编程语言。其中C++和Java都是强类型语言,而Python是一种弱类型语言。 1)python: 快速开发应用程序 python比较容易学习,语法很简单,融入了很多现代编程语言的特性。python的库非常丰富,可以迅速地开发程序,无论是网站还是小游戏都非常方便。不过,python的脚本的运行效率较低,不适合对运行...
Delphi 12.3 精简绿色版下载
Delphi精简绿色版基于原版安装,去掉了InterBase、法语、德语、日语,只保留了Delphi Windows 32和Delphi Windows 64桌面开发,其余部分未做任何修改。Delphi精简绿色版不含任何破解,仅供学习和研究,24小时后请自行删除,如需继续使用Delphi,请购买正版。绿色版基于原版安装,未做任何精简和修改。绿色版不含任何破解,仅供学习和研究,24小时后请自行删除,如需继续使用RAD Studio,请购买正版。
python和java,c++有什么不同,c++,java,python的区别在哪
大家好,小编为大家解答java,c语言,python,c++的不同之处的问题。很多人还不知道python和java,c++有什么不同,现在让我们一起来看看吧!
多智能体强化学习之值函数分解:VDN、QMIX、QTRAN系列优缺点分析(转载)
关于多智能体强化学习中VDN,QMIX,QTRAN三个算法再值分解方向的研究成果。三个算法呈递进关系
C#计算八字
private string[] jq = { "小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至" };private string[] dz = { "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥", "子" };
C、C++、Java 和 Python
总结来说,C、C++、Java 和 Python 这四种语言各有所长,选择哪种语言取决于具体的应用场景和需求。例如,如果需要开发操作系统或底层系统软件,C 或 C++ 是更好的选择;如果需要开发跨平台的应用或游戏,Java 或 Python 可能更适合;如果需要进行数据分析和人工智能等领域的开发,Python 是一个非常好的选择。
Ubuntu 20.04下大陆ARS408毫米波雷达点云数据采集与RVIZ实时可视化全流程解析
本文详细解析了在Ubuntu 20.04系统下,如何实现大陆ARS408毫米波雷达的点云数据采集与RVIZ实时可视化全流程。内容涵盖硬件连接、ROS Noetic环境搭建、CAN接口配置、数据验证及自动化脚本编写,为机器人感知、自动驾驶等领域的开发者提供了一套稳定、实用的实战方案。
每日一问:Java、C、C++、Python语言的区别详解
**Java、C、C++、Python是当今编程世界中最常用的编程语言,它们各自有着独特的语法、功能和应用领域**。本文将深入分析这四种编程语言的区别,通过具体实例帮助读者理解它们的优缺点及适用场景。
高频仿真:高频天线设计_(4).天线参数分析与优化
通过上述步骤,我们展示了如何综合使用解析方法、数值优化方法和实验数据来设计和优化一个高效宽带天线。首先,我们通过解析方法确定了天线的初步长度;然后,使用遗传算法优化了天线的直径以最大化增益;最后,通过实验数据验证了天线的性能,包括驻波比和带宽。这一综合性方法可以有效地提升天线的设计和优化效果,确保其在实际应用中表现出色。
YOLOv11来了,使用YOLOv11训练自己的数据集和推理(附YOLOv11网络结构图)
YOLOv11 由 Ultralytics 在 2024 年 9 月 30 日发布, 最新的 YOLOv11 模型在之前的 YOLO 版本引入了新功能和改进,以进一步提高性能和灵活性。YOLO11 在快速、准确且易于使用,使其成为各种对象检测和跟踪、实例分割、图像分类和姿态估计任务的绝佳选择。
C/C++、Java、Python全面比较
每种语言都有其独特的优势和适用场景,选择哪种语言取决于具体的应用需求和个人偏好。
Level 4自动驾驶系统设计0——功能与场景0
摘要:当前智能驾驶系统开发存在应试思维误区,过度依赖NCAP标准测试而忽视真实物理世界的复杂工况。随着系统进入L4大模型时代,必须从离散测试转向应对无限连续的长尾场景。关键在于解决传感器输入质量(避免"垃圾进垃圾出"问题),通过逆向定义方法论确保前端数据高置信度。同时采用影子模式收集分歧数据流,结合条件接受机制动态调整感知权重,最终实现功能释放主权(FO)的100%安全闭环。本文揭示了如何为端到端智驾大模型建立物理红线,这是确保L4系统量产的底层法则。
用Python,C++,Java画圣诞树
Python i=int(4) j=int(1) while i>=0: t=int(0) while t<i: print(" ",end='') t=t+1 t=int(0) while t<j: print("*",end='') t=t+1 i=i-1 j=j+2 print() t=int(0) while t<4: print(" ",end='
jdk-8u144-linux-x64.tar.gz.
该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包
ET2012新版免狗免安装绿色软件
ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,
C++、Python、Java类的异同
类用于指定对象的形式,是一种用户自定义的数据类型,它是一种封装了数据和函数的组合。类中的数据称为成员变量,函数称为成员函数。类可以被看作是一种模板,可以用来创建具有相同属性和行为的多个对象。
efm32 入门.pdf
本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。
C,C++,java,python对比
C虽说C语言在内存管理方面存在严重的缺陷,不过它还是在某些应用领域里称王称霸。对于那些要求最高的效率,良好的实时性,或者与操作系统内核紧密关联的程序来说,C仍然是很好的选择。 C良好的可移植性也为它加了分。不过现在很多其他的语言可移植性越来越好,C在这方面的优势可能会逐渐丧失。 现有的很多程序可以产生非常棒的C代码,比如语法分析器、GUI Builder等,这时候C语言也是有吸引力的,...
老版QQ原生表情gif动态
这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。
C#、C++、Java、Python 选择哪个好
以Python为例,它因语法简洁、开发效率高、应用广泛而在AI、数据分析、Web开发等领域大放异彩。根据TIOBE 2024年排名,Python连续位居榜首,体现了其强大的通用性和开发者生态。/wp:image。
C,C++,Java,Python之间的异同
C,C++,Java,Python之间的异同 作者:噜啦啦噜啦啦 链接:https://www.zhihu.com/question/21976478/answer/158145376 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 如果你是一位计算机方面零基础的小白,在日常工作和生活中,希望能够自己编写程序来完成一些事情。那么,比较各种语言之间的异同,...
c语言、c++、java、python区别_总结几点C/C++、Java与Python的区别
1.c++、java和python都是面向对象的编程语言,但是c++和java都是强类型语言,而python是一种弱类型语言2.垃圾回收机制:c++需要程序员收到回收,而java和python都有自己的垃圾回收机制GC。具体两者又有不同,python的垃圾收集机制主要是用的是引用计数方式。3.c和java中变量的存储是真实值,而python总存储的是引用,所以python不用声明类型名称,它的输入...
C++,Java,python的不同之总结
C++,Java,pathon的不同之总结1.引号JavaC++Pathon无引号带引号带双引号带三引号2.输出JavaC++Pathon举例输出HelloWorld 1.引号 Java 单引号引的数据 是char类型的,双引号引的数据 是String类型的;单引号只能引一个字符,而双引号可以引0个及其以上。char只是一个基本类型,而String 可以是一个类,可以直接引用。 C++ 双引号表示字符串,单引号表示字符。 字符串里,哪怕你只放了一个字母,事实上,系统会自动给它加一个\0。表示结束。也就是说,
C/C++、Java、Go、Python总结对比8-Map
map可以用来存储键值对,比如统计全班人的身高,采用的键值对为 人名:身高值。 c的写法 c的内置类型没有map c++的写法 #include <map> void mapDemo() { map<int, char> map1; //初始化map map1.insert(map<int, char>::value_type(1, ...
1、C、C++、JAVA、Python 关系
关于编程语言。不回避一个比较俗气的话题——程序员该学该用什么语言。 先不讨论这个问题,设想一个游戏,孤岛上分布着敌人,你的体能和枪法不赖,有两个场景。 A : 有2个敌人。 B : 有5个敌人。可以选择的武器也非为两种 I : 一把手枪(3颗子弹)。 II : 一把极其锋利的匕首。每种场景下会怎么选择武器。你的选择,其实和选择语言没什么本质区别。 语言是工具,工具是用来干活的
6479



被折叠的 条评论
为什么被折叠?



