Closed marcocarnut closed 2 years ago
This issue has been automatically marked for closing, because it has not had activity in 30 days. It will be closed if no further activity occurs in 10 days.
This issue was closed, because it has been already marked for 10 days with no activity.
I often forget to select the correct spool, messing all measurements. I initially thought of putting a new camera near the spool to read the QR code I glued on it, but QR code reading is somewhat unreliable -- rather minor twists on the spool or unfavorable lighting conditions would upset the QR code detection.
Apriltags, however, are very robust -- they're widely used in robotics, being specifically designed to be reliably detected at a distance, at weird angles and unfavorable lighting. They can only carry a small numeric ID, but that's more than enough.
So I printed a ring of Apriltags, glued on the spool, took a picture with the same camera I use to monitor the print, getting something like that:
Then I ran the image through the Apriltag "demo" utility, and, to my joy, it detected the tags perfectly, spitting out its ID (which I made the same as my spool
databaseId
).Not wanting to mess with the plugin's source code just yet, I wrote the small bash script below to detect and automatically select the spool via the API:
At least in my setup, it works just fine and I no longer have to worry about manually selecting the correct spool :) Now my usage measurements are always correct (at least with the new spools after I started using this).
It would be nice to have this feature properly coded in the plugin natively. I'm a C, perl and nodejs guy, but I'm a relative noob in Python and a total noob in Octoprint plugin development, so I'd appreciate any guidance/suggestions you might have.
If anyone wants to reproduce this, you'll need
wget
,curl
,jq
andapriltag_demo
from the examples directory of: