libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
Replanner.hpp
1 /*
2  * Replanner.hpp
3  * libmove3D-planners
4  *
5  * Created by Benjamin Vadant on 01/02/13.
6  * Based on Jim Mainprice replanningAlgorithms.hpp/cpp
7  * Copyright 2013 LAAS/CNRS. All rights reserved.
8  *
9  */
10 
11 #ifndef REPLANNER_HPP
12 #define REPLANNER_HPP
13 
14 #include "API/Trajectory/trajectory.hpp"
15 #include "API/ConfigSpace/configuration.hpp"
16 #include "API/Roadmap/graph.hpp"
17 
18 #include "HRI_costspace/HRICS_Navigation.hpp"
19 
20 #include "utils/ConfGenerator.h"
21 
22 #include "P3d-pkg.h"
23 #include "LightPlanner-pkg.h"
24 
25 #include <string>
26 #include <tr1/memory>
27 
29 void p3d_deactivate_all_cntrts( Robot* r );
30 
33 class Replanner
34 {
35 public:
36  Replanner(Robot* r);
37  ~Replanner();
38 
39  void setHuman(Robot* human) { this->human=human; }
40  void setSwitchData( confPtr_t qSwitch, int idSwitch, double positionSwitch, double timeLimitRePlanning, double localPathAverageLength, double initialStep );
41 
42  confPtr_t getQSwitch() { return qSwitch; }
43  confPtr_t getQGoal() { return qGoal; }
44  API::Trajectory& getCurrentTrajectory() { return currentTrajectory; }
45 
46  bool isPlanSucceeded() const { return planningSucceeded; }
47  bool isPlanningUndergo() const { return isPlanning; }
48 
49  virtual bool init() = 0;
50  virtual void run() = 0;
51 
52 protected:
53  bool initMultiLocalPath();
54  p3d_traj* concatenateToCurrentTrajectory(const std::vector<p3d_traj*>& trajs);//DEPRECATED
55  std::pair<bool,API::Trajectory> concatenateToCurrentTrajectory(const API::Trajectory& newPortion);
56  //std::pair<bool,API::Trajectory> concatenateToCurrentTrajectory(const vector<API::Trajectory> trajectories);
57 
58  Robot* robot;
59  Robot* human;
60 
61  confPtr_t qGoal;
62  API::Trajectory currentTrajectory;
63 
64 
65  bool useMultiLocalPath;
66  int baseMultiLocalPath;
67  int baseSoftMotionMultiLocalPath;
68  int headMultiLocalPath;
69  int upBodyMultiLocalPath;
70  int upBodySoftMotionMultiLocalPath;
71 
72  bool isPlanning;
73  bool planningSucceeded;
74  bool firstRun;
75  int idRun;
76 
77 
78  //Switch data
79  confPtr_t qSwitch;
80  int idSwitch;
81  double positionSwitch;
82  double timeLimitRePlanning;
83  double localPathAverageLength;
84  double initialStep;
85 };
86 
87 #endif
bool initMultiLocalPath()
Initialize the robot multilocal path disable the display of the main robot.
Definition: Replanner.cpp:79
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
Replanner(Robot *r)
Initialize replanner by setting the robot, the multi-localpaths available and calling the init functi...
Definition: Replanner.cpp:52
Definition: trajectory.hpp:40
Base replanner.
Definition: Replanner.hpp:33