TAMS-Group/bio_ik

Issue when following tutorial

mohammad200h opened this issue · 2 comments

Hi

I am following the tutorial on read me and at the same time adapting it for use with iiwa and shadow hand.
I get an error at bio_ik::BioIKKinematicsQueryOptions ik_options;

the error is :
CMakeFiles/bioik_moveit_iiwa.dir/src/bioik_moveit_iiwa.cpp.o: In function main': bioik_moveit_iiwa.cpp:(.text+0x70c): undefined reference to bio_ik::BioIKKinematicsQueryOptions::BioIKKinematicsQueryOptions()'
bioik_moveit_iiwa.cpp:(.text+0x95f): undefined reference to bio_ik::BioIKKinematicsQueryOptions::~BioIKKinematicsQueryOptions()' bioik_moveit_iiwa.cpp:(.text+0xb89): undefined reference to bio_ik::BioIKKinematicsQueryOptions::~BioIKKinematicsQueryOptions()'
collect2: error: ld returned 1 exit status

My code is:`#include

#include <ros/ros.h>
#include <bio_ik/bio_ik.h>

#include <gazebo_ros/PhysicsConfig.h>

#include <moveit/robot_model_loader/robot_model_loader.h>
#include <moveit/kinematics_base/kinematics_base.h>
#include <moveit/robot_state/robot_state.h>

int main(int argc, char** argv)
{

ros::init (argc, argv, "bioik_moveit_iiwa");
ros::AsyncSpinner spinner(1);
spinner.start();
ros::NodeHandle node_handle;

robot_model_loader::RobotModelLoader robot_model_loader("robot_description");

auto robot_model = robot_model_loader.getModel();
//first finger ff
auto ff_joint_model_group = robot_model->getJointModelGroup("first_finger");
auto ff_tip_names = ff_joint_model_group->getSolverInstance()->getTipFrames();
std::cout <<"The links are: "<<ff_tip_names[0]<<"\n";

//middle finger mf
auto mf_joint_model_group = robot_model->getJointModelGroup("middel_finger");
auto mf_tip_names = mf_joint_model_group->getSolverInstance()->getTipFrames();
std::cout <<"The links are: "<<mf_tip_names[0]<<"\n";

//iiwa
auto iiwa_joint_model_group = robot_model->getJointModelGroup("iwaa");
auto iiwa_tip_names = iiwa_joint_model_group->getSolverInstance()->getTipFrames();
std::cout <<"The links are: "<<iiwa_tip_names[0]<<"\n";

bio_ik::BioIKKinematicsQueryOptions ik_options;
ik_options.replace = true;
ik_options.return_approximate_solution = true;

auto* ff_goal = new bio_ik::PoseGoal();
auto* mf_goal = new bio_ik::PoseGoal();
auto* iiwa_goal = new bio_ik::PoseGoal();

ff_goal->setLinkName(ff_tip_names[0]);
mf_goal->setLinkName(mf_tip_names[0]);
iiwa_goal->setLinkName(iiwa_tip_names[0]);

ik_options.goals.emplace_back(ff_goal);
ik_options.goals.emplace_back(mf_goal);
ik_options.goals.emplace_back(iiwa_goal);

robot_state::RobotState robot_state_ik(robot_model);

bool ok = robot_state_ik.setFromIK(
          ff_joint_model_group, // joints to be used for IK
          EigenSTL::vector_Affine3d(),    // multiple end-effector goal poses
          std::vector<std::string>(),         // names of the end-effector links
          3, 0.005, // solver attempts and timeout
          moveit::core::GroupStateValidityCallbackFn(),
          ik_options               // mostly empty
        );

return 0;
}
`

could you please help me with this?
thanks

Thank you!