CTRE Phoenix 6 C++ 24.3.0
|
Static class for controlling the Phoenix 6 signal logger. More...
#include <ctre/phoenix6/SignalLogger.hpp>
Static Public Member Functions | |
static ctre::phoenix::StatusCode | SetPath (const char *path) |
Sets the destination for logging, restarting logger if the path changed. More... | |
static ctre::phoenix::StatusCode | Start () |
Starts logging status signals. More... | |
static ctre::phoenix::StatusCode | Stop () |
Stops logging status signals. More... | |
static ctre::phoenix::StatusCode | EnableAutoLogging (bool enable) |
Enables or disables auto logging. More... | |
static ctre::phoenix::StatusCode | WriteRaw (std::string_view name, uint8_t const *data, uint8_t size, units::time::second_t latencySeconds=0_s) |
Writes the raw data bytes to the log file. More... | |
static ctre::phoenix::StatusCode | WriteBoolean (std::string_view name, bool value, units::time::second_t latencySeconds=0_s) |
Writes the boolean to the log file. More... | |
static ctre::phoenix::StatusCode | WriteInteger (std::string_view name, int64_t value, std::string_view units="", units::time::second_t latencySeconds=0_s) |
Writes the integer to the log file. More... | |
static ctre::phoenix::StatusCode | WriteFloat (std::string_view name, float value, std::string_view units="", units::time::second_t latencySeconds=0_s) |
Writes the float to the log file. More... | |
static ctre::phoenix::StatusCode | WriteDouble (std::string_view name, double value, std::string_view units="", units::time::second_t latencySeconds=0_s) |
Writes the double to the log file. More... | |
static ctre::phoenix::StatusCode | WriteString (std::string_view name, std::string_view value, units::time::second_t latencySeconds=0_s) |
Writes the string to the log file. More... | |
template<typename U , typename = std::enable_if_t<units::traits::is_unit_t_v<U>>> | |
static ctre::phoenix::StatusCode | WriteValue (std::string_view name, U value, units::time::second_t latencySeconds=0_s) |
Writes the unit value to the log file. More... | |
template<size_t N, typename = std::enable_if_t<(N <= 64U)>> | |
static ctre::phoenix::StatusCode | WriteBooleanArray (std::string_view name, std::array< bool, N > const &values, units::time::second_t latencySeconds=0_s) |
Writes the array of booleans to the log file. More... | |
template<size_t N, typename = std::enable_if_t<(N <= 64U)>> | |
static ctre::phoenix::StatusCode | WriteBooleanArray (std::string_view name, std::array< uint8_t, N > const &values, units::time::second_t latencySeconds=0_s) |
Writes the array of booleans to the log file. More... | |
static ctre::phoenix::StatusCode | WriteBooleanArray (std::string_view name, std::vector< uint8_t > const &values, units::time::second_t latencySeconds=0_s) |
Writes the array of booleans to the log file. More... | |
template<size_t N, typename = std::enable_if_t<(N <= 8U)>> | |
static ctre::phoenix::StatusCode | WriteIntegerArray (std::string_view name, std::array< int64_t, N > const &values, std::string_view units="", units::time::second_t latencySeconds=0_s) |
Writes the array of integers to the log file. More... | |
static ctre::phoenix::StatusCode | WriteIntegerArray (std::string_view name, std::vector< int64_t > const &values, std::string_view units="", units::time::second_t latencySeconds=0_s) |
Writes the array of integers to the log file. More... | |
template<size_t N, typename = std::enable_if_t<(N <= 16U)>> | |
static ctre::phoenix::StatusCode | WriteFloatArray (std::string_view name, std::array< float, N > const &values, std::string_view units="", units::time::second_t latencySeconds=0_s) |
Writes the array of floats to the log file. More... | |
static ctre::phoenix::StatusCode | WriteFloatArray (std::string_view name, std::vector< float > const &values, std::string_view units="", units::time::second_t latencySeconds=0_s) |
Writes the array of floats to the log file. More... | |
template<size_t N, typename = std::enable_if_t<(N <= 8U)>> | |
static ctre::phoenix::StatusCode | WriteDoubleArray (std::string_view name, std::array< double, N > const &values, std::string_view units="", units::time::second_t latencySeconds=0_s) |
Writes the array of doubles to the log file. More... | |
static ctre::phoenix::StatusCode | WriteDoubleArray (std::string_view name, std::vector< double > const &values, std::string_view units="", units::time::second_t latencySeconds=0_s) |
Writes the array of doubles to the log file. More... | |
Static class for controlling the Phoenix 6 signal logger.
This logs all the signals from the CAN buses into .hoot files. Each file name starts with the CANivore serial number or "rio" for the roboRIO CAN bus, followed by the timestamp. In the header of a hoot file, the CANivore name and firmware version are logged in plain text.
During an FRC match, the log file will be renamed to include the event name, match type, and match number at the start of the file name. The match type will be 'P' for practice matches, 'Q' for qualification matches, and 'E' for elimination matches.
|
static |
Enables or disables auto logging.
Auto logging is only supported on the roboRIO. When auto logging is enabled, logging is started at the beginning of an FRC match and stopped at the end.
enable | Whether to enable auto logging |
|
static |
Sets the destination for logging, restarting logger if the path changed.
If this is not called or the path is left empty, the default path will be used. The default path on the roboRIO is a logs folder on the first USB flash drive found, or /home/lvuser/logs if none is available. The default path on all other platforms is a logs folder in the current working directory.
Typical use for this routine is to use a removable USB flash drive for logging.
path | Folder path for the log files; path must exist |
|
static |
Starts logging status signals.
Starts regardless of auto logging status.
If using a roboRIO 1, we recommend setting the logging path to an external drive using SetPath to avoid running out of internal storage space.
If auto logging is enabled, the log will be stopped at the end of the match.
|
static |
Stops logging status signals.
Stops regardless of auto logging status.
|
inlinestatic |
Writes the boolean to the log file.
name | Name of the signal |
value | Value to write |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the array of booleans to the log file.
The array cannot exceed 64 elements.
name | Name of the signal |
values | Array of values to write |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the array of booleans to the log file.
The array cannot exceed 64 elements.
name | Name of the signal |
values | Array of values to write, passed as an array of bytes |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the array of booleans to the log file.
The array cannot exceed 64 elements.
name | Name of the signal |
values | Vector of values to write; since vector<bool> is not a boolean array, this is passed as a vector<uint8_t> instead |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the double to the log file.
name | Name of the signal |
value | Value to write |
units | Units of the signal |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the array of doubles to the log file.
The array cannot exceed 8 elements.
name | Name of the signal |
values | Array of values to write |
units | Units of the signals |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the array of doubles to the log file.
The array cannot exceed 8 elements.
name | Name of the signal |
values | Vector of values to write |
units | Units of the signals |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the float to the log file.
name | Name of the signal |
value | Value to write |
units | Units of the signal |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the array of floats to the log file.
The array cannot exceed 16 elements.
name | Name of the signal |
values | Array of values to write |
units | Units of the signals |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the array of floats to the log file.
The array cannot exceed 16 elements.
name | Name of the signal |
values | Vector of values to write |
units | Units of the signals |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the integer to the log file.
name | Name of the signal |
value | Value to write |
units | Units of the signal |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the array of integers to the log file.
The array cannot exceed 8 elements.
name | Name of the signal |
values | Array of values to write |
units | Units of the signals |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the array of integers to the log file.
The array cannot exceed 8 elements.
name | Name of the signal |
values | Vector of values to write |
units | Units of the signals |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the raw data bytes to the log file.
The data cannot exceed 64 bytes.
name | Name of the signal |
data | Raw data bytes |
size | Size of the raw data (in bytes) |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the string to the log file.
The string cannot exceed 64 characters.
name | Name of the signal |
value | Value to write |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |
|
inlinestatic |
Writes the unit value to the log file.
name | Name of the signal |
value | Value to write |
latencySeconds | Latency of the signal in seconds; this value is subtracted from the current time to get the timestamp written to the log |