LEMUR Packages: ompl_lemur or_lemur pr_bgl prpy_lemur
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Groups Pages
planner_family.h
Go to the documentation of this file.
1 
7 namespace or_lemur
8 {
9 
33 class FamilyPlanner : public OpenRAVE::PlannerBase
34 {
35 public:
36 
37  struct SetCache
38  {
39  std::string name;
40  std::string filename;
41  std::string set_header; // from start of file, opaque (passed to module)
42  std::string roadmap_header; // read from file
43  FamilyModule::SetPtr set;
44  };
45 
46  // stateful data
47  // must be consistent between calls to InitPlan()
48  // without a call to ResetFamily()
49  // things that change per-plan are:
50  // - family indicators and their costs (as current set changes)
51  // - the planner's problem definition
52  // - internal planner data (of course)
54  {
55  // the family module we're using
56  boost::weak_ptr<or_lemur::FamilyModule> mod_family;
57  // details about the robot
58  // TODO: relax same-robot requirement to family-compatibility
59  boost::weak_ptr<OpenRAVE::RobotBase> robot;
60  std::vector<int> active_dofs;
61  // caches (from params), key is filename
62  std::map<std::string, SetCache> setcaches;
63  // current set
64  FamilyModule::SetPtr set_current;
65  // current family specification (from family module)
67  std::map<or_lemur::FamilyModule::SetPtr,std::string> familyspec_names;
68  // the objects used to interface with ompl
70  boost::shared_ptr<ompl_lemur::Family> ompl_family;
71  ompl_lemur::FamilyUtilityCheckerPtr ompl_family_checker;
72  boost::shared_ptr<
74  > ompl_tag_cache;
75  boost::shared_ptr<ompl_lemur::LEMUR> ompl_lemur;
76  // roadmap header (known once planner initializes)
77  std::string roadmap_header;
78 
79  // put this here for now
80  FamilyParametersConstPtr params_last;
81  };
82  boost::shared_ptr<CurrentFamily> _current_family;
83 
84  bool _initialized;
85 
86  FamilyPlanner(OpenRAVE::EnvironmentBasePtr env);
87  ~FamilyPlanner();
88 
89  bool InitPlan(OpenRAVE::RobotBasePtr robot, std::istream & isParameters);
90  bool InitPlan(OpenRAVE::RobotBasePtr robot, OpenRAVE::PlannerBase::PlannerParametersConstPtr params);
91  OpenRAVE::PlannerBase::PlannerParametersConstPtr GetParameters() const;
92 
93  OpenRAVE::PlannerStatus PlanPath(OpenRAVE::TrajectoryBasePtr);
94 
95  bool CmdSaveSetCaches(std::ostream & sout, std::istream & sin);
96 
97  bool CmdResetFamily(std::ostream & sout, std::istream & sin);
98 
99  bool CmdGetTimes(std::ostream & sout, std::istream & sin) const;
100 };
101 
102 } // namespace or_lemur
Definition: planner_family.h:53
OpenRAVE implementation of the Family planner, which plans over the family defined by the family modu...
Definition: planner_family.h:33
Definition: planner_family.h:37
Definition: module_family.h:48