Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes subscribing to some topics #325

Closed
erichahn opened this issue Aug 19, 2020 · 6 comments
Closed

Crashes subscribing to some topics #325

erichahn opened this issue Aug 19, 2020 · 6 comments
Assignees
Labels

Comments

@erichahn
Copy link

erichahn commented Aug 19, 2020

[~]$ rosrun plotjuggler PlotJuggler
"libDataLoadCSV.so" : is a DataLoader plugin
"libDataLoadROS.so" : is a DataLoader plugin
"libDataLoadULog.so" : is a DataLoader plugin
"libDataStreamROS.so" : is a DataStreamer plugin
"libDataStreamSample.so" : is a DataStreamer plugin
"libDataStreamSample.so" ...but will be ignored unless the argument -t is used.
"libRosoutPublisher.so" : is a StatePublisher plugin
"libRosTopicPublisher.so" : is a StatePublisher plugin
terminate called after throwing an instance of 'RosIntrospection::RangeException'
what(): Floating point truncated
Stack trace (most recent call last):
#31 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa6b0ea4, in QDesktopWidget::qt_metacall(QMetaObject::Call, int, void**)
#30 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa65e631, in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&, bool)
#29 Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f20f98d98d7, in QCoreApplication::notifyInternal2(QObject*, QEvent*)
#28 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa65f65e, in QApplication::notify(QObject*, QEvent*)
#27 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa65783b, in QApplicationPrivate::notify_helper(QObject*, QEvent*)
#26 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa7da6fa, in QMenu::event(QEvent*)
#25 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa696047, in QWidget::event(QEvent*)
#24 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa7d83d2, in QMenu::mouseReleaseEvent(QMouseEvent*)
#23 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa7d75aa, in QMenu::leaveEvent(QEvent*)
#22 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa7d00fb, in QMenu::setIcon(QIcon const&)
#21 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa65380b, in QAction::activate(QAction::ActionEvent)
#20 Object "/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f20fa651121, in QAction::triggered(bool)
#19 Object "/usr/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f20f990866e, in QMetaObject::activate(QObject*, int, int, void**)
#18 Object "/opt/ros/melodic/lib/plotjuggler/PlotJuggler", at 0x5632fdb4b137, in main
#17 Object "/opt/ros/melodic/lib/plotjuggler/PlotJuggler", at 0x5632fdb4acc1, in main
#16 Object "/opt/ros/melodic/lib/plotjuggler/libDataStreamROS.so", at 0x7f20a8e875e9, in DataStreamROS::start(QStringList*)
#15 Object "/opt/ros/melodic/lib/plotjuggler/libDataStreamROS.so", at 0x7f20a8e863b2, in DataStreamROS::extractInitialSamples()
#14 Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7f20c14ac61a, in ros::CallbackQueue::callAvailable(ros::WallDuration)
#13 Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7f20c14aa8a8, in ros::CallbackQueue::callOneCB(ros::CallbackQueue::TLS*)
#12 Object "/opt/ros/melodic/lib/libroscpp.so", at 0x7f20c14fffa1, in ros::SubscriptionQueue::call()
#11 Object "/opt/ros/melodic/lib/plotjuggler/libDataStreamROS.so", at 0x7f20a8e97681, in ros::SubscriptionCallbackHelperT<boost::shared_ptr<RosIntrospection::ShapeShifter const> const&, void>::call(ros::SubscriptionCallbackHelperCallParams&)
#10 Object "/opt/ros/melodic/lib/plotjuggler/libDataStreamROS.so", at 0x7f20a8e8cce1, in boost::detail::function::void_function_obj_invoker1<boost::function<void (boost::shared_ptr<RosIntrospection::ShapeShifter const> const&)>, void, boost::shared_ptr<RosIntrospection::ShapeShifter const> >::invoke(boost::detail::function::function_buffer&, boost::shared_ptr<RosIntrospection::ShapeShifter const>)
#9 Object "/opt/ros/melodic/lib/plotjuggler/libDataStreamROS.so", at 0x7f20a8e85871, in DataStreamROS::topicCallback(boost::shared_ptr<RosIntrospection::ShapeShifter const> const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)
#8 Object "/opt/ros/melodic/lib/plotjuggler/libDataStreamROS.so", at 0x7f20a8e9dfdb, in CompositeParser::parseMessage(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, nonstd::span_lite::span<unsigned char, -1l>, double)
#7 Object "/opt/ros/melodic/lib/plotjuggler/libDataStreamROS.so", at 0x7f20a8e9e2c5, in IntrospectionParser::parseMessage(nonstd::span_lite::span<unsigned char, -1l>, double)
#6 Object "/opt/ros/melodic/lib/plotjuggler/libDataStreamROS.so", at 0x7f20a8ea1fb6, in double RosIntrospection::Variant::convert() const
#5 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7f20f9358d53, in __cxa_throw
#4 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7f20f9358b20, in std::terminate()
#3 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7f20f9358ae5, in std::rethrow_exception(std::__exception_ptr::exception_ptr)
#2 Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7f20f9352956, in
#1 Source "/build/glibc-2ORdQG/glibc-2.27/stdlib/abort.c", line 79, in __GI_abort [0x7f20f895f8b0]
#0 Source "/build/glibc-2ORdQG/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c", line 51, in __GI_raise [0x7f20f895df47]
Aborted (Signal sent by tkill() 10395 1000)
Aborted (core dumped)

