10 #ifndef HRICS_HUMAN_CENTERED_GRID_H_
11 #define HRICS_HUMAN_CENTERED_GRID_H_
13 #include "API/Device/robot.hpp"
14 #include "API/ConfigSpace/configuration.hpp"
15 #include "API/Grids/ThreeDGrid.hpp"
17 #include "Graphic-pkg.h"
33 void setCost(
double Cost) { m_Cost = Cost; }
37 double getVisibility();
38 double getReachability();
44 void computeCombined();
46 void resetReachable();
47 bool getIsLeftArmReachable();
51 void setIsReachable(
bool reach) { m_IsReachable = reach; }
52 void setIsReachableWithLA(
bool reach) { m_IsReachWithLeftArm = reach; }
53 void setIsReachableWithRA(
bool reach) { m_IsReachWithRightArm = reach; }
55 bool isReachable() {
return m_IsReachable; }
56 bool isReachableWithLA() {
return m_IsReachWithLeftArm; }
57 bool isReachableWithRA() {
return m_IsReachWithRightArm; }
59 void resetExplorationStatus();
60 void createDisplaylist();
62 void drawOnePoint(
bool withTransform );
63 void draw(
bool transform);
64 int setRobotToStoredConfig();
66 bool writeToXml(xmlNodePtr cur);
67 bool readCellFromXml(xmlNodePtr cur);
71 Eigen::Vector3i getCoord() {
return m_Coord; }
73 bool getOpen() {
return m_Open; }
74 void setOpen() { m_Open =
true; }
76 bool getClosed() {
return m_Closed; }
77 void setClosed() { m_Closed =
true; }
83 Eigen::Vector3d m_Center;
84 Eigen::Vector3i m_Coord;
86 double* m_v0;
double* m_v1;
double* m_v2;
double* m_v3;
87 double* m_v4;
double* m_v5;
double* m_v6;
double* m_v7;
92 bool m_IsCostComputed;
96 bool m_IsReachWithLeftArm;
97 bool m_IsReachWithRightArm;
101 double m_Reachability;
104 unsigned int m_NbDirections;
106 std::tr1::shared_ptr<Configuration> m_QStored;
122 AgentGrid(
double pace, std::vector<double> envSize,
139 bool isReachable(
const Eigen::Vector3d& WSPoint);
144 std::vector<Eigen::Vector3d>
getBox();
146 void resetReachability();
147 void initReachable();
151 void computeReachability();
154 void computeRadius();
155 void computeCostCombination();
169 std::vector<AgentCell*> m_DangerCells;
170 std::vector<AgentCell*> m_VisibilityCells;
171 std::vector<AgentCell*> m_ReachableCells;
172 std::vector<AgentCell*> m_CombinedCells;
175 std::tr1::shared_ptr<Configuration> m_ActualConfig;
176 std::tr1::shared_ptr<Configuration> m_LastConfig;
177 Eigen::Affine3d m_RobotOriginPos;
Eigen::Vector3d getTranformedToRobotFrame(const Eigen::Vector3d &WSPoint)
Get the global frame points in the robot frame.
Definition: HRICS_AgentGrid.cpp:751
void computeVisibility()
Compute the visibility of the cell.
Definition: HRICS_AgentGrid.cpp:235
API::ThreeDCell * createNewCell(unsigned int index, unsigned int x, unsigned int y, unsigned int z)
Virtual function that creates a new cell.
Definition: HRICS_AgentGrid.cpp:701
void computeReachability()
Compute the cell reachbility.
Definition: HRICS_AgentGrid.cpp:246
int robotConfigInCell(int i)
get config
Definition: HRICS_AgentGrid.cpp:860
void computeCellVectors()
Compute Grid Cost.
Definition: HRICS_AgentGrid.cpp:883
Definition: HRICS_AgentGrid.hpp:23
Natural Motion and Arm Confort.
Definition: HRICS_Natural.hpp:33
std::vector< Eigen::Vector3d > getBox()
Returns the bounding box of the human grid The initial box is tranformed to the current agent positio...
Definition: HRICS_AgentGrid.cpp:760
void draw()
Draw a openGl view of the grid.
Definition: HRICS_AgentGrid.cpp:944
Definition: ThreeDGrid.hpp:24
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
double getCellCostAt(const Eigen::Vector3d &WSPoint)
Get the cell containing WSPoint and returns the cost.
Definition: HRICS_AgentGrid.cpp:819
void computeDistance()
Compute the from the cell to the human.
Definition: HRICS_AgentGrid.cpp:224
void computeAllCellCost()
Compute Grid Cost.
Definition: HRICS_AgentGrid.cpp:908
Definition: HRICS_AgentGrid.hpp:116
Definition: ThreeDCell.hpp:25
Definition: HRICS_Visibility.hpp:18
Definition: HRICS_Distance.hpp:20
Eigen::Affine3d getTransformFromRobotPos()
Get the transform matrix between the origin and the robot current position All grid points are stored...
Definition: HRICS_AgentGrid.cpp:741
void resetCellCost()
Reset Grid Cost.
Definition: HRICS_AgentGrid.cpp:837
Eigen::Vector3d getWorkspacePoint()
Get the Workspace Point transformed by the freeflyer of the human.
Definition: HRICS_AgentGrid.cpp:165
double getCost()
compute cost depending on right/left hand
Definition: HRICS_AgentGrid.cpp:141
double getCompleteCellCostAt(const Eigen::Vector3d &WSPoint, std::vector< double > &costs)
Get the cell containing WSPoint and returns the cost.
Definition: HRICS_AgentGrid.cpp:792