asyncapi: 2.0.0 info: title: WPILib WebSocket Remote Endpoint API version: "1.1.0" description: | API to route WPILib HAL calls over WebSockets. license: name: WPILib BSD channels: wpilibws: description: General channel for WPILib WebSocket messages publish: operationId: wpilibwsPublish message: $ref: "#/components/messages/wpilibwsMsg" subscribe: operationId: wpilibwsSubscribe message: $ref: "#/components/messages/wpilibwsMsg" components: messages: wpilibwsMsg: title: WPILib WebSocket Message summary: Message envelope. Note that the "data" field contains a diff of the current state of a particular device. E.g. If only the "value" changes for a DIO device, then only the "<>value" field will be sent. contentType: application/json examples: - payload: type: PWM device: "1" data: "x": type: number description: "Acceleration in G’s " ">y": type: number description: "Acceleration in G’s " ">z": type: number description: "Acceleration in G’s " addressableLEDData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: AddressableLED device: type: string description: Arbitrary device number data: type: object description: "Addressable LED Data (type: AddressableLED, device: arbitrary)" properties: voltage": type: number description: "Input voltage, in volts" "accum_value": type: integer description: "The accumulated value" ">accum_count": type: integer description: "The number of accumulated values" "value: type: boolean description: "Input or output state" "new_data": type: boolean description: "One shot. If set to true in a message, notifies the robot program that new DS and Joystick data is available." ">enabled": type: boolean description: "True to enable the robot program" ">autonomous": type: boolean description: "True for autonomous mode; false for teleoperated mode" ">test": type: boolean description: "True for test mode; false for other modes" ">estop": type: boolean description: "True to emergency stop (no motor outputs)" ">fms": type: boolean description: "True if the DS is connected to a Field Management System (FMS)" ">ds": type: boolean description: "True if a DS application is connected" ">station": type: string description: "Station color and number; supported values are 'red1', 'red2', 'red3', 'blue1', 'blue2', 'blue3'." ">match_time": type: number description: "Match time countdown, in seconds, for each match period (e.g. for 15 second period, starts at 15 and counts down to 0). If not in a match, -1." ">game_data": type: string description: "Game-specific data; arbitrary string contents" dutycycleData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: DutyCycle device: type: string description: Arbitrary device name data: type: object description: "Duty Cycle Input Data (type: DutyCycle, device: channel number)" properties: ">connected": type: boolean description: "True if the encoder is connected" ">position": type: number description: "The position in rotations" encoderData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: Encoder device: type: string description: Device Identifier (usually channel) data: type: object description: "Quadrature Encoder Data (type: Encoder, device: channel number)" properties: count": type: integer description: "Accumulated count (pulses)" ">period": type: number description: "Period between pulses in seconds" "connected": type: boolean description: "True if the gyro is connected" ">angle_x": type: number description: "The gyro angle in degrees" ">angle_y": type: number description: "The gyro angle in degrees" ">angle_z": type: number description: "The gyro angle in degrees" ">rate_x": type: number description: "The current gyro angular rate of change in degrees/second" ">rate_y": type: number description: "The current gyro angular rate of change in degrees/second" ">rate_z": type: number description: "The current gyro angular rate of change in degrees/second" halData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: HAL device: type: string description: "\"HAL\"" const: HAL data: type: object description: "HAL Data (type: HAL, device: HAL)" properties: ">sim_periodic_before": type: boolean description: "Sent by the robot before running periodic simulation functions" ">sim_periodic_after": type: boolean description: "Sent by the robot after running periodic simulation functions" joystickData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: Joystick device: type: string description: Device Identifier (usually channel) data: type: object description: "Joystick Data (type: Joystick, device: channel number)" properties: ">axes": type: array items: type: number description: "Value of an individual axis on this joystick" minimum: -1.0 maximum: 1.0 ">povs": type: array description: "One array element per POV; value is a" items: type: integer description: "State of all POV switches on this joystick; an angle in degrees of the POV (e.g. 0, 90, 315) if pressed, or -1 if the POV is not pressed" ">buttons": type: array description: State of all buttons on this joystick items: type: boolean description: Pressed state of an individual button on": type: boolean description: "Whether the compressor is running" "pressure_switch": type: boolean description: "The value of the pressure switch" ">current": type: number description: "The amount of current being drawn by the compressor, in Amps" pwmData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: PWM device: type: string description: Device Identifier (usually channel) data: type: object description: "PWM Output Data (type: PWM, device: channel number)" properties: squelch every other value; `3` -> squelch 3 of 4 values)" "fpga_button": type: boolean description: "FPGA button state" ">vin_voltage": type: number description: "Vin rail voltage" ">vin_current": type: number description: "Vin rail current" ">6v_voltage": type: number description: "6V rail voltage" ">6v_current": type: number description: "6V rail current" ">6v_active": type: boolean description: "True if 6V rail active, false if inactive" ">6v_faults": type: integer description: "Number of faults on 6V rail" ">5v_voltage": type: number description: "5V rail voltage" ">5v_current": type: number description: "5V rail current" ">5v_active": type: boolean description: "True if 5V rail active, false if inactive" ">5v_faults": type: integer description: "Number of faults on 5V rail" ">3v3_voltage": type: number description: "3.3V rail voltage" ">3v3_current": type: number description: "3.3V rail current" ">3v3_active": type: boolean description: "True if 3.3V rail active, false if inactive" ">3v3_faults": type: integer description: "Number of faults on 3.3V rail" canmotorData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: CANMotor device: type: string description: "Should have the form ControllerClassName[id]" data: type: object description: "CANMotor Data" properties: supplyCurrent": type: number description: "Supply current in Amps" minimum: 0.0 ">motorCurrent": type: number description: "Motor current in Amps" minimum: 0.0 ">busVoltage": type: number description: "Bus voltage in Volts" minimum: 0.0 "position": type: number description: "Position in rotations" ">velocity": type: number description: "Velocity in rotations per second" cangyroData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: CANGyro device: type: string description: "Should have the form GyroClassName[id]" data: $ref: "#/components/schemas/gyroData/properties/data" canaccelData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: CANAccel device: type: string description: "Should have the form AccelClassName[id]" data: $ref: "#/components/schemas/accelData/properties/data" canainData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: CANAIn device: type: string description: "Should have the form AnalogInputClassName[id]" data: $ref: "#/components/schemas/aiData/properties/data" candioData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: CANDIO device: type: string description: "Should have the form DIOClassName[id]" data: $ref: "#/components/schemas/dioData/properties/data" candutycycleData: type: object required: - type - device properties: type: type: string description: Device Type (e.g. DIO/AI/PWM/Encoder etc) const: CANDutyCycle device: type: string description: "Should have the form DutyCycleClassName[id]" data: $ref: "#/components/schemas/dutycycleData/properties/data" simdeviceData: type: object required: - type - device properties: type: type: string const: SimDevice device: type: string data: type: object additionalProperties: type: string