ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

undefined symbol when loading custom rviz panel

asked 2018-04-27 22:06:36 -0600

TifferPelode gravatar image

updated 2018-04-27 23:18:38 -0600

jayess gravatar image

Hello everyone,

I have some question when i write a panel for Rviz, when i add a extra .h file for my project. After CATKIN_MAKE with no Error, when i add it in Rviz, it show me this :

PluginlibFactory: The plugin for class 'Tiffer' failed to load.  Error: Failed to load library /home/tiffer/tiffer-catkin/devel/lib/libtiffer_panel.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 = /home/tiffer/tiffer-catkin/devel/lib/libtiffer_panel.so: undefined symbol: _ZN12tiffer_panel18CruiseLocationTool12onInitializeEv)

But I had add it in cpp, I use Kinetic under Ubuntu 16.04.

When I remove this .h file from my project, my panel works well again. Can someone tell my what's wrong with it?

Here is my .h file:

#ifndef TIFFER_CRUISELOCATION_H
#define TIFFER_CRUISELOCATION_H

#ifndef Q_MOC_RUN

#include <ros/ros.h>
#include "rviz/default_plugin/tools/pose_tool.h"

#endif

#include <QObject>
#include <QInputDialog>

using namespace rviz;

namespace tiffer_panel
{
    class Arrow;
    class DisplayContext;
    class StringProperty;

    class CruiseLocationTool : public PoseTool
    {
        Q_OBJECT
        public:
            CruiseLocationTool();
            virtual void onInitialize();

        protected:
            virtual void onPoseSet(double x, double y, double theta);

        private Q_SLOTS:
            void updateTopic();

        private:
            ros::NodeHandle nh_;
            ros::Publisher pub_;
    };    
}
#endif
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-04-27 22:13:04 -0600

William gravatar image

This is the error:

Poco exception = /home/tiffer/tiffer-catkin/devel/lib/libtiffer_panel.so: undefined symbol: _ZN12tiffer_panel18CruiseLocationTool12onInitializeEv

It looks like you declare onInitialize() but never define it.

edit flag offensive delete link more

Comments

Thanks, I have solve it

TifferPelode gravatar image TifferPelode  ( 2018-04-27 23:00:40 -0600 )edit

Had a similar issue and solved with the same solution!

Wilkson gravatar image Wilkson  ( 2020-04-15 14:32:36 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-04-27 22:06:36 -0600

Seen: 885 times

Last updated: Apr 27 '18