libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
HRICS_ConfigSpace.hpp
1 #ifndef HRICS_CSPACE_HPP
2 #define HRICS_CSPACE_HPP
3 
4 #include "API/planningAPI.hpp"
5 #include "planner/planner.hpp"
6 
7 #include "HRICS_Workspace.hpp"
8 
9 #include "Grid/HRICS_Grid.hpp"
10 #include "Grid/HRICS_TwoDGrid.hpp"
11 
12 
13 #include <Eigen/StdVector>
14 
22 namespace HRICS
23 {
28  {
29  public:
30  ConfigSpace();
31  ConfigSpace(Robot* R, Robot* H);
32 
33  ~ConfigSpace();
34 
38  double getConfigCost();
39 
43  double getDistanceCost();
44  double getVisibilityCost(const Eigen::Vector3d& WSPoint)
45  {
46  return m_VisibilitySpace->getWorkspaceCost(WSPoint);
47  }
48 
49  void computeVisibilityGrid();
50  void computeDistanceGrid();
51 
52 
53  Grid* getGrid() { return m3DGrid; }
54  PlanGrid* getPlanGrid() { return m2DGrid; }
55  std::vector<API::TwoDCell*> getCellPath() { return m2DCellPath; }
56 
57  double getLastDistanceCost() {return mDistCost; }
58  double getLastVisibiliCost() {return mVisiCost; }
59 
60  bool computeAStarIn2DGrid();
61  void solveAStar(PlanState* start,PlanState* goal);
62  void draw2dPath();
63  double pathCost();
64 
65 // bool runHriRRT();
66  bool initHriRRT();
67 
68  private:
69  void initCostSpace();
70 
71  // Robot* mRobot;
72  Robot* mHuman;
73 
74  Grid* m3DGrid;
75 
76  PlanGrid* m2DGrid;
77  std::vector<Eigen::Vector2d,Eigen::aligned_allocator<Eigen::Vector2d> > m2DPath;
78  std::vector<API::TwoDCell*> m2DCellPath;
79 
80  int mIndexObjectDof;
81 
82  Eigen::Vector3d mVisibilityPoint;
83 
84  double mDistCost;
85  double mVisiCost;
86 
87  bool mPathExist;
88 
89  std::vector<double> mEnvSize;
90  };
91 }
92 
93 #endif // HRICS_ConfigSpace_HPP
bool initHriRRT()
Runs a HRI RRT.
Definition: HRICS_ConfigSpace.cpp:336
double getConfigCost()
General config cost.
Definition: HRICS_ConfigSpace.cpp:115
void solveAStar(PlanState *start, PlanState *goal)
Solve A Star in a 2D grid using the API A Star on takes as input A* States.
Definition: HRICS_ConfigSpace.cpp:247
double getDistanceCost()
Elemetary cost functions.
Definition: HRICS_ConfigSpace.cpp:150
Definition: HRICS_Grid.hpp:16
Plannar HRI State.
Definition: HRICS_TwoDGrid.hpp:77
bool computeAStarIn2DGrid()
Takes the robot initial config and calls the solve A* to compute the 2D path.
Definition: HRICS_ConfigSpace.cpp:162
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
double getWorkspaceCost(const Eigen::Vector3d &WSPoint)
Gets the Visibiliy cost (distance to gaze direction) of a Workspace point.
Definition: HRICS_Visibility.cpp:66
Configuration space.
Definition: HRICS_ConfigSpace.hpp:27
void draw2dPath()
Draws the 3D path as a yellow line.
Definition: HRICS_ConfigSpace.cpp:306
Plannar HRI Grid.
Definition: HRICS_TwoDGrid.hpp:13
Base class for the HRICS motion planners.
Definition: HRICS_Workspace.hpp:37
ConfigSpace()
Reads the ENV structure and gets the Humans and the Robots named respectivly HUMAN and ROBOT and perf...
Definition: HRICS_ConfigSpace.cpp:37