Using moveit kinematics plugin without moveit (undefined symbol for urdf)
I have IKFast MoveIt kinematics plugin created according to this tutorial. It works fine within MoveIt framework, however I would like to use it as a separate kinematics solver with service/topic interface.
So I wrote a small wrapper that loads plugin with pluginlib
(based on tutorial).
However I am getting runtime error:
lwa_ikfast_wrapper_node: symbol lookup error: liblwa_moveit_arm_kinematics.so: undefined symbol: _ZN4urdf5Model10initStringERKSs
Demangled symbol is:
urdf::Model::initString(std::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&)
This function is called within plugin's KinematicBase::initialize()
method.
Obviously that happens because urdf
libraries are not linked to plugin at compile time. Thus, they have to be linked to node executable somehow. But that only happens if there is an explicit call to model::initString()
in my node.
I tried to add all sort of dependencies to CMakeLists.txt
and package.xml
, but can't get rid of the problem.
The relevant files (stripped versions):
EDIT:
When model::initString()
is called explicitly, ldd
reports the following urdf
libraries for executable:
liburdf.so => /opt/ros/groovy/lib/liburdf.so (0x00007fe421056000)
liburdfdom_model.so => /opt/ros/groovy/lib/liburdfdom_model.so (0x00007fe41e9f0000)
However adding these to dependencies doesn't solve the problem.
Any ideas?
P.S. It is maybe more of general programming question, but I think it might be interesting to the community in the context.
Thanks,
Boris