Crate vexide_simulator_protocol

source ·
Expand description

The Vexide Simulator Protocol enables communication between VEX robot simulators and user-facing frontends using a JSON-based protocol.

The code executor and frontend communicate over a stream in newline-delimited JSON format.

The backend sends Events which represent a change in simulator state. These are used by the frontend to correctly display the state of the simulated program.

The frontend sends Commands to the code executor to control the robot code environment, simulating changes in robot hardware (like controller input and LCD touch events) or competition phase.

The full protocol is documented at https://internals.vexide.dev/simulators/protocol.

Structs§

  • A 3-wire “ADI” port for analog devices.
  • Battery status and statistics.
  • An RGB color.
  • The raw state of a VEX V5 controller.
  • A pixel with X and Y coordinates.
  • The current state of the robot as a whole.
  • An RJ9 4p4c “Smart” port on the VEX V5.
  • Base64-encoded program metadata.

Enums§

  • A message sent from the frontend to the simulator.
  • The current stage of a competition.
  • A method of retrieving a controller’s current state.
  • The configuration of a V5 peripheral.
  • The current state of a V5 peripheral.
  • An instruction for drawing to the robot LCD screen.
  • A message sent from the simulator to the frontend.
  • The mode of a VEXlink-configured radio.
  • The importance level of a log message.
  • The brake mode of a VEX V5 motor.
  • The gearset of a VEX V5 motor.
  • An arbitrary port on the VEX V5.
  • A shape that can be drawn to the robot LCD screen.
  • The gearset of a VEX V5 motor.