Mercury1089 / 2016-robot-code

Team Mercury 2016 FIRST Robotics season code for FIRST Stronghold
0 stars 0 forks source link

Target acquisition - check if angle to target is "shootable" #4

Closed DrewTheRat closed 8 years ago

DrewTheRat commented 8 years ago

gartaud [3:19 PM] Okay. Coming back on the topic of target acquisition, we have yet to fully solve the off center detection (I.e figuring out if we have acquired a target that is not worth shooting at because even if we are within range and can rotate towards it we won't be able to get the ball through the hole). For now I propose we simply try measuring the ratio between the width of the target in pixels and its height also in pixels and display that in the smart display as "target centered criteria" and see what we get...

drewgr [3:23 PM] Didn't we have that when we measured the width of the target rectangle? That value was calculated based on the ratio of height to width, so we knew if we were at too much of an angle. The only problem I remember was that the calculation became inaccurate when we were too close.

jaipatel [3:27 PM] Yes we did it by comparing the height of the target in pixels to the actual height of the target in inches and using that conversion factor to find the width in inches from the width in pixels

gartaud [3:31 PM] Here we are just talking about width in pixels divided by height in pixels

[3:35] It might not be perfect but I don't recall you guys tried. It would not need to be super accurate because the value would just be used as a fairly fuzzy criteria... But maybe you did try and it was totally inaccurate? Anyway I would like to try it again...

[3:37] I suspect that a value over 1.0 would mean might be worth trying and below 1.0 would mean "try again"

[3:40] That would not have any impact on distance measurement or angle correction witch I think are now good enough

gartaud commented 8 years ago

Noting that code was added today - we just need to tune the constant.

kgminer commented 8 years ago

Done. It works.