libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
HRICS_humanCostSpace.hpp
1 //
2 // HRICS_humanCostSpace.h
3 // libmove3d-motion
4 //
5 // Created by Jim Mainprice on 30/11/11.
6 // Copyright 2011 LAAS/CNRS. All rights reserved.
7 //
8 
9 #ifndef HUMAN_COSTSPACE_HPP
10 #define HUMAN_COSTSPACE_HPP
11 
12 #include "API/Device/robot.hpp"
13 #include "Grid/HRICS_AgentGrid.hpp"
14 #include "Grid/HRICS_NaturalCell.hpp"
15 #include "CostFunctions/HRICS_CF.h"
16 
20 namespace HRICS
21 {
23  {
24  public:
26  HumanCostSpace( Robot* rob, std::vector<Robot*> humans, Natural* costspace, double cellSize );
27 
29 
30  Robot* getRobot() { return m_Robot; }
31 
32  void reSetPlanningType();
33 
34  double getCost(Configuration& q);
35  double getCostMax(Configuration& q);
36  double getCompleteCost(Configuration& q, std::vector<double>& cost_sum);
37  double getPointCost(Configuration& q);
38  double computeBodiesDistanceCost(Configuration &q);
39 
40  bool getHandoverPointList(std::vector<Eigen::Vector3d>& points, bool recompute_cells, int arm_type);
41 
42  void computeAllCellCost();
43  void testCostFunction();
44 
45  void loadAgentGrids(const std::string& filename);
46  void saveAgentGrids();
47 
48  void drawDistances();
49  void drawReachableGrid();
50 
51  AgentGrid* getAgentGrid(Robot* agent);
52 
53  private:
54  bool initElementarySpaces();
55  void deleteElementarySpaces();
56 
57  bool initHumanGrids( double cellSize );
58  void deleteHumanGrids();
59 
60  bool initRobot();
61  bool initPr2();
62  bool initJustin();
63  bool initKuka();
64  bool initGreyTape();
65  bool initBallRobot();
66 
67  double groupingCost();
68 
69  Robot* m_Robot;
70  std::vector<Joint*> m_CostJoints;
71  std::vector<Robot*> m_Humans;
72  std::vector<AgentGrid*> m_Grids;
73  Joint* m_PlatformJoint;
74  std::vector< std::pair<double,NaturalCell*> > m_ReachableCells;
75 
76  enum PlanningType { NAVIGATION = 0, MANIPULATION = 1, MOBILE_MANIP = 2 } m_planning_type;
77 
78  Distance* m_DistanceSpace;
79  Visibility* m_VisibilitySpace;
80  Natural* m_ReachableSpace;
81  };
82 }
83 
84 #endif
bool getHandoverPointList(std::vector< Eigen::Vector3d > &points, bool recompute_cells, int arm_type)
Returns a vector of reachable points for object handovers the vector is sorted relativly to the HRI c...
Definition: HRICS_humanCostSpace.cpp:687
double getPointCost(Configuration &q)
Returns the HRI cost of the point that on the first joint of the configuration.
Definition: HRICS_humanCostSpace.cpp:734
Definition: HRICS_humanCostSpace.hpp:22
Natural Motion and Arm Confort.
Definition: HRICS_Natural.hpp:33
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
void testCostFunction()
This function tests how many configuration test can be done The test uses a real time chrono...
Definition: HRICS_humanCostSpace.cpp:617
This class holds a Joint and is associated with a Body (Link) It's the basic element of a kinematic c...
Definition: joint.hpp:27
Definition: HRICS_AgentGrid.hpp:116
double getCompleteCost(Configuration &q, std::vector< double > &cost_sum)
Complete cost of configuration.
Definition: HRICS_humanCostSpace.cpp:818
void computeAllCellCost()
(Re) compute the cell cost of all grids
Definition: HRICS_humanCostSpace.cpp:109
Definition: HRICS_Visibility.hpp:18
Definition: HRICS_Distance.hpp:20
Classe représentant une Configuration d'un Robot.
Definition: configuration.hpp:25
~HumanCostSpace()
Destructor of the costspace all grids are deleted.
Definition: HRICS_humanCostSpace.cpp:61
double getCost(Configuration &q)
Cost computation for a given configuration.
Definition: HRICS_humanCostSpace.cpp:754
double getCostMax(Configuration &q)
as getCost but it is maximum of joint costs instead of sum
Definition: HRICS_humanCostSpace.cpp:788