77 const Eigen::Vector2f &end,
float safety_margin,
79 Eigen::Vector2f &out_closest)
const;
94 const Eigen::Vector2f &target_pos,
95 float safety_margin,
float clearance,
96 float robot_heading_rad,
97 int recursion_depth = 0)
const;
112 const Eigen::Vector2f &target_pos,
114 float influence_radius,
115 float robot_heading_rad)
const;
118 std::vector<Obstacle> obstacles;
119 float robot_width = 18.0f;
120 float robot_length = 18.0f;
Manages a collection of obstacles and provides avoidance computations.
void clearObstacles()
Clear all tracked obstacles.
bool checkIntersection(const Eigen::Vector2f &start, const Eigen::Vector2f &end, float safety_margin, Obstacle &out_obstacle, Eigen::Vector2f &out_closest) const
Check if a path segment intersects with any obstacle.
const std::vector< Obstacle > & getObstacles() const
Get the list of currently tracked obstacles.
void addObstacle(float x, float y, float radius)
Add a circular obstacle to the field representation.
ObstacleManager()=default
Default constructor for ObstacleManager.
void removeObstacle(size_t index)
Remove an obstacle by its index.
void setRobotDimensions(float width, float length)
Set the dimensions of the robot to define its bounding box for collisions.
Eigen::Vector2f getAvoidanceTarget(const Eigen::Vector2f &robot_pos, const Eigen::Vector2f &target_pos, float safety_margin, float clearance, float robot_heading_rad, int recursion_depth=0) const
Calculate a target vector that avoids collisions while navigating towards a goal.
Eigen::Vector2f getPotentialFieldTarget(const Eigen::Vector2f &robot_pos, const Eigen::Vector2f &target_pos, float ka, float kr, float influence_radius, float robot_heading_rad) const
Get an artificial potential field target vector.
Represents a physical obstacle on the field.
Eigen::Vector2f position
2D coordinate position of the obstacle
float radius
Radius of the obstacle used for avoidance.