我正在构建一个自动迷宫解算器,灵感来自于以下内容:
http://www.youtube.com/watch?v=Prq78ctJ2Rk&feature=related我已经用步进电机建立了迷宫控制,我正在使用下面的步进电机控制板:
http://www.sparkfun.com/products/10025
我正在使用视觉系统来控制迷宫解算器。我还找到了这个问题已经解决的链接:
http://cse.logicol.org/?p=52
他们已经使用模板匹配来识别球。上面链接中提到的团队还上传了一个视频,看起来他们有精明的边缘检测来找到路径并执行PID算法。
http://www.youtube.com/watch?v=8b5ARjT22bg&feature=player_embedded
现在,我还在opencv中建立了模板匹配和边缘检测。我还通过USB串口建立了对我的步进器的控制。如何实现导航算法?如何实现PID控制?从理论上讲,我知道PID控制的概念,但我只是不知道如何利用摄像机的信息来实现它。我只是不知道如何让球沿着这条线走。
请找到我到目前为止所获得的结果的附件图像。
赛斯
发布于 2011-06-26 02:27:47
我不太理解你的问题,但如果你问球在这里的位置有什么命令,我的猜测是:
1. you find the location of the ball.
2. you have the line of the desired path drown on the board and detected
using canny.
3. Find the closest point to the ball which is on the path line. If
it was a straight line then the calculation is simple geometrical
formulae dist(point,line). Let us call the result D.
4. The resulting point on the line is where the ball should be.
5. Advance distance D along the path line. This would give you your
destination point.
6. Subtract ball coordinates from destination point, and then, using atan2()
method to calculate in which direction to move the ball.
7. Activate motores to tilt board in that direction.对第5步的说明。为什么我说要沿路径前进距离D?因为这样你的球最多只能在路径线的45度内。这使您可以相对平滑的运动。
如果我不明白你的问题,请告诉我,我会改正我的答案
https://stackoverflow.com/questions/6470755
复制相似问题