Go to the documentation of this file.00001 #include "../../include/icr.h"
00002 #include <iostream>
00003 #include <sys/time.h>
00004 #include <time.h>
00005
00006 using namespace ICR;
00007
00008 int main()
00009 {
00010
00011 ObjectLoader obj_loader;
00012 obj_loader.loadObject("../models/beer_can.obj","beer_can");
00013
00014
00015
00016 FParamList f_parameters;
00017 FingerParameters parameters;
00018 for (int i=0;i<5;i++)
00019 f_parameters.push_back(parameters);
00020 VectorXui centerpoint_ids(5);
00021 centerpoint_ids << 1838, 4526, 4362, 1083, 793;
00022
00023
00024
00025 GraspPtr prototype_grasp(new Grasp());
00026 prototype_grasp->init(f_parameters,obj_loader.getObject(),centerpoint_ids);
00027 SearchZonesPtr search_zones(new SearchZones(prototype_grasp));
00028 double alpha=0.5;
00029 search_zones->computeShiftedSearchZones(alpha);
00030
00031
00032 IndependentContactRegions icr(search_zones,prototype_grasp);
00033 icr.computeICR();
00034 std::cout<<icr;
00035
00036
00037
00038 obj_loader.loadObject("../models/cup.obj","cup");
00039
00040
00041
00042
00043 centerpoint_ids << 850, 305, 2009, 1740, 1701;
00044 f_parameters[0].setSoftFingerContact(1,6,0.5,0.5);
00045 f_parameters[1].setFrictionlessContact(1);
00046 f_parameters[2].setContactModelType(Multi_Point);
00047 f_parameters[2].setInclusionRuleFilterPatch(true);
00048
00049
00050 prototype_grasp->init(f_parameters,obj_loader.getObject(),centerpoint_ids);
00051 search_zones->computeShiftedSearchZones(alpha);
00052 icr.computeICR();
00053 std::cout<<icr;
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 return 0;
00067 }