omni_planner.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef __OMNI_PLANNER__
  2. #define __OMNI_PLANNER__
  3. #include "common/common.h"
  4. #include "core/core.h"
  5. #include "space_lib/space_lib.h"
  6. namespace omni {
  7. using Index = unsigned int;
  8. const float __rlu = 0.01; // 路径分辨率
  9. class omniPlanner : public planner::Core
  10. {
  11. public:
  12. omniPlanner(/* args */)
  13. {}
  14. ~omniPlanner()
  15. {}
  16. virtual common::NavState computeVelocity(common::Point& sta_pose, common::Twist& cmd);
  17. virtual common::NavState computeVelocityCommands(common::Point& sta_pose, common::Twist& cmd);
  18. virtual common::Path interPath(float a);
  19. virtual void setPath(common::Path& path);
  20. virtual void destroy();
  21. virtual void reset();
  22. virtual void setConfig(common::Config& conf);
  23. virtual common::Config getConfig();
  24. virtual common::Path getLocalPath();
  25. virtual common::Path getGlobalPath();
  26. private:
  27. bool __isArrv(common::Point p);
  28. bool __pathCheck();
  29. float __maxmalDist(common::Path& pt1, common::Path& pt2);
  30. float __pathTangent(common::Path& path, Index i);
  31. float __c(common::Point& start, common::Point& goal);
  32. common::Path __exten(common::Path& path, Index i);
  33. common::Path __getPah(const common::Point& start, const common::Point& end, const float rlu);
  34. common::NavState __rotaTangent(common::Point& base, common::Point& tip, common::Twist& twist);
  35. common::NavState __cal(common::Point& start, common::Point& goal, common::Twist& twist, float linear);
  36. common::NavState __rotaAngle(float base, float tip, common::Twist& twist);
  37. Index __nib(common::Point& p, Index ci, common::Path& path, float range);
  38. /* data */
  39. Index i_;
  40. common::NavStep step_;
  41. protected:
  42. common::Path local_path_, path_;
  43. common::Config config_;
  44. };
  45. }
  46. #endif