EinEinfach / CaSSAndRA

Cascaded sunray server and rover application
MIT License
29 stars 17 forks source link

docking based on voltage #113

Closed goosst closed 8 months ago

goosst commented 8 months ago

Hello

I would like to add the feature to cassandra to command docking when going below the minimum voltage (the voltage set in the app). I thought it would be quite simple: check soc<x and send a dock command :). I have looked through the code, but the structure is quite overwhelming for me to be honest.

I believe cmdlist.cmd_dock = True has to be set (just like in the buttongroupcontrol.py). But not very clear what the best file is where this should be added (don't want to mess up your structure). I don't immediately see a file where this type of logic belongs and I don't really understand what the impact of creating additional python files would be (how do you know what python files/functions are being run ... ?).

EinEinfach commented 8 months ago

Up until now, Cassandra has had a passive role during mowing. All stuff should be handled by sunray fw. No commands are sent to the mower. That means the current structure does not provide for such features. To add that will change the philosophy of Cassandra. Not sure if that a right way. To make it right a state machine logic has to be implemented in current structure. If you want a quick and dirty solution, check robot instance of Mower class, there is a set_state call, you can check current soc every time on set_state call