Open mme2lr-bosch opened 6 months ago
PlotJuggler can only manage numbers that can be represented as double.
What would be the desired behavior in this case? Truncation? There is no other solution
Ok.
I think a pragmatic workaround would be to ignore the series which contain such values. This would at least allow us to visualize the rest of the bag.
that will take me considerable more time than simply remove the exception. I will do it once I have time. Feel free of course to create a PR to fix this
Ok, thanks. I assume simply removing the exception is not something you would merge to master, right?
I guess I might, since I received this complaint more time than I can count.
Problem description
When loading a bag which contains messages with INT64 fields whose values are bigger than
std::numerical_limits<double>::max
, a "Floating point truncated" execption is thrown:Steps to reproduce (important)
std::numerical_limits<double>::max
Root Cause Analysis
When loading the bag, the function member function
convert()
is called for aVariant
object which contains the too bigINT64
value in_storage.raw_data[0]
. In LOC 359, this value is converted to double using theconvert_impl
function with template argumentsSRC
equal toint64_t
andDST
asdouble
.This function is implemented in converstion_impl.hpp and checks if the conversion can be done exactly and throws a RangeException otherwise in LOC 334
Since the max value of INT64 is bigger than the max value of double, this can happen for messages with INT64 field with too big values.
Problem cannot be reproduced with dummy data
Minimal bag to reproduce problem: fake_int64_data.zip