I am using orocos-kdl and kdl_parser in CPP. Since, ROS is installed in my pc, I can get these files /opt/ros/indigo/lib/libkdl_parser.so and
/opt/ros/indigo/lib/liborocos-kdl.so.1.3.0. Below is the main code i.e., test.cpp-
#include
#include
#include
#include
#include
int main(int argc, char** argv)
{
std::string urdf_file = "robot.urdf";
std::string base_link = "base";
std::string tip_link = "end_effector";
KDL::Tree tree;
if (!kdl_parser::treeFromFile(urdf_file, tree)) {
printf("Failed to construct kdl tree\n");
return -1;
}
KDL::Chain chain;
if (!tree.getChain(base_link, tip_link, chain))
printf("Couldn't find chain from %s to %s\n", base_link.c_str(), tip_li