logo

巡线小车运行程序,一直出现IDE interrupt,无法运行得到所巡的线!

2019-04-14 12:38
V
_13413694082
99a523ec-71b8-4a90-b111-089ceda05499.png
2019-04-14 17:30
V
_13413694082

@kidswong999 大佬在不在啊?看下我那张图片,怎么解决啊!T-T

2019-04-15 13:51
I
网红小智智 星瞳科技

你可以print(line)看一下

2019-04-15 14:32
V
_13413694082

@kidswong999 ok,我试下

2019-04-15 14:53
V
_13413694082

@13413694082 还是不行,因为程序后面本来是 #print(clock.fps())【有一个#注释符,表注释】,我修改为 #print(line),程序没反应,没有线出来;然后我把#去掉,改为print(line),还是不行,串行终端显示【None】。

V
_13413694082
92901e71-cd5a-4fc8-80a3-103b393ddae7.png
2019-04-15 15:00
V
_13413694082

@kidswong999 我试了 rho_err = abs(line.rho())-img.width()/2

if line.theta()>90:

theta_err = line.theta()-180

else:

theta_err = line.theta()

img.draw_line(line.line(), color = 127)

print(line)

if line.magnitude()>8:

#if -40<b_err<40 and -30<t_err<30:

rho_output = rho_pid.get_pid(rho_err,1)

theta_output = theta_pid.get_pid(theta_err,1)

这里改为print(line),也不行

2019-04-15 15:40
I
网红小智智 星瞳科技

因为magnitude会判断拟合度好不好。你的图像里效果不太好。

2019-04-15 16:13
V
_13413694082
2b80daae-24c7-4aac-8b4f-d9d061d8d830.png
V
_13413694082

@kidswong999 这种效果也不行啊!而且拟合度是是不影响绿色的轨迹线的出现吧?

V
_13413694082

@kidswong999 是这段:【img.draw_line(line.line(), color = 127)】函数不运行呀

2019-04-15 18:42
I
网红小智智 星瞳科技

http://book.openmv.cc/example/09-Feature-Detection/linear-regression-fast.html

你直接运行这个程序

2019-04-15 19:45
V
_13413694082
d7b69696-8ab1-4cf9-b069-e96b819131c2.png
V
_13413694082

@kidswong999 这个程序可以得到生成的轨迹线了

2019-04-15 20:14
V
_13413694082

@kidswong999 我如何修改程序呢?

2019-04-16 13:46
I
网红小智智 星瞳科技

http://book.openmv.cc/project/follow-lines.html

代码里是绿色的线,你实际上是绿色的?

2019-04-16 14:02
V
_13413694082

@kidswong999 我实际是蓝色线,我把阈值修改为蓝色的了

假如是mag拟合度这里:【 if line.magnitude()>8:】限制了后面轨迹线的出现,我修改过拟合度的值,使之变小,直至为0,也不行的...

2019-04-16 14:08
V
_13413694082

@kidswong999 (0, 56, 41, -41, -51, 41)

这是我的阈值

2019-04-16 14:56
I
网红小智智 星瞳科技

你可以直接删除if line.magnitude()

逻辑你可以随便改的

2019-04-16 16:39
V
_13413694082

@kidswong999 删除mag这段也没用。

单独的get_regression程序就可以运行