team401 / Copper-Console

Enhanced field vision for drivers
MIT License
0 stars 0 forks source link

Render notes #11

Open aidnem opened 8 months ago

aidnem commented 8 months ago

Add rendering of notes detected by the robot. In order to do this, we need a field in the network table for the robot to send back the notes it sees.

One way we could do this would be having a a double array field under /CopperConsole/notes, containing pairs of [x, y] positions (we could use Pose2D but we shouldn't need rotation, as notes are circular) of seen notes. This way, the robot could send back multiple note locations at the same time.

In Copper Console itself, note rendering could be implementing by keeping track of each seen note and its timestamp when it was seen. They would appear at full opacity when initially being sent from the robot, and then fade out slowly as they grow older (as the likelihood that a note is still there decreases, as one hasn't been seen there in a while). Some sort of detection could be added so that, if a note is detected very close to the location of another already detected note, it would just refresh the fade out back to full strength and average their two positions (or use the new position), as the two detections are likely from the same note.

Any suggestions/modifications to this system are welcome, this is just a first idea.