I realize I can determine that a tool is mounted by checking pin 63. This allows me to start my sequence with something like this:
If pin 63 = 1
Execute "mount watering tool"
what? [This would be a great place to e-stop]
However, at this point the remaining commands in the sequence would continue to execute
Move to plant 1
Move to plant 2
Turning FarmBot into GinsuBot™.
I could make the
IF STATEMENT the only command in the sequence and
THEN execute a more complex sequence that includes picking up the tool and doing all the other steps, but I need a lot more error handling. Did the tool actually get picked up? Before I turn on the water is the tool still attached? And on and on… I can see this becoming a very complex nested sequence spaghetti mess.
It would stop FarmBot from executing any subsequent commands in the sequence as well as prevent upcoming farm events from running… So if it dropped the watering tool it would be prevented from slicing up the farm.
This actually supports my argument for e-stop. I’m going out of town next week and wish I could count on Farmbot not to go full-on Dalek. Robust logic and error-handling would be super sweet, but I get that it’s complicated and will take a significant effort. Having the ability to call an e-stop would at least allow us to halt everything before all hell breaks loose.