UnknownFreeOccupied/ufomap

Cannot build ufomap_rviz_plugins

cmakelabs opened this issue · 6 comments

Hello, I am trying to build ufomap, but I encountered the following issue:

Errors     << ufomap_rviz_plugins:make /home/nuc/ufo_ws/logs/ufomap_rviz_plugins/build.make.001.log                                        
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qnamespace.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs.h:48,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:46,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /opt/ros/noetic/include/rviz/properties/property.h:34,
                 from /opt/ros/noetic/include/rviz/properties/status_property.h:32,
                 from /opt/ros/noetic/include/rviz/display.h:38,
                 from /home/nuc/ufo_ws/src/ufomap/ufomap_ros/ufomap_rviz_plugins/include/ufomap_rviz_plugins/ufomap_display.h:56,
                 from /home/nuc/ufo_ws/src/ufomap/ufomap_ros/ufomap_rviz_plugins/src/ufomap_display.cpp:44:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h: In instantiation of ‘static typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType) [with Func1 = void (rviz::Property::*)(); Func2 = std::nullptr_t; typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1), QMetaObject::Connection>::type = QMetaObject::Connection; typename QtPrivate::FunctionPointer<Func>::Object = rviz::Property]’:
/opt/ros/noetic/include/rviz/properties/property.h:187:94:   required from ‘typename std::enable_if<(! QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction), QMetaObject::Connection>::type rviz::Property::connect(const QObject*, Func&&, Qt::ConnectionType) [with Func = std::nullptr_t; typename std::enable_if<(! QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction), QMetaObject::Connection>::type = QMetaObject::Connection]’
/opt/ros/noetic/include/rviz/properties/string_property.h:56:5:   required from ‘rviz::StringProperty::StringProperty(const QString&, const QString&, const QString&, rviz::Property*, Func&&, const R*) [with Func = std::nullptr_t; R = ufomap_ros::rviz_plugins::UFOMapDisplay]’
/home/nuc/ufo_ws/src/ufomap/ufomap_ros/ufomap_rviz_plugins/src/ufomap_display.cpp:80:88:   required from here
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:314:9: error: static assertion failed: Signal and slot arguments are not compatible.
  314 |         Q_STATIC_ASSERT_X((FunctorArgumentCount >= 0),
      |         ^~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs.h:50,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:46,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QObject:1,
                 from /opt/ros/noetic/include/rviz/properties/property.h:34,
                 from /opt/ros/noetic/include/rviz/properties/status_property.h:32,
                 from /opt/ros/noetic/include/rviz/display.h:38,
                 from /home/nuc/ufo_ws/src/ufomap/ufomap_ros/ufomap_rviz_plugins/include/ufomap_rviz_plugins/ufomap_display.h:56,
                 from /home/nuc/ufo_ws/src/ufomap/ufomap_ros/ufomap_rviz_plugins/src/ufomap_display.cpp:44:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h: In instantiation of ‘struct QtPrivate::FunctorReturnType<std::nullptr_t, QtPrivate::List<> >’:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:317:158:   required from ‘static typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType) [with Func1 = void (rviz::Property::*)(); Func2 = std::nullptr_t; typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1), QMetaObject::Connection>::type = QMetaObject::Connection; typename QtPrivate::FunctionPointer<Func>::Object = rviz::Property]’
/opt/ros/noetic/include/rviz/properties/property.h:187:94:   required from ‘typename std::enable_if<(! QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction), QMetaObject::Connection>::type rviz::Property::connect(const QObject*, Func&&, Qt::ConnectionType) [with Func = std::nullptr_t; typename std::enable_if<(! QtPrivate::FunctionPointer<Func>::IsPointerToMemberFunction), QMetaObject::Connection>::type = QMetaObject::Connection]’
/opt/ros/noetic/include/rviz/properties/string_property.h:56:5:   required from ‘rviz::StringProperty::StringProperty(const QString&, const QString&, const QString&, rviz::Property*, Func&&, const R*) [with Func = std::nullptr_t; R = ufomap_ros::rviz_plugins::UFOMapDisplay]’
/home/nuc/ufo_ws/src/ufomap/ufomap_ros/ufomap_rviz_plugins/src/ufomap_display.cpp:80:88:   required from here
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:367:52: error: request for member ‘operator()’ in ‘QtPrivate::FunctorReturnType<std::nullptr_t, QtPrivate::List<> >::dummy<std::nullptr_t>()’, which is of non-class type ‘std::nullptr_t’
  367 |         typedef decltype(dummy<Functor>().operator()((dummy<ArgList>())...)) Value;
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~^
make[2]: *** [CMakeFiles/ufomap_rviz_plugins.dir/build.make:80: CMakeFiles/ufomap_rviz_plugins.dir/src/ufomap_display.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:216: CMakeFiles/ufomap_rviz_plugins.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Everything else seems to be fine, but this issue is a bit ambiguous, may you please help overcoming it?

I have the same problem, have you solved it?

Unfortunately, not yet

Actually, I don't know what the problem is exactly, but I figured out that it might be an issue with the device. I use two other computers, both of which are pure ubuntu systems, and they can compile successfully. But only my computer doesn't work. You can try changing the device.

Thanks for informing, but there certainly should be a software solution or at least workaround, I hope the authors can suggest something in that regard, at least for me to understand what usually could cause such issues

Hello, you can replace lines 79-88 of the ufomap_display.cpp file with the following code:
resolution_property_ = new rviz::StringProperty( "Resolution", "", "Resolution of the occupancy map", info_property_); num_leaf_nodes_property_ = new rviz::StringProperty("# Leaf Nodes", "", "Number of leaf nodes in the octree", info_property_); num_inner_nodes_property_ = new rviz::StringProperty("# Inner Nodes", "", "Number of inner nodes in the octree", info_property_); size_property_ = new rviz::StringProperty("Size", "", "Size of the octree", info_property_);

Thank you, it works!