Driver Station to FMS ===================== .. _ds_fms_udp: UDP --- Sent to `10.0.100.5` UDP port 1160 (from UDP port 1145). .. table:: :widths: auto +--------------+--------+---------------------------------------+---------------------------------+ | Field | Length | Type | Comment | +==============+========+=======================================+=================================+ | Sequence Num | 2 | uint16 | | +--------------+--------+---------------------------------------+---------------------------------+ | Comm Version | 1 | uint8 | Only ``0x00`` has been observed | +--------------+--------+---------------------------------------+---------------------------------+ | Status Byte | 1 | :ref:`Status ` | Contains control bits | +--------------+--------+---------------------------------------+---------------------------------+ | Team Num | 2 | uint16 | | +--------------+--------+---------------------------------------+---------------------------------+ | Battery | 2 | :ref:`Battery ` | Battery voltage | +--------------+--------+---------------------------------------+---------------------------------+ | Tags | N | :ref:`Tags ` | | +--------------+--------+---------------------------------------+---------------------------------+ .. _ds_fms_control_status: Status ^^^^^^ .. table:: :widths: auto +--------------------+--------------+-----------------------------------+ | Field | Mask | Comment | +--------------------+--------------+-----------------------------------+ | E-Stop | ``x.......`` | 0: Normal, 1: Emergency Stopped | +--------------------+--------------+-----------------------------------+ | Robot Comms Active | ``..x.....`` | 0: No, 1: Yes | +--------------------+--------------+-----------------------------------+ | Radio Ping | ``...x....`` | 0: No, 1: Yes | +--------------------+--------------+-----------------------------------+ | Rio Ping | ``....x...`` | 0: No, 1: Yes | +--------------------+--------------+-----------------------------------+ | Enabled | ``.....x..`` | 0: Disabled, 1: Enabled | +--------------------+--------------+-----------------------------------+ | Mode | ``......xx`` | 0: TeleOp, 1: Test, 2: Autonomous | +--------------------+--------------+-----------------------------------+ | Reserved | ``.x......`` | | +--------------------+--------------+-----------------------------------+ .. _ds_fms_battery: Battery ^^^^^^^ Received as a uint16, ``XXYY``. Voltage is calculated by: ``XX + YY/256`` .. _ds_fms_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 | Packet Type | +========+=========================================================+ | `0x00` | :ref:`Field Radio Metrics ` | +--------+---------------------------------------------------------+ | `0x01` | :ref:`Comms Metrics ` | +--------+---------------------------------------------------------+ | `0x02` | :ref:`Laptop Metrics ` | +--------+---------------------------------------------------------+ | `0x03` | :ref:`Robot Radio Metrics ` | +--------+---------------------------------------------------------+ | `0x04` | :ref:`PD Info ` | +--------+---------------------------------------------------------+ .. _ds_fms_field_radio_metrics: Field Radio Metrics (``0x00``) """""""""""""""""""""""""""""" .. table:: :widths: auto +-----------------------+--------+--------+---------+ | Field | Length | Type | Comment | +=======================+========+========+=========+ | Signal Strength | 1 | uint8 | | +-----------------------+--------+--------+---------+ | Bandwidth Utilization | 2 | uint16 | | +-----------------------+--------+--------+---------+ .. _ds_fms_comms_metrics: Comms Metrics (``0x01``) """""""""""""""""""""""" .. table:: :widths: auto +-------------------+--------+--------+---------+ | Field | Length | Type | Comment | +===================+========+========+=========+ | Lost Packets | 2 | uint16 | | +-------------------+--------+--------+---------+ | Sent Packets | 2 | uint16 | | +-------------------+--------+--------+---------+ | Average Trip Time | 1 | uint8 | | +-------------------+--------+--------+---------+ .. _ds_fms_laptop_metrics: Laptop Metrics (``0x02``) """"""""""""""""""""""""" .. table:: :widths: auto +-----------------+--------+-------+---------+ | Field | Length | Type | Comment | +=================+========+=======+=========+ | Battery Percent | 1 | uint8 | | +-----------------+--------+-------+---------+ | CPU Percent | 1 | uint8 | | +-----------------+--------+-------+---------+ .. _ds_fms_robot_radio_metrics: Robot Radio Metrics (``0x03``) """""""""""""""""""""""""""""" Decompiling the Offseason FMS code shows "Robot Radio Metrics" in the enum, and a "UDPTagBridgeWifiMetrics". Neither of which are used or handled, but I assume they are the same thing. .. table:: :widths: auto +-----------------------+--------+--------+---------+ | Field | Length | Type | Comment | +=======================+========+========+=========+ | Signal Strength | 1 | uint8 | | +-----------------------+--------+--------+---------+ | Bandwidth Utilization | 2 | uint16 | | +-----------------------+--------+--------+---------+ .. _ds_fms_pd_info: PD Info (``0x04``) """""""""""""""""" Seems to be empty for now .. table:: :widths: auto +-------+--------+------+---------+ | Field | Length | Type | Comment | +=======+========+======+=========+ | | | | | +-------+--------+------+---------+ .. _ds_fms_tcp: TCP --- Sent to `10.0.100.5` TCP port 1750. .. table:: :widths: auto +-------+--------+--------+------------------------------------+ | Field | Length | Type | Comment | +=======+========+========+====================================+ | Size | 2 | uint16 | Including ID | +-------+--------+--------+------------------------------------+ | ID | 1 | uint8 | See table below (only of Size > 0) | +-------+--------+--------+------------------------------------+ | Tags | n | | Depends on tag type | +-------+--------+--------+------------------------------------+ Tags ^^^^ .. table:: :widths: auto +----------+-----------------------------------------------------------+ | ID | Tag | +==========+===========================================================+ | ``0x00`` | :ref:`WPILib Version ` | +----------+-----------------------------------------------------------+ | ``0x01`` | :ref:`RIO Version ` | +----------+-----------------------------------------------------------+ | ``0x02`` | :ref:`DS Version ` | +----------+-----------------------------------------------------------+ | ``0x03`` | :ref:`PDP Version ` | +----------+-----------------------------------------------------------+ | ``0x04`` | :ref:`PCM Version ` | +----------+-----------------------------------------------------------+ | ``0x05`` | :ref:`CANJag Version ` | +----------+-----------------------------------------------------------+ | ``0x06`` | :ref:`CANTalon Version ` | +----------+-----------------------------------------------------------+ | ``0x07`` | :ref:`Third Party Device Version ` | +----------+-----------------------------------------------------------+ | ``0x15`` | :ref:`Usage Report ` | +----------+-----------------------------------------------------------+ | ``0x16`` | :ref:`Log Data ` | +----------+-----------------------------------------------------------+ | ``0x17`` | :ref:`Error and Event Data ` | +----------+-----------------------------------------------------------+ | ``0x18`` | :ref:`Team Number ` | +----------+-----------------------------------------------------------+ | ``0x1b`` | :ref:`Challenge Response ` | +----------+-----------------------------------------------------------+ | ``0x1d`` | :ref:`DS Ping ` | +----------+-----------------------------------------------------------+ Versions all take the same format .. _ds_fms_version: Version """"""" See above table for devices and their associated tag IDs. .. table:: :widths: auto +---------+--------+--------+-------------------------------------+ | Field | Length | Type | Comment | +=========+========+========+=====================================+ | Status | n | string | ``, ``, or `` | +---------+--------+--------+-------------------------------------+ | Version | n | string | | +---------+--------+--------+-------------------------------------+ .. _ds_fms_usage_report: Usage Report (``0x15``) """"""""""""""""""""""" .. table:: :widths: auto +----------+--------+-------------------------------------+---------+ | Field | Length | Type | Comment | +==========+========+=====================================+=========+ | Team Num | 2 | uint16 | | +----------+--------+-------------------------------------+---------+ | Unknown | 1 | uint8 | | +----------+--------+-------------------------------------+---------+ | Entries | n | :ref:`Entry Data ` | | +----------+--------+-------------------------------------+---------+ See :ref:`Usage Reporting ` for details about the Entries format. .. _ds_fms_log_data: Log Data (``0x16``) """"""""""""""""""" .. table:: :widths: auto +--------------+--------+-------------------------------------+-----------------------------------------------------------+ | Field | Length | Type | Comment | +==============+========+=====================================+===========================================================+ | Trip Time | 1 | uint8 | This is round trip time, actual trip time is half of this | +--------------+--------+-------------------------------------+-----------------------------------------------------------+ | Lost Packets | 1 | uint8 | | +--------------+--------+-------------------------------------+-----------------------------------------------------------+ | Voltage | 2 | :ref:`Battery ` | ``XXYY, XX + YY / 256`` | +--------------+--------+-------------------------------------+-----------------------------------------------------------+ | Robot Status | 1 | :ref:`Status ` | | +--------------+--------+-------------------------------------+-----------------------------------------------------------+ | CAN | 1 | uint8 | Value is halved | +--------------+--------+-------------------------------------+-----------------------------------------------------------+ | SignalDb | 1 | uint8 | Value is halved | +--------------+--------+-------------------------------------+-----------------------------------------------------------+ | Bandwidth | 2 | Bandwidth | ``round(float(uint16) / 256, 2)`` | +--------------+--------+-------------------------------------+-----------------------------------------------------------+ .. _ds_fms_robot_status: Status ...... .. table:: :widths: auto +---------------+--------------+---------+ | Field | Mask | Comment | +===============+==============+=========+ | Brownout | ``x.......`` | | +---------------+--------------+---------+ | Watchdog | ``.x......`` | | +---------------+--------------+---------+ | DS TeleOp | ``..x.....`` | | +---------------+--------------+---------+ | DS Auto | ``...x....`` | | +---------------+--------------+---------+ | DS Disable | ``....x...`` | | +---------------+--------------+---------+ | Robot TeleOp | ``.....x..`` | | +---------------+--------------+---------+ | Robot Auto | ``......x.`` | | +---------------+--------------+---------+ | Robot Disable | ``.......x`` | | +---------------+--------------+---------+ .. _ds_fms_error_and_event_data: Error and Event Data (``0x17``) """"""""""""""""""""""""""""""" .. table:: :widths: auto +---------------+--------+--------+-------------------------------------------------+ | Field | Length | Type | Comment | +===============+========+========+=================================================+ | Message Count | 4 | uint32 | Number of messages to process | +---------------+--------+--------+-------------------------------------------------+ | Timestamp | 8 | uint64 | Number of seconds since 1904/01/01 00:00:00 GMT | +---------------+--------+--------+-------------------------------------------------+ | Unknown | 8 | | ``86 48 b0 00 00 00 00 00`` | +---------------+--------+--------+-------------------------------------------------+ | Log Message | 4 + n | string | | +---------------+--------+--------+-------------------------------------------------+ .. _ds_fms_team_number: Team Number (``0x18``) """""""""""""""""""""" Sent immediately upon TCP connection. Sending this triggers a challenge response. .. table:: :widths: auto +----------+--------+--------+--------------------------------------------------------------------------------------------------+ | Field | Length | Type | Comment | +==========+========+========+==================================================================================================+ | Team Num | 2 | uint16 | Looks like it takes over the FMS's Driver Station context associated | | | | | with that team number. Would probably be bad to send another team's number from your own station | +----------+--------+--------+--------------------------------------------------------------------------------------------------+ .. _ds_fms_challenge_response: Challenge Response (``0x1b``) """"""""""""""""""""""""""""" Used to verify if the Driver Station is "official". Trivial to figure out the correct response from the off-season FMS, which isn't incredibly useful. .. table:: :widths: auto +----------+--------+--------+---------+ | Field | Length | Type | Comment | +==========+========+========+=========+ | Response | n | string | | +----------+--------+--------+---------+ As of 2017, there's 23 possible responses. These change year to year. .. table:: :widths: auto +----+----------------+ | ID | Response | +====+================+ | 0 | Johnny Five | +----+----------------+ | 1 | Data | +----+----------------+ | 2 | ED-209 | +----+----------------+ | 3 | Bishop | +----+----------------+ | 4 | NXT | +----+----------------+ | 5 | Optimus Prime | +----+----------------+ | 6 | Roomba | +----+----------------+ | 7 | Rosie | +----+----------------+ | 8 | The Terminator | +----+----------------+ | 9 | HAL 9000 | +----+----------------+ | 10 | Sojourner | +----+----------------+ | 11 | R2-D2 | +----+----------------+ | 12 | C-3PO | +----+----------------+ | 13 | Wall-E | +----+----------------+ | 14 | Curiosity | +----+----------------+ | 15 | Opportunity | +----+----------------+ | 16 | Spirit | +----+----------------+ | 17 | Cylons | +----+----------------+ | 18 | Stinky | +----+----------------+ | 19 | Iron Giant | +----+----------------+ | 20 | RCX | +----+----------------+ | 21 | EV3 | +----+----------------+ | 22 | ASIMO | +----+----------------+ The correct response uses the Random Value sent by the :ref:`Challenge Question `. ``id = ( (team number) * (random value) ) % 23`` .. _ds_fms_ds_ping: DS Ping (``0x1d``) """""""""""""""""" Just an empty tag. Sent by DS to FMS as a heartbeat. .. table:: :widths: auto +-------+--------+------+---------+ | Field | Length | Type | Comment | +=======+========+======+=========+ | | | | | +-------+--------+------+---------+