libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
navigateTo.hpp
1 #ifndef NAVIGATETO_HPP
2 #define NAVIGATETO_HPP
3 
4 #include "GTP/Tasks/privateTask.hpp"
5 #include "Planner-pkg.h"
6 
7 typedef enum {
8  ENGAGECONF,
9  DISENGAGECONF
10 } navigateToFileType;
11 
12 class NavigateTo : public PrivateTask
13 {
14  MOVE3D_STATIC_LOGGER;
15 public:
16  NavigateTo();
17 
18  bool run(std::multimap<std::string,std::string> agents_name,
19  std::multimap<std::string,std::string> objects_name,
20  std::multimap<std::string,p3d_point> point3d,
21  std::multimap<std::string,std::string> additionalData,
22  WorldState* WS, bool computeMP);
23 
24  bool initAll();
25  bool initialize();
26  bool finalize();
27  bool findCandidateSolutions();
28  bool getRandomSol();
29  bool findConfigurations();
30  bool findTrajectories();
31  bool computeSolutionTrajectories(int alternativeId);
32 // virtual bool findAlternative();
33  bool setToSolution(int solutionId, bool computeMP);
34  double computeCost(int altId);
35 // virtual vector<TaskSubSolution *> setNextTraj(TaskSubSolution* doneTSS);
36  bool setAgents(std::multimap<std::string,std::string> agents_name);
37  bool setObjects(std::multimap<std::string,std::string> objects_name);
38  bool setPoints(std::multimap<std::string,p3d_point> points);
39  bool setdata(std::multimap<std::string,std::string> additionalData);
40  void smoothSolution(int alternativeId);
41  std::string getDescr();
42  std::string getTextFromValues();
43 
44  //0 None, 1 Right, 2 left, 3, both
45  int checkHandAttachement();
46 
47  static bool compareCells (GTP2DCell* i, GTP2DCell* j);
48  static double combineCosts(double distTraveled, double angleAndRot, double distToObj);
49 
50  confPtr_t getRandomArmPosFromFileBasedOnConf(navigateToFileType fileType, confPtr_t q_tmp);
51 
52 private:
53 
54  p3d_point _targetPoint; // the point to reach (defined by either an object, an agent or a point)
55 
56  //the needed confs
57  confPtr_t _disengagedConf; // from init conf, back a little
58  confPtr_t _navigationConf; // from _disengagedConf switch to a navigation conf
59  confPtr_t _approachConf; // after navigation conf
60  confPtr_t _manipulationConf; // deploy at the same place as _approachConf in order to manipulate
61  confPtr_t _targetConf; // final configuration
62  GTP2DGrid* _grid;
63 
64  std::vector<p3d_point> _disengageTraj; //between initconf and _disengagedConf
65  p3d_traj* _squizTraj; //between _disengagedConf and _navigationConf
66  std::vector<p3d_point> _traj; //between _navigationConf and _approachConf
67  p3d_traj* _deployTraj; //between _approachConf and _manipulationConf
68  std::vector<p3d_point> _engageTraj; //between _manipulationConf and _targetConf
69 
70  double _distToDeploy;
71  double _distTodisengage;
72 
73  bool isTargetAPoint;
74  Robot* _targetObject;
75 
76  std::vector<GTP2DCell*> _reachableCells;
77 
78  unsigned int _idCurrentSol;
79 
80  bool _engage;
81  bool _disengage;
82 
83 };
84 
85 #endif // NAVIGATE_HPP
Definition: grid.hpp:81
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
Definition: grid.hpp:27
Definition: navigateTo.hpp:12
Definition: worldState.hpp:30
Definition: privateTask.hpp:6