libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
OtpUtils.hpp
1 #ifndef OTPUTILS_HPP
2 #define OTPUTILS_HPP
3 
4 #include "API/planningAPI.hpp"
5 
6 #include "API/Trajectory/trajectory.hpp"
7 #include "planner/planner.hpp"
8 
9 #include "utils/OtpUtils.hpp"
10 
11 #include "LightPlanner-pkg.h"
12 #include "planner/TrajectoryOptim/plannarTrajectorySmoothing.hpp"
13 
14 
15 
16 
17 #include <Eigen/Core>
18 #include <Eigen/StdVector>
19 
20 
21 
22 extern void g3d_show_tcur_both_rob(p3d_rob *robotPt, int (*fct)(p3d_rob* robot, p3d_localpath* curLp),
23  p3d_rob *hum_robotPt, int (*hum_fct)(p3d_rob* hum_robot, p3d_localpath* hum_curLp));
24 
25 extern bool detectSittingFurniture(Robot* human, double threshold, Robot** furniture);
26 
27 namespace HRICS
28 {
29 
30 
31 
32  class OutputConf
33  {
34  public:
35  std::tr1::shared_ptr<Configuration> humanConf;
36  std::vector<Eigen::Vector2d,Eigen::aligned_allocator<Eigen::Vector2d> > humanTraj;
37  bool humanTrajExist;
38 
39  std::tr1::shared_ptr<Configuration> robotConf;
40  std::vector<Eigen::Vector2d,Eigen::aligned_allocator<Eigen::Vector2d> > robotTraj;
41  bool robotTrajExist;
42 
43  double cost;
44  int configNumberInList;
45  int id;
46  bool isStandingInThisConf;
47 
48  void clearAll();
49 
50  std::tr1::shared_ptr<Configuration> chairConf;
51 // OutputConf& operator= (const OutputConf& o);
52 
53  };
54 
55  class ConfigHR
56  {
57  public:
58 
59  static int index;
60  ConfigHR() { id = index++; cost = 1.; }
61 
62  configPt getHumanConf() const { return q_hum; }
63  void setHumanConf(Robot* human, configPt q);
64 
65  configPt getRobotConf() const { return q_rob; }
66  void setRobotConf(Robot* robot, configPt q);
67 
68  int getId() const { return id; }
69  void setId(int value) { id = value; }
70 
71  double getCost() const { return cost; }
72  void setCost(double value) { cost = value; }
73 
74  private:
75  configPt q_hum;
76  configPt q_rob;
77  int id;
78  double cost;
79 
80  };
81 
86  {
87  public:
88 
89  bool operator()(ConfigHR first, ConfigHR second)
90  {
91  return ( first.getCost() < second.getCost() );
92  }
93 
94  };
95 
100  {
101  public:
102 
103  bool operator()(OutputConf first, OutputConf second)
104  {
105  return ( first.cost < second.cost );
106  }
107 
108  };
109 
110 }
111 
112 
113 #endif // OTPUTILS_HPP
Definition: OtpUtils.hpp:32
outputconf sorter
Definition: OtpUtils.hpp:99
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
Definition: OtpUtils.hpp:55
configuration cost sorter
Definition: OtpUtils.hpp:85