libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
HRICS_NaturalCell.hpp
1 /*
2  * HRICS_NaturalCell.h
3  * BioMove3D
4  *
5  * Created by Jim Mainprice on 27/04/10.
6  * Copyright 2010 LAAS/CNRS. All rights reserved.
7  *
8  */
9 
10 #ifndef HRICS_NATURALCELL_H_
11 #define HRICS_NATURALCELL_H_
12 
13 #include "API/planningAPI.hpp"
14 #include "Graphic-pkg.h"
15 #include "HRICS_NaturalGrid.hpp"
16 
17 namespace HRICS
18 {
20  {
21 
22  public:
23  NaturalCell();
24  NaturalCell(int i, Eigen::Vector3i pos , Eigen::Vector3d corner, NaturalGrid* grid);
25  //NaturalCell(const NaturalCell& cell);
26 
27  ~NaturalCell() { }
28 
29  double getCost();
30  double getCost(bool leftHand);
31  void setCost(double Cost) { m_Cost = Cost; }
32  void setBlankCost();
33 
34 #ifdef HRI_PLANNER
35  void computeReachability();
36 #endif
37  void resetReachable();
38  bool getIsLeftArmReachable();
39 
40  Eigen::Vector3d getWorkspacePoint();
41 
42  void setIsReachable(bool reach) { m_IsReachable = reach; }
43  void setIsReachableWithLA(bool reach) { m_IsReachWithLeftArm = reach; }
44  void setIsReachableWithRA(bool reach) { m_IsReachWithRightArm = reach; }
45 
46  bool isReachable() { return m_IsReachable; }
47  bool isReachableWithLA() { return m_IsReachWithLeftArm; }
48  bool isReachableWithRA() { return m_IsReachWithRightArm; }
49 
50  Eigen::Vector3i getCoord() { return m_Coord; }
51 
52  bool getOpen() { return m_Open; }
53  void setOpen() { m_Open = true; }
54 
55  bool getClosed() { return m_Closed; }
56  void setClosed() { m_Closed = true; }
57 
58  void setUseExternalCost(bool use) { m_use_external_cost=use; }
59  void setExternalCost(double cost) { m_external_cost=cost; }
60 
61  void resetExplorationStatus();
62 
63  void createDisplaylist();
64 
65  void draw();
66 
67  bool writeToXml(xmlNodePtr cur);
68  bool readCellFromXml(xmlNodePtr cur);
69 
70  int setRobotToStoredConfig();
71 
72  private:
73 
74  Eigen::Vector3i m_Coord;
75 
76  double* m_v0; double* m_v1; double* m_v2; double* m_v3;
77  double* m_v4; double* m_v5; double* m_v6; double* m_v7;
78 
79  bool m_Open;
80  bool m_Closed;
81 
82  bool m_IsCostComputed;
83  double m_Cost;
84 
85  bool m_IsReachable;
86  bool m_IsReachWithLeftArm;
87  bool m_IsReachWithRightArm;
88 
89  bool m_use_external_cost;
90  double m_external_cost;
91 
92  unsigned int m_NbDirections;
93 
94  std::tr1::shared_ptr<Configuration> m_QStored;
95 
96  GLint m_list;
97  };
98 }
99 
100 
101 #endif
double getCost()
compute cost depending on right/left hand
Definition: HRICS_NaturalCell.cpp:247
Definition: HRICS_NaturalCell.hpp:19
Definition: ThreeDCell.hpp:25
Definition: HRICS_NaturalGrid.hpp:22
Eigen::Vector3d getWorkspacePoint()
Get the Workspace Point transformed by the freeflyer of the human.
Definition: HRICS_NaturalCell.cpp:124