libmove3d
3.13.0
|
00001 /* 00002 * ManipulationTestFunctions.hpp 00003 * Move3D-core 00004 * 00005 * Created by Jim Mainprice on 05/11/10. 00006 * Copyright 2010 Laas/CNRS. All rights reserved. 00007 * 00008 */ 00009 00010 #ifndef MANIPULATION_TEST_FUNCTIONS_HPP 00011 #define MANIPULATION_TEST_FUNCTIONS_HPP 00012 00013 //#include "device.h" 00014 //#include "p3d.h" 00015 00016 #include "ManipulationPlanner.hpp" 00017 00018 #include <string> 00019 00020 class ManipulationTestFunctions 00021 { 00022 00023 public: 00024 ManipulationTestFunctions(); 00025 ManipulationTestFunctions(std::string RobotNameContains); 00026 virtual ~ManipulationTestFunctions(); 00027 00028 bool runTest(int i); 00029 00030 void setDebugMode(bool value); 00031 00032 void setInitConfiguration(configPt q); 00033 void setGoalConfiguration(configPt q); 00034 00035 00036 void setObject(std::string name); 00037 void resetObject(); 00038 00039 void setPlacement(std::string name); 00040 void resetPlacement(); 00041 00042 void setSupport(std::string name); 00043 void resetSupport(); 00044 00047 void initManipulationGenom(); 00048 00050 inline ManipulationPlanner* getManipulationPlanner(){return m_manipulation;} 00051 00053 void drawEvalutedWorkspace(); 00054 00056 void saveToFileEvalutedWorkspace(); 00057 00058 bool readWorkspaceFromFile(std::string fileName); 00059 00061 bool manipTest(MANIPULATION_TASK_TYPE_STR type); 00062 00064 ManipulationPlanner* getManipPlanner() { return m_manipulation; } 00065 00066 private: 00069 bool manipTestGraspingWithDifferentObjectOrientations(bool rotate_only_around_z, double& successRate); 00070 00073 bool evaluateWorkspace(); 00074 00077 bool computeTrajectories(); 00078 00079 p3d_rob* m_Robot; 00080 00081 configPt m_qInit; 00082 configPt m_qGoal; 00083 00084 std::string m_OBJECT_NAME; 00085 std::string m_SUPPORT_NAME; 00086 std::string m_PLACEMENT_NAME; 00087 00088 std::vector<double> m_objStart, m_objGoto; 00089 00090 unsigned int m_nbOrientations; 00091 00092 std::vector< std::pair<double, std::vector<double> > > m_workspacePoints; 00093 00094 ManipulationPlanner* m_manipulation; 00095 }; 00096 00097 #endif