Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 850 Bytes

File metadata and controls

43 lines (34 loc) · 850 Bytes

WebSocket and Message Protocol

The browser UI and the simulator bridge exchange JSON messages over WebSocket.

Supported message shapes

Movement command

{"cmd":"move","action":"forward"}

Supported actions:

  • forward
  • left
  • right
  • uturn

Position set command

{"cmd":"set","r":3,"c":2,"dir":"E"}

Wall update command

{"cmd":"walls","walls":[[0,0,1,1,1,1],[0,1,1,0,1,1]]}

UI state message

{
  "type":"state",
  "bot":{"r":2,"c":3,"dir":"N"},
  "start":[0,0],
  "goal":[4,4],
  "walls":[[0,0,1,1,1,1], [0,1,1,0,1,1]]
}

Notes

  • The walls array uses the format [row, col, north, east, south, west].
  • The UI sends state updates whenever the maze or bot position changes.
  • The bridge script translates incoming state updates into UART-like packets for the STM-side workflow.