Diagnostic station/Server communication

Message format

  • Human readable
  • #: display, don't interpret
  • every messages ends with one of \r, \n, \r\n
  • empty lines are ignored
  • Numbers:
    • Zero-indexed
    • BOM: 0..15
    • Motors: 0/1
    • Rangefinders: 0..4
    • Encoders: 0/1

Messages

Server -> Station

help

  • Outputs list of commands
  • Use # for output

Starting tests

All tests:
  • start_test all
All tests for one component:
  • start_test rangefinder all
  • start_test encoder all
  • start_test motor all
  • start_test bom all
  • start_test bom emitter all
  • start_test bom detector all
Tests for one individual component
  • start_test rangefinder <num>
  • start_test enocoder <num>
  • start_test motor <num>
  • start_test bom <num>
  • start_test bom emitter <num>
  • start_test bom detector <num>

Misc

  • stop
  • interactive (or short i): switch to interactive mode

Station -> Server

data messages

BOM:
  • data bom emitter <num> top/<value> left/<value> right/<value>
  • data bom detector <num> in/<value> out/<value>
Rangefinders:
  • data rangefinder <num> <direction> <wall_distance>/<rangefinder_reading>...
  • direction: in/out
Motors:
  • data motor <num> <direction> <acceleration> <pwm>/<velocity>...
  • num: 1/2
  • direction: forward/backward
  • acceleration: increasing/decreasing/constant
  • velocity: dynamo steps per second
Encoders:
  • data encoder <num> <direction> <dynamo_value>/<encoder_value>
  • direction: forward/backward

Misc

  • finished

Example

> start_test all
< # Testing rangefinders
< # Testing rangefinder 1
< # Rangefinder 1 test finished
< data rangefinder 1 ...
< # ...
< # Testing rangefinders finished
< # Testing BOM
< # ...
< # All tests finished
> start_test rangefinder 3
> # ...
> data rangefinder 3 ...

Enhancements

  • robot died
  • error conditions
    • warning <message>
    • error <message>
  • start_test <component> num, num, num, ...
  • finished_test
    • mandatory for all tests where starting_test was sent
    • optional for detailed messages
  • starting_test <test specification>
    • rangefinder <num>
    • motors <num>
    • enocder <num>
    • bom <num>
    • starting_test rangefinder 4