Comments (10)
你好,你理解的是对的,nnode 是当前树中节点的数量,因此将 nnode 设置为 len(self.node_list) 是合理的。至于为什么加了1是考虑到这个值用来计算搜索区域的半径,它是作为除数的,为了避免在计算过程中出现除以零的情况,所以nnnode加了1,这是为了计算的简洁,可以理解成是种比较tricky的计算。
from chhrobotics.
但是不是在代码初始的位置就已经将起点代入节点了吗,还会出现为0的情况吗?
from chhrobotics.
对,在代码的初始位置,起点已经被添加到了节点列表中。直接使用 len(self.node_list) 理论上是安全的,+1是一种tricky的方式,一般对于除数位置,都会做点确保不为0的操作。这里并非说就要加1,例如我们可以在写代码的时候用DCHECK或者抛出异常的方式去检查除数不为0。在实际项目中也是后者采用得多。
from chhrobotics.
另外,当代码初始时只有一个节点的时候,此时r 计算出来是0,对查找也是会有影响的。时间有点久了,我目前看代码理解就是这样哈,欢迎讨论
from chhrobotics.
你好 当采样点增多时加1与不加1时的搜索半径有一定差值的,不会对搜索结果产生影响吗?
from chhrobotics.
后面与步长比较是两者取小值哇,另外搜索半径的公式大致可以看出来他是个先增后减的函数(增的部分实际上就初始一点点),也就是说半径后面是减小的,对搜索结果影响不到呀,搜索效率可能略有影响。
from chhrobotics.
你好 请问就是对搜索结果只有最开始有一些影响并且影响较小,所以可以不用考虑这点影响吗?
from chhrobotics.
我觉得这个影响可以忽略不计。初始不加1的话算出来搜索半径是0,也会进行不下去的哇。➕1我感觉是最简单的处理方式,仅仅是初始时对搜索效率影响相比于后面来说大一些而已
from chhrobotics.
你好 就是对于开始时,只有起点作为节点,所以为0的话也无所谓吧,等到后面+1比不加1所算出来的半径要小一些,请问这样也不会影响最终的结果吗,我看包括你写的博客也是说n是节点数量?
from chhrobotics.
嗯嗯,我不觉得会影响到最终的结果,之前说了我觉得稍微会影响的是搜索效率
from chhrobotics.
Related Issues (4)
- 大佬,请问下mpc中求ref_delta的公式理解 HOT 2
- rrt算法中的疑问 HOT 1
- 关于e_y为什么为负数的个人理解
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chhrobotics.