AStarPlanner.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstddef>
4 
5 #include <VirtualRobot/CollisionDetection/CollisionModel.h>
6 
7 #include "Node.h"
8 #include "Planner2D.h"
10 
12 {
13 
14  /**
15  * The A* planner
16  */
17  class AStarPlanner //: public Planner2D
18  {
19  public:
20  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
21 
22  AStarPlanner(const algorithms::Costmap& costmap);
23 
24  std::vector<Eigen::Vector2f> plan(const Eigen::Vector2f& start,
25  const Eigen::Vector2f& goal) /* override */;
26 
27  private:
28  float heuristic(const NodePtr& n1, const NodePtr& n2);
29  void createUniformGrid();
30  bool fulfillsConstraints(const NodePtr& n);
31  NodePtr closestNode(const Eigen::Vector2f& v);
32 
33  float costs(const NodePtr& a, const NodePtr& b) const;
34 
35  float computeObstacleDistance(const Eigen::Vector2f& pos,
36  VirtualRobot::RobotPtr& robot) const;
37 
38  private:
39  const algorithms::Costmap costmap;
40 
41  std::vector<std::vector<NodePtr>> grid;
42 
43  const float obstacleDistanceWeightFactor = 0.5;
44 
45  const float maxObstacleDistance = 1500; // [mm]
46  };
47 } // namespace armarx::navigation::algorithm::astar
armarx::navigation::algorithm::astar::AStarPlanner::plan
std::vector< Eigen::Vector2f > plan(const Eigen::Vector2f &start, const Eigen::Vector2f &goal)
Definition: AStarPlanner.cpp:154
Costmap.h
armarx::navigation::algorithm::astar::NodePtr
std::shared_ptr< Node > NodePtr
Definition: Node.h:13
Planner2D.h
armarx::ctrlutil::a
double a(double t, double a0, double j)
Definition: CtrlUtil.h:45
armarx::navigation::algorithm::astar::AStarPlanner::AStarPlanner
EIGEN_MAKE_ALIGNED_OPERATOR_NEW AStarPlanner(const algorithms::Costmap &costmap)
Definition: AStarPlanner.cpp:47
armarx::navigation::algorithm::astar::AStarPlanner
The A* planner.
Definition: AStarPlanner.h:17
armarx::navigation::algorithm::astar
Definition: AStarPlanner.cpp:29
Node.h
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
armarx::navigation::algorithms::Costmap
Definition: Costmap.h:13
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18