constraints_from_yaml_example.cpp
00001 #include "constrained_ik/constrained_ik.h"
00002 #include "constrained_ik/enum_types.h"
00003 #include "example_utils.h"
00004 #include <moveit/robot_model_loader/robot_model_loader.h>
00005 
00006 using namespace constrained_ik;
00007 using namespace constrained_ik::basic_kin;
00008 using namespace Eigen;
00009 
00014 int main(int argc, char *argv[])
00015 {
00016   ros::init(argc, argv, "constraints_from_yaml_example");
00017   Constrained_IK ik;
00018   BasicKin kin;
00019   robot_model_loader::RobotModelLoaderPtr loader;
00020   planning_scene::PlanningScenePtr planning_scene;
00021 
00022   // Load example robot model
00023   planning_scene = getExampleRobotData(loader);
00024 
00025   // Initialize kinematic model
00026   kin.init(loader->getModel()->getJointModelGroup("manipulator"));
00027 
00028   // Add constraint/constraints from ros parameter server
00029   std::string param = "example_namespace/constraints";
00030   ik.addConstraintsFromParamServer(param);
00031 
00032   // Initialize Solver
00033   ik.init(kin);
00034 
00035   // Calculate IK for sample case
00036   evaluteExampleIK(kin, ik, planning_scene);
00037 
00038   return 0;
00039 }


constrained_ik
Author(s): Chris Lewis , Jeremy Zoss , Dan Solomon
autogenerated on Sat Jun 8 2019 19:23:45