4533-phoenix / infinite-recharge-robot

Other
2 stars 0 forks source link

Implement simple robot config server #15

Open abrightwell opened 3 years ago

abrightwell commented 3 years ago

Related to #8 and #4.

Create a simple http server that can run on the roborio and can be used to configure the robot from the dashboard.

Items to configure should be auto mode, pid values, etc.

Use of https://www.rapidoid.org/ could make this very simple.

As well, it would be useful to persist 'last' settings on the roborio filesystem, location TBD.

abrightwell commented 3 years ago

Thoughts on initial routes for such a server:

GET /auto -> list auto modes PUT /auto/{id} -> enable specific auto mode GET /pid -> list pid values PUT /pid/{id} -> update specific pid values

abrightwell commented 3 years ago

Need to determine available ports. Though, not important for this year given we control the network, however, will be good to incorporate for future years if found useful.

abrightwell commented 3 years ago

For persistence, something like sqlite3 would be ideal, I think. It's lightweight, fast and resilient. All transactions are written to file as well. Could be good for someone to learn how to use it, it's pretty simple.

https://sqlite.org/index.html

However, available modes could certainly come from the code itself.

Potential logic might be...

Start up -> load modes (map or something) -> load previous from sqlite -> set previous mode -> send confirmation to dashboard.

If a mode is no longer supported: set default mode -> send confirmation to dashboard.