From 0fd63f8a45c3c30ce00742111b71e2e1ad7cdcdd Mon Sep 17 00:00:00 2001 From: magate <69254089+magate@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:08:45 -0500 Subject: [PATCH] Update code-overview-adding-a-new-log-message.rst Cast to (double) is no longer needed. https://discord.com/channels/674039678562861068/718666106625327175/1248002995761975387 --- .../code-overview-adding-a-new-log-message.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dev/source/docs/code-overview-adding-a-new-log-message.rst b/dev/source/docs/code-overview-adding-a-new-log-message.rst index 4e0ef135d6..fd850657a8 100644 --- a/dev/source/docs/code-overview-adding-a-new-log-message.rst +++ b/dev/source/docs/code-overview-adding-a-new-log-message.rst @@ -27,19 +27,18 @@ An example of the top function being used can be found in `Compass_learn.cpp `__ - the remaining arguments are the actual values that will be logged. - You may notice in the example above, some fields have a format of float ("f") but are cast to ``(double)`` this is correct and necessary to avoid a compiler warning. The 2nd Log_Write function is the same as the first except that it accepts two additional string arguments, `"units" `__ and @@ -58,7 +57,7 @@ For example, below is a "TEST" log message which outputs the current system time "FB", // mult: 1e-6, 1e-2 "Qf", // format: uint64_t, float AP_HAL::micros64(), - (double)alt_in_cm); + alt_in_cm); - the time has units of seconds ("s"), multiplier of "F" to indicate the value should be divided by 1 million and format of "Q" to indicate it is output as a 64 bit unsigned integer. - the altitude has units of meters ("m"), multiplier of "B" to indicate the value should be divided by 100 (to convert from centimeters to meters) and format of "f" because the value is a float.