diff options
-rw-r--r-- | client/readme.md | 82 | ||||
-rw-r--r-- | robot/readme.md | 34 |
2 files changed, 101 insertions, 15 deletions
diff --git a/client/readme.md b/client/readme.md new file mode 100644 index 0000000..990504d --- /dev/null +++ b/client/readme.md @@ -0,0 +1,82 @@ +# client code + +this is the subdirectory for all client code (runs on pc/laptop) + +this page is WIP + +## features + +|feature|due|status|author|description| +|-|-|-|-|-| +|view warnings / errors| +|direct control| +|enable/disable emergency mode| + + + + + +## interface + +the client is a user-facing application that allows control and monitoring of +the robot in various ways. it primarily works in a command-line way, with the +user typing commands that get translated to protocol messages, and sent to the +robot. to start the interface, the user should run `./main <com-port> [command] +[args]`. by not specifying a command, the interactive shell is launched which +looks like this (and it's supposed to be in dutch): + +``` +verbonden, 2ms ping (0.0.2-11-g92c394b) batterij 100% +[huidige logica-modus] 0 waarschuwingen, 0 foutmeldingen +-------------------------------------------------------------------------------- + + + + + + + + + + + + + + +welkom in de wall-e2 console applicatie! deze client is versie +0.0.2-11-g92c394b + +typ 'help' om alle commando's te zien in een lijst, of 'doei' om deze +applicatie weer te sluiten. + +w2> +``` + +the top status bar is always supposed to be visible, and is sort of inspired by +[ncmpcpp](https://github.com/ncmpcpp/ncmpcpp). because the client software +should use no libraries if possible, a custom renderer needs to be implemented, +though it doesn't matter if it's very primitive. + +going from top-left in reading order the status bar contains: connection +status, ping time, robot version number, robot battery info, current logic +mode, warnings and critical exceptions. the version number is aligned to the +terminal center, and the battery and warning counters are aligned right. when a +connection hasn't been established between the robot and client, the fields +containing robot info should dissapear. + +## code structure + +because multithreading is hard, another cyclic system is used. the following +modules are executed after each other: + +- serial read +- stdin read (user input) +- optional control mode handling + +## notes on ascii escape codes + +- color codes +- terminal echo codes +- how to read terminal (re)size +- cursor movement + diff --git a/robot/readme.md b/robot/readme.md index 31acafc..eb1dd37 100644 --- a/robot/readme.md +++ b/robot/readme.md @@ -52,17 +52,21 @@ handling module, which then both handles the error and forwards it to pc communication for logging purposes). here's a quick run-down of all modules and what they're supposed to do: -|module |internal name|author|purpose| -|----------------|-------------|-|-| -|hypervisor |`hypervisor `|N/a| backbone of all other modules; stores global variables; controls when other modules run| -|pc communication|`sercomm `|Fiona| reads and parses incoming serial data; sends all data in the message buffer| -|error handling |`errcatch `|Loek| receives error codes; controls how errors are handled| -|i/o read & write|`io `|Jorn & Abdullaahi| reads all inputs to global state; writes all outputs| -|mode logic |`modes `|N/a| executes the appropriate module for current mode| -|maze |`mode_maze `|Jorn & Abdullaahi| controls robot during maze portion of map; hands off control to warehouse module| -|warehouse |`mode_grid `|Loek| controls robot during warehouse portion of map; hands off control to maze module| -|emergency stop |`mode_halt `|Fiona| stops all execution until emergency mode is reset by software or user| -|calibration |`mode_lcal `|Fiona| find line by turning on own axis if lost| +|module |internal name|due|author|purpose| +|------------------|-------------|-|-|-| +|hypervisor |`hypervisor `|done|N/a| backbone of all other modules; stores global variables; controls when other modules run| +|pc communication |`sercomm `|may 27|Loek| reads and parses incoming serial data; sends all data in the message buffer| +|error handling |`errcatch `|done|Loek| receives error codes; controls how errors are handled| +|i/o read & write |`io `|may 27|Jorn & Abdullaahi| reads all inputs to global state; writes all outputs| +|mode logic |`modes `|done|N/a| executes the appropriate module for current mode| +|maze |`mode_maze `|may 31|Jorn & Abdullaahi| controls robot during maze portion of map; hands off control to warehouse module| +|warehouse |`mode_grid `|may 31|Loek| controls robot during warehouse portion of map; hands off control to maze module| +|emergency stop |`mode_halt `|may 31|Fiona| stops all execution until emergency mode is reset by software or user| +|line finding |`mode_lcal `|may 31|Fiona| find line by turning on own axis if lost| +|charge station |`mode_chrg `|may 31|Fiona| go to the charging station transition in the grid, and continue until a black circle is found| +|direct control |`mode_dirc `|may 31|Loek| respond to [DIRC](../protocol.md#DIRC) commands| +|wet floor |`mode_spin `|may 31|Fiona| spin uncontrollably (simulating wet floor??)| +|sensor calibration|`mode_scal `|may 31|Jorn & Abdullaahi| calibrate underside uv sensors| ## some standards @@ -100,13 +104,13 @@ this list will probably get updated from time to time: global todo: -- [ ] add test/simulation mode for wet floor (spinning) -- [ ] add a manual control mode - [ ] start robot in calibration mode - [ ] assume robot starts in maze -- [ ] maze-grid transition detection in seperate file (used by grid and maze +- [ ] 'crosswalk' transition detection in seperate file (used by grid and maze mode) -- [ ] clear global timer at start of cycle instead of just for mode selection +- [ ] client software architecture +- [x] mode 'return' buffer +- [x] clear global timer at start of cycle instead of just for mode selection module (for last ping time measurement) - [ ] calibrate (line-detecting) light sensors in setup.c, or manually by placing the robot and pressing a button (maybe make this a seperate mode) |