using

@facontidavide
Copy link
Owner

You know I am going to ask you for a rosbag to reproduce this, don't you?

@erichahn
Copy link
Author

I do thanks to your wonderful issue templates - it has been sent to you.
When playing the bag and subscribing to it from plotjuggler the issue is present.

When attempting to load the entire bag it complains "Floating point truncated"
Older versions of plot juggler supported this bag. If I knew what version it was I would attach that here.

I am on 18.04 melodic if that makes a difference.

@facontidavide
Copy link
Owner

facontidavide commented Aug 20, 2020

Ok, mystery solved. The error is exactly what it says it is.

You are converting a very large long integer to double and there is numerical cancelation in the process.

Therefore, the value you will see in PlotJuggler WILL be slightly misleading. False data is worse than no data at all.

A simple solution would be to convert your number, currently expressed in nanoseconds, to microseconds on your side.

https://en.wikipedia.org/wiki/Double-precision_floating-point_format

This is one of the incriminated numbers:

    1597865833630083120 unsigned long

image

As long as your big number can be expressed in 52 bits (roughly 4 * 10^15), you are safe from numerical cancelation.

@facontidavide
Copy link
Owner

facontidavide commented Aug 20, 2020

Said that, I need a better message in the UI ;)

I am also reopening the issue, because it should NOT crash, but show instead an error in a dialog box.

@facontidavide facontidavide self-assigned this Aug 20, 2020
@erichahn
Copy link
Author

Right now the message type is a uint64. Looking at the ros wiki could the reason for part of the issue be the translation over to python?
http://wiki.ros.org/msg - see uint64

`

Primitive Type Serialization C++ Python2 Python3
bool (1) unsigned 8-bit int uint8_t (2) bool
int8 signed 8-bit int int8_t int
uint8 unsigned 8-bit int uint8_t int (3)
int16 signed 16-bit int int16_t int
uint16 unsigned 16-bit int uint16_t int
int32 signed 32-bit int int32_t int
uint32 unsigned 32-bit int uint32_t int
int64 signed 64-bit int int64_t long int
uint64 unsigned 64-bit int uint64_t long int
float32 32-bit IEEE float float float
float64 64-bit IEEE float double float
string ascii string (4) std::string str bytes
time secs/nsecs unsigned 32-bit ints ros::Time rospy.Time
duration secs/nsecs signed 32-bit ints ros::Duration rospy.Duration

`

@facontidavide
Copy link
Owner

Not at all. That is my code throwing an exception because I am paranoid about showing you a wrong number. As I said, if your int requires more than 52 bits, there WILL be numerical cancellation. I COULD ignore this and go on with my life, but I don’t want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants