From 435c799f57ab8ee7c0a69703b373ae0f006f16b4 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Thu, 9 Mar 2023 10:54:54 -0500 Subject: [PATCH] uORB: print more decimal places for float32 and float64 --- platforms/common/uORB/uORB.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/common/uORB/uORB.cpp b/platforms/common/uORB/uORB.cpp index 7853e1cfe0..734b8d83f1 100644 --- a/platforms/common/uORB/uORB.cpp +++ b/platforms/common/uORB/uORB.cpp @@ -347,12 +347,12 @@ void orb_print_message_internal(const orb_metadata *meta, const void *data, bool data_offset += sizeof(uint64_t); } else if (strcmp(c_type, "float") == 0) { - if (!dont_print) { PX4_INFO_RAW("%.4f", (double) * (float *)(data_ptr + data_offset)); } + if (!dont_print) { PX4_INFO_RAW("%.5f", (double) * (float *)(data_ptr + data_offset)); } data_offset += sizeof(float); } else if (strcmp(c_type, "double") == 0) { - if (!dont_print) { PX4_INFO_RAW("%.4f", *(double *)(data_ptr + data_offset)); } + if (!dont_print) { PX4_INFO_RAW("%.6f", *(double *)(data_ptr + data_offset)); } data_offset += sizeof(double);