Logging ======= The Driver Station saves 2 types of log files to disk (in ``C:\Users\Public\Documents\FRC\Log Files``) for later viewing. A ``.dslog`` and a ``.dsevents``. The log populates the list with any file ending with ``.dslog``, but the Driver Station helpfully names them with the current date and time. (e.g. ``2018_04_22 23_39_25 Sun.dslog``) .. _logging_dslog: ``.dslog`` ---------- Stored in Big Endian .. table:: :widths: auto +---------+--------+--------------------------------+--------------------+ | Field | Length | Type | Comments | +=========+========+================================+====================+ | Header | 20 | :ref:`Header ` | | +---------+--------+--------------------------------+--------------------+ | Entries | n | :ref:`Entry ` | Array of n entries | +---------+--------+--------------------------------+--------------------+ .. _logging_header: Header ^^^^^^ .. table:: :widths: auto +---------------------+--------+--------+-------------------------------------------------+ | Field | Length | Type | Comments | +=====================+========+========+=================================================+ | Version | 4 | uint32 | | +---------------------+--------+--------+-------------------------------------------------+ | Unknown | 4 | | | +---------------------+--------+--------+-------------------------------------------------+ | Timestamp | 4 | uint32 | Seconds since 1904/1/1 | +---------------------+--------+--------+-------------------------------------------------+ | Fractional Seconds? | 1 | uint8 | Divide by 256 to get decimal part of timestamp? | +---------------------+--------+--------+-------------------------------------------------+ | Unknown | 7 | | | +---------------------+--------+--------+-------------------------------------------------+ .. _logging_entry: Entry ^^^^^ .. table:: :widths: auto +---------------+--------+------------------------------+---------------+ | Field | Length | Type | Comments | +===============+========+==============================+===============+ | Trip Time | 1 | uint8 | `x / 15 = ms` | +---------------+--------+------------------------------+---------------+ | Packet Loss % | 1 | uint8 | `x * 4` | +---------------+--------+------------------------------+---------------+ | Battery | 2 | Battery | `xx + yy/256` | +---------------+--------+------------------------------+---------------+ | RoboRIO CPU % | 1 | uint8 | `x / 2` | +---------------+--------+------------------------------+---------------+ | Trace | 1 | :ref:`Trace ` | | +---------------+--------+------------------------------+---------------+ | CAN Percent | 1 | uint8 | `x / 2` | +---------------+--------+------------------------------+---------------+ | Wifi dB | 1 | uint8 | `x / 2` | +---------------+--------+------------------------------+---------------+ | Wifi Mb | 1 | uint8 | | +---------------+--------+------------------------------+---------------+ | Unknown | 2 | | | +---------------+--------+------------------------------+---------------+ | PDP Stats | 21 | :ref:`PDP ` | | +---------------+--------+------------------------------+---------------+ | Unknown | 3 | | | +---------------+--------+------------------------------+---------------+ .. _logging_trace: Trace ^^^^^ .. table:: :widths: auto +----------------+--------------+---------+ | Field | Mask | Comment | +================+==============+=========+ | Brownout | ``x.......`` | | +----------------+--------------+---------+ | Watchdog | ``.x......`` | | +----------------+--------------+---------+ | DS Teleop | ``..x.....`` | | +----------------+--------------+---------+ | Unused | ``...x....`` | | +----------------+--------------+---------+ | DS Disabled | ``....x...`` | | +----------------+--------------+---------+ | Robot Teleop | ``.....x..`` | | +----------------+--------------+---------+ | Robot Auton | ``......x.`` | | +----------------+--------------+---------+ | Robot Disabled | ``.......x`` | | +----------------+--------------+---------+ .. _logging_pdp: PDP ^^^ Current for each PDP port is stored as 10 bits, (mostly) packed together. 0-5 are packed and padded into the first 64 bits, 6-11 are packed and padded into the next 64 bits, 12-15 are packed into the next 40 bits. Each of the 10 bit numbers is the current of the port * 8. .. table:: :widths: auto +--------------------+--------------------------+-------------+ | Ports | Bits | Total Bytes | +====================+==========================+=============+ | 0, 1, 2, 3, 4, 5 | 60 bits + 4 padding | 8 bytes | +--------------------+--------------------------+-------------+ | 6, 7, 8, 9, 10, 11 | 60 bits + 4 bits padding | 8 bytes | +--------------------+--------------------------+-------------+ | 12, 13, 14, 15 | 40 bits | 5 bytes | +--------------------+--------------------------+-------------+ .. _logging_dsevent: ``.dsevent`` ------------ TODO