伟大的鼓舞人心的线程,谢谢。再增加一些传感器模块,您将拥有一个强大的传感器子系统,能够进行实际的定位和映射以及避障!如果您的陀螺仪运行良好且经过校准,请选择适合您的航向'如果漂移时间很小(秒),您甚至可以实施"drunk mode"通过在移动时摆动航向来扫描环境,填充传感器的死角。
对于路线规划,除视线测试外,我在实施A *(或更具体而言,theta *变体)方面具有丰富的经验,除了测试视线测试外,还增加了测试机器人是否可以旋转的测试方法。如果您的机器人不是'绕圈并可能在转弯时撞到障碍物,这当然很重要。对于大于一个的机器人"pixel" in the grid, and can possibly turn, I found out that a good optimization is to 我们 e a 1-bit lookup table 对于 the robot shape, 对于 example, 对于 a 32*32 像素点 robot area, rotated in 16 different directions would be const uint32_t shape_lut[16][32] and accessed like shape_lut[direction][y] |= (1<<X)。现在,您可以通过一次移位和一次AND操作对地图进行比较,并一次比较32个点。在我的theta *路线规划中,仅此一项优化就带来了20倍的IIRC加速。
我不'不知道A *或Theta *对于紧密而复杂的迷宫是否最有效或最简单,它可能不是';但是,它对于现实世界中的路线规划非常有用,因为紧紧围墙会导致路线漫长而愚蠢,'由于实施简单,通过谷歌搜索广泛使用的伪代码实际上是可行的。
But routefinding and solving the maze is always the easy problem, by 要么ders of magnitude, when you compare it to the problem of creating an accurate map with your sensor data and localizing in it. If you want to work on the maze solving 科幻rst, make those corridors wider than 1 像素点, 我们 e some non-zero dimensions 对于 the robot, and add some "noise"使墙壁呈锯齿状。