RoboRIO to Driver Station ================================= .. rio_ds_udp: UDP --- Sent every 20ms in response to Driver Station packets, UDP port 1150 .. table:: :widths: auto +---------------+--------+---------------------------------+-------------------------------------------------------+ | Field | Length | Type | Comment | +===============+========+=================================+=======================================================+ | Sequence Num | 2 | uint16 | | +---------------+--------+---------------------------------+-------------------------------------------------------+ | Comm Version | 1 | uint8 | ``0x01`` is currently the only observed value | +---------------+--------+---------------------------------+-------------------------------------------------------+ | Status | 1 | :ref:`Status ` | Basically an echo if everything is operating properly | +---------------+--------+---------------------------------+-------------------------------------------------------+ | Trace | 1 | :ref:`Trace ` | | +---------------+--------+---------------------------------+-------------------------------------------------------+ | Battery | 2 | :ref:`Battery ` | | +---------------+--------+---------------------------------+-------------------------------------------------------+ | Request Date? | 1 | uint8 | ``0x01`` when first connecting, ``0x00`` otherwise | +---------------+--------+---------------------------------+-------------------------------------------------------+ | Tags | n | :ref:`Tags ` | | +---------------+--------+---------------------------------+-------------------------------------------------------+ .. _rio_ds_status: Status ^^^^^^ .. table:: :widths: auto +----------------+--------------+-----------------------------------+ | Field | Mask | Comment | +================+==============+===================================+ | E-Stop | ``x.......`` | | +----------------+--------------+-----------------------------------+ | Brownout | ``...x....`` | 0: Normal, 1: Voltage Brownout | +----------------+--------------+-----------------------------------+ | Code Start | ``....x...`` | 0: Running, 1: Initializing | +----------------+--------------+-----------------------------------+ | Enabled | ``.....x..`` | | +----------------+--------------+-----------------------------------+ | Mode | ``......xx`` | 0: Teleop, 1: Test, 2: Autonomous | +----------------+--------------+-----------------------------------+ .. _rio_ds_trace: Trace ^^^^^ .. table:: :widths: auto +-----------------+--------------+----------------------------+ | Field | Mask | Comment | +=================+==============+============================+ | Robot Code | ``..x.....`` | | +-----------------+--------------+----------------------------+ | Is RoboRIO | ``...x....`` | | +-----------------+--------------+----------------------------+ | Test Mode | ``....x...`` | | +-----------------+--------------+----------------------------+ | Autonomous Mode | ``.....x..`` | | +-----------------+--------------+----------------------------+ | TeleOp Code | ``......x.`` | | +-----------------+--------------+----------------------------+ | Disabled | ``.......x`` | | +-----------------+--------------+----------------------------+ .. _rio_ds_battery: Battery ^^^^^^^ Received as a uint16, ``XXYY``. Voltage is calculated by: ``XX + YY/256`` .. _rio_ds_udp_tags: Tags ^^^^ .. table:: :widths: auto +-------+--------+-------+-----------------------------------------------+ | Field | Length | Type | Comment | +=======+========+=======+===============================================+ | Size | 1 | uint8 | | +-------+--------+-------+-----------------------------------------------+ | ID | 1 | uint8 | See table below | +-------+--------+-------+-----------------------------------------------+ | Data | n | | Depends on tag type | +-------+--------+-------+-----------------------------------------------+ .. table:: :widths: auto +----------+-------------------------------------------------+ | ID | Tag | +==========+=================================================+ | ``0x01`` | :ref:`Joystick Output ` | +----------+-------------------------------------------------+ | ``0x04`` | :ref:`Disk Info ` | +----------+-------------------------------------------------+ | ``0x05`` | :ref:`CPU Info ` | +----------+-------------------------------------------------+ | ``0x06`` | :ref:`RAM Info ` | +----------+-------------------------------------------------+ | ``0x08`` | :ref:`PDP Log ` | +----------+-------------------------------------------------+ | ``0x09`` | :ref:`Unknown ` | +----------+-------------------------------------------------+ | ``0x0e`` | :ref:`CAN Metrics ` | +----------+-------------------------------------------------+ .. _rio_ds_joystick_output: Joystick Output ``0x01`` """""""""""""""""""""""" If multiple joysticks, the extended packets are concatenated together. If a joystick isn't outputting anything, the size will be 1 (to include the packet type ID) and not contain any of the below. So if the 3rd joystick is outputting, it'll output `01 01 01 01 09 01 `. .. table:: :widths: auto +--------------+--------+-----------+-----------------------------------------------+ | Field | Length | Type | Comment | +==============+========+===========+===============================================+ | Outputs | 4 | Output_ | | +--------------+--------+-----------+-----------------------------------------------+ | Left Rumble | 2 | uint16 | | +--------------+--------+-----------+-----------------------------------------------+ | Right Rumble | 2 | uint16 | | +--------------+--------+-----------+-----------------------------------------------+ .. _rio_ds_output: Output ...... 1 bit per output. Stored `LSB 0 `_. .. _rio_ds_disk_info: Disk Info ``0x04`` """""""""""""""""" .. table:: :widths: auto +------------+--------+-----------+---------------------------+ | Field | Length | Type | Comment | +------------+--------+-----------+---------------------------+ | Free Space | 4 | uint32 | Number of bytes available | +------------+--------+-----------+---------------------------+ .. _rio_ds_cpu_info: CPU Info ``0x05`` """"""""""""""""" .. table:: :widths: auto +----------------------+--------+---------+-----------------------------------------------+ | Field | Length | Type | Comment | +======================+========+=========+===============================================+ | Num of CPUs | 4 | float | `0x02` on the RoboRIO | +----------------------+--------+---------+-----------------------------------------------+ | CPUn Time Critical % | 4 | float | | +----------------------+--------+---------+-----------------------------------------------+ | CPUn Above Normal % | 4 | float | | +----------------------+--------+---------+-----------------------------------------------+ | CPUn Normal % | 4 | float | | +----------------------+--------+---------+-----------------------------------------------+ | CPUn Low % | 4 | float | | +----------------------+--------+---------+-----------------------------------------------+ .. _rio_ds_ram_info: RAM Info ``0x06`` """"""""""""""""" .. table:: :widths: auto +------------+--------+-----------+---------------------------+ | Field | Length | Type | Comment | +------------+--------+-----------+---------------------------+ | Block | 4 | uint32 | | +------------+--------+-----------+---------------------------+ | Free Space | 4 | uint32 | Number of bytes available | +------------+--------+-----------+---------------------------+ .. _rio_ds_pdp_log: PDP Log ``0x08`` """""""""""""""" .. table:: :widths: auto +------------+--------+--------+----------+ | Field | Length | Type | Comment | +------------+--------+--------+----------+ | Unknown | 1 | | | +------------+--------+--------+----------+ | PDP Stats | 21 | | | +------------+--------+--------+----------+ | Unknown | 3 | | | +------------+--------+--------+----------+ The statistics for each PDP port is 10 bits, padding together for a total of 21 bytes. .. code-block:: c struct PDP { uint16_t port_00 : 10; // uint16_t port_01 : 10; // 8 bytes, 40 bits uint16_t port_02 : 10; // uint16_t port_03 : 10; // uint16_t port_04 : 10; // uint16_t port_05 : 10; // uint16_t pad1 : 4; // uint16_t port_06 : 10; // uint16_t port_07 : 10; // 8 bytes, 40 bits uint16_t port_08 : 10; // uint16_t port_09 : 10; // uint16_t port_10 : 10; // uint16_t port_10 : 10; // uint16_t pad2 : 4; // uint16_t port_12 : 10; // uint16_t port_13 : 10; // 5 bytes, 40 bits uint16_t port_14 : 10; // uint16_t port_15 : 10; // } .. _rio_ds_unknown_09: Unknown ``0x09`` """""""""""""""" .. table:: :widths: auto +----------+--------+--------+----------+ | Field | Length | Type | Comment | +----------+--------+--------+----------+ | Unknown | 9 | | | +----------+--------+--------+----------+ .. _rio_ds_can_metrics: CAN Metrics ``0x0e`` """""""""""""""""""" .. table:: :widths: auto +---------------+--------+--------+----------+ | Field | Length | Type | Comment | +---------------+--------+--------+----------+ | Utilization % | 4 | float | | +---------------+--------+--------+----------+ | Bus Off | 4 | uint32 | | +---------------+--------+--------+----------+ | TX Full | 4 | uint32 | | +---------------+--------+--------+----------+ | RX Errors | 1 | uint8 | | +---------------+--------+--------+----------+ | TX Errors | 1 | uint8 | | +---------------+--------+--------+----------+ .. _rio_ds_tcp: TCP --- Sent over TCP port 1740. Strings are either prefixed with a length (specified) or implied. .. table:: :widths: auto +----------+--------+--------+------------------------------------+ | Field | Length | Type | Comment | +----------+--------+--------+------------------------------------+ | Size | 2 | uint16 | Including ID | +----------+--------+--------+------------------------------------+ | ID | 1 | uint8 | See table below (only if Size > 0) | +----------+--------+--------+------------------------------------+ | Tags | 1 | | Depends on tag type | +----------+--------+--------+------------------------------------+ Tags ^^^^ .. table:: :widths: auto +----------+-------------------------------------------------+ | ID | Tag | +----------+-------------------------------------------------+ | ``0x00`` | :ref:`Radio Events? ` | +----------+-------------------------------------------------+ | ``0x01`` | :ref:`Usage Report ` | +----------+-------------------------------------------------+ | ``0x04`` | :ref:`Disable Faults ` | +----------+-------------------------------------------------+ | ``0x05`` | :ref:`Rail Faults ` | +----------+-------------------------------------------------+ | ``0x0a`` | :ref:`Version Info ` | +----------+-------------------------------------------------+ | ``0x0b`` | :ref:`Error Message ` | +----------+-------------------------------------------------+ | ``0x0c`` | :ref:`Standard Output ` | +----------+-------------------------------------------------+ | ``0x0d`` | :ref:`Unknown ` | +----------+-------------------------------------------------+ .. _rio_ds_radio_events: Radio Events? ``0x00`` """""""""""""""""""""" *Might just be generic "Error Strings" or something.* .. table:: :widths: auto +------------+--------+--------+----------+ | Field | Length | Type | Comment | +------------+--------+--------+----------+ | Message | n | string | | +------------+--------+--------+----------+ .. code-block: none Warning 44008 16.008 14.507\n .. _rio_ds_usage_report: Usage Report ``0x01`` """"""""""""""""""""" .. table:: :widths: auto +----------+--------+-------------------------------------+---------+ | Field | Length | Type | Comment | +==========+========+=====================================+=========+ | Team Num | 2 | string | | +----------+--------+-------------------------------------+---------+ | Unknown | 1 | uint8 | | +----------+--------+-------------------------------------+---------+ | Entries | n | :ref:`Entry Data ` | | +----------+--------+-------------------------------------+---------+ .. _rio_ds_disable_faults: Disable Faults ``0x04`` """"""""""""""""""""""" .. table:: :widths: auto +--------------+--------+--------+---------------------------------------------+ | Field | Length | Type | Comment | +==============+========+========+=============================================+ | Comms | 2 | uint16 | | +--------------+--------+--------+---------------------------------------------+ | 12V | 2 | uint16 | | +--------------+--------+--------+---------------------------------------------+ .. _rio_ds_rail_faults: Rail Faults ``0x05`` """""""""""""""""""" .. table:: :widths: auto +--------------+--------+--------+---------------------------------------------+ | Field | Length | Type | Comment | +==============+========+========+=============================================+ | 6V | 2 | uint16 | | +--------------+--------+--------+---------------------------------------------+ | 5V | 2 | uint16 | | +--------------+--------+--------+---------------------------------------------+ | 3.3V | 2 | uint16 | | +--------------+--------+--------+---------------------------------------------+ .. _rio_ds_version_info: Version Info ``0x0a`` """"""""""""""""""""" .. table:: :widths: auto +---------+--------+-------------------------------+-----------+ | Field | Length | Type | Comment | +=========+========+===============================+===========+ | Type | 1 | :ref:`Device ` | See below | +---------+--------+-------------------------------+-----------+ | Unknown | 2 | | | +---------+--------+-------------------------------+-----------+ | ID | 1 | uint8 | CAN ID? | +---------+--------+-------------------------------+-----------+ | Name | 1 + n | string | | +---------+--------+-------------------------------+-----------+ | Version | 1 + n | string | | +---------+--------+-------------------------------+-----------+ Empty message (``00 00 00 00 00 00``) signifies end of list. .. _rio_ds_device: Device Type ............ .. table:: :widths: auto +-----+---------------------------------------------------+ | Num | Type | +=====+===================================================+ | 0 | Software (``roboRIO image``, ``FRC_Lib_Version``) | +-----+---------------------------------------------------+ | 2 | CAN Talon | +-----+---------------------------------------------------+ | 8 | PDP | +-----+---------------------------------------------------+ | 9 | PCM | +-----+---------------------------------------------------+ .. _rio_ds_error_message: Error Message ``0x0b`` """""""""""""""""""""" Shows up in main Driver Station log. Sequence Number increments along with Standard Output. .. table:: :widths: auto +------------+--------+-------------------------------------------+----------------------------+ | Field | Length | Type | Comment | +============+========+===========================================+============================+ | Timestamp | 4 | float | Seconds since start of log | +------------+--------+-------------------------------------------+----------------------------+ | SeqNum | 2 | uint16 | | +------------+--------+-------------------------------------------+----------------------------+ | Unknown | 2 | | Only seen as ``01``? | +------------+--------+-------------------------------------------+----------------------------+ | Error Code | 4 | int32 | | +------------+--------+-------------------------------------------+----------------------------+ | Flags | 1 | :ref:`Flags ` | | +------------+--------+-------------------------------------------+----------------------------+ | Details | 2 + n | string | | +------------+--------+-------------------------------------------+----------------------------+ | Location | 2 + n | string | | +------------+--------+-------------------------------------------+----------------------------+ | Call Stack | 2 + n | string | | +------------+--------+-------------------------------------------+----------------------------+ .. _rio_ds_error_message_flags: Flags ...... .. table:: :widths: auto +----------------+--------------+-----------------------------------+ | Field | Mask | Comment | +================+==============+===================================+ | Error | ``.......x`` | | +----------------+--------------+-----------------------------------+ | isLVcode | ``......x.`` | | +----------------+--------------+-----------------------------------+ .. _rio_ds_standard_output: Standard Output ``0x0c`` """""""""""""""""""""""" Sequence Number increments along with Error Message. .. table:: :widths: auto +-----------+--------+--------+----------------------------+ | Field | Length | Type | Comment | +===========+========+========+============================+ | Timestamp | 4 | float | Seconds since start of log | +-----------+--------+--------+----------------------------+ | SeqNum | 2 | uint16 | | +-----------+--------+--------+----------------------------+ | Message | n | string | | +-----------+--------+--------+----------------------------+ .. _rio_ds_unknown_0d: Unknown ``0x0d`` """""""""""""""" ``00 00 04 04 04 04``