-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coordinate conversion implemented #3
Comments
Awesome! This program could query the SQL database on the Pi for the known plant coordinates, and also write the weed coordinates it finds to the db. Then the Pi controller can use those coordinates when executing a "remove weeds" sequence. I think the easiest way to implement this would be to have a "Run Script" block on the web app/controller. This way this (and other) scripts/programs could be easily called from the web app and executed just like any other block. The scripts could be in any language and do whatever. Eventually scripts could be given/denied permissions to interact with the web API if they needed it. Or with the Pi's database. Ideally there would be a way for the script to emit a status that the controller would listen for. For example: "Working...", "Error: 123", "Done. Result = XYZ", which could then be added to the main FarmBot logs and sent back to the web app too. Each script would have to have an execution time limit so that if it misbehaves or hangs, the pi controller could move on. Maybe 30 seconds as a default. With this framework the web app/FarmBot is opened up to all sorts of functionality, especially from third parties. Rather than having to add new functionality to the pi controller directly, one can simply add whatever scripts they want without having to have changes made to the more generic controller codebase. There could be a "script store"! Popular scripts could be implemented "natively" in the pi controller over time. cc: @RickCarlino |
Looks great, @gabrielburnworth !! 🎆 We have a couple of options for this, and all of them revolve around the concept of adding "pluggable modules" to the RPI. OPTION I: ENV + STDOUTIf you've done web app development in the 90's or early 00's, you might remember CGI scripts. CGI scripts offered a way to add custom behavior to web servers without modifying the web server. This pattern worked really well for creating light dynamic behavior. It might work well for what we're trying to do right now. The premise was:
Advantages
Disadvantages
Option II: Unix / TCP Sockets.Another approach would be to expose a TCP or Unix Domain socket as a means of reading / writing information to the bot. The socket would provide a command line interface to the bot, similar to the way one would connect to a SQL database, Memcached, Redis etc.
Advantages
Disadvantages
Option III: Something Else?I'm just spit balling ideas at this point. Let me know if you had a different idea. Ideal outcomes:
CC: @roryaronson |
What about doing both solution 1 and 2 (in the long run)? We could start with 1 because its fast and easy and we don't really need to worry about performance or long-running scripts right now. As you said, it would be easier for people to get their scripts working with it too. Later we can implement 2 as a second option for scripts that would benefit from it. |
Conversion from pixel locations to machine coordinates has been implemented.
Usage:
Example output shown below used a rotated calibration image.
Example image output:
Green = known plant
Blue = saved plant
Red = plant marked for removal
Example text output:
The text was updated successfully, but these errors were encountered: