ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
0

Rqt plugin C++ undefined symbol

asked 2016-04-05 09:38:32 -0500

etienne1234 gravatar image

Hi everyone, i'm having trouble in making my own rqt plugin in c++. I want to write a plugin that subscribes to /odom topic. With the odometry data, i want to draw the trajectory of the robot with Qwt. I made the code, did the catkin_make and everything worked fine. Nevertheless when I open rqt and try to launch the plugin, i get the following error :

[ERROR] [1459848732.059769566]: Failed to load nodelet [odom_plugin/OdomPlugin_1] of type [odom_plugin/OdomPlugin]: Failed to load library /local/etienne/ros/catkin_ws/devel/lib//libodom_plugin.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /local/etienne/ros/catkin_ws/devel/lib//libodom_plugin.so: undefined symbol: _ZTVN11odom_plugin10OdomPluginE)
RosPluginlibPluginProvider::load_explicit_type(odom_plugin/OdomPlugin) failed creating instance PluginManager._load_plugin() could not load plugin "odom_plugin/OdomPlugin": RosPluginlibPluginProvider.load() could not load plugin "odom_plugin/OdomPlugin"

I know this is exactly the same error, of very similar to this topic : http://answers.ros.org/question/20636... But i didn't understand how the man solved his problem.

I only have a header and source file, i give you links of the file just above :

header : http://textuploader.com/5wo0z

source : http://textuploader.com/5wo0w

plugin.xml : http://textuploader.com/5wo03

package.xml : http://textuploader.com/5wok5

CMakeLists.txt : http://textuploader.com/5wok0

I really don't know here to look, so if someone could point me on my error or give me a track it would be really nice. Thank you in advance!

edit retag flag offensive close merge delete

Comments

Suggestions: put the project on github so it is easy to download. You could fork https://github.com/lucasw/rqt_mypkg/t... and adapt your code into it. Or avoid C++ rqt entirely, draw the path and publish it as an Image and view it in rqt_image_view.

lucasw gravatar imagelucasw ( 2016-04-05 11:00:51 -0500 )edit
1

This is still experimental, but it may be a viable alternative to building your own plugin: https://github.com/ros-visualization/...

ahendrix gravatar imageahendrix ( 2016-04-05 12:36:17 -0500 )edit

Git repository for the project : https://github.com/etienne1234/odom_p...@lucasw i'm gonna try to rebuild with your template, your other option of publishing it might be interesting, but i'm gonna have to do others RQT c++ plugin so ... @ahendrix I kinda need RQT because of existing plugins

etienne1234 gravatar imageetienne1234 ( 2016-04-08 05:06:30 -0500 )edit

i'll tell you how it goes, i'm re-working on this subject today

etienne1234 gravatar imageetienne1234 ( 2016-04-08 05:06:58 -0500 )edit

@etienne1234: the package I linked to is an experimental RQT plugin which plots two different topics on the X and Y axes, much like what you're describing. Still RQT, still allows you to use the other existing RQT plugins.

ahendrix gravatar imageahendrix ( 2016-04-08 17:55:08 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-04-08 17:53:23 -0500

ahendrix gravatar image

RQT uses QT4, and you cannot mix different version of QT in the same executable. You'll need to use QT4 for your plugin.

(There has been some discussion of migrating rqt to use QT5 for the Kinetic release of ROS, but that has not been finalized).

edit flag offensive delete link more

Comments

The decision to use Qt 5 for Kinetic has been finalized about a month ago: http://lists.ros.org/pipermail/ros-us...

Dirk Thomas gravatar imageDirk Thomas ( 2016-04-12 12:26:50 -0500 )edit

That's some useful information, i'm still on ros Indigo though, so i can use only Qt4 right ? If i migrate to ros Kinetic it's Qt5 compatible now ?

etienne1234 gravatar imageetienne1234 ( 2016-04-13 04:11:48 -0500 )edit
0

answered 2016-04-08 09:47:59 -0500

etienne1234 gravatar image

updated 2016-04-13 04:13:34 -0500

I'm having segmentation fault.

I commented everything in my .cpp and just left myWidget = new QWidget() in the initPlugin(). The plugin is shown in RQT, but when i select it it says segmentation fault and crashes. If i remove this line it works (no crash/segmentation fault)

Does this mean that my Qt libraries are not linked correctly ? I'm trying to build with Qt5, so i changed the corresponding lines in the CMakeLists.txt

EDIT : i tried with Qt4 in the Cmake and there is no more segmentation fault. Could someone help me to find the equivalent commands in CMake for Qt5 if it is possible ? Now it is working with everything, but i get the following error :

/usr/bin/python: symbol lookup error: /local/etienne/ros/catkin_ws/devel/lib//libodom_plugin.so: undefined symbol: _ZN7QwtPlotC1EP7QWidget

So i guess Qwt isnt linked correctly too, i'm new to Cmake so if you could help me. Thanks

EDIT : I was linking a Qwt version manually compiled with ... Qt5 so ofc it was failing, now i'm using a Qwt version compatible with Qt4 and it's working fine.

Seems like my problem is solved, thanks for your hints!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-04-05 09:27:07 -0500

Seen: 309 times

Last updated: Apr 13 '16