26 #include <type_traits> 64 AgentParam(
float sr,
float tb,
float tbo,
float r,
float reps,
float ms,
int amn) :
sightRadius(sr),
timeBoundary(tb),
timeBoundaryObst(tbo),
radius(r),
rEps(reps),
131 virtual Agent* Clone()
const = 0;
136 virtual void ComputeNewVelocity() = 0;
142 virtual void ApplyNewVelocity() = 0;
148 virtual bool UpdatePrefVelocity() = 0;
155 virtual void SetPosition(
const Point &pos);
162 virtual void AddNeighbour(
Agent &neighbour,
float distSq);
168 virtual bool isFinished();
174 virtual void SetVelocity(
const Point &vel);
192 Point GetPosition()
const;
198 Point GetVelocity()
const;
205 float GetRadius()
const;
211 Point GetNext()
const;
217 Point GetStart()
const;
223 Point GetGoal()
const;
235 std::pair<unsigned int, unsigned int> GetCollision()
const;
240 void UpdateNeighbourObst();
247 bool operator == (
const Agent &another)
const;
254 bool operator != (
const Agent &another)
const;
269 static_assert(std::is_base_of<PathPlanner, Planner>::value,
"Planner should be inheritor of PathPlanner");
270 this->planner =
new Planner(pl);
283 std::vector <std::pair<float, Agent*>> Neighbours;
284 std::vector <std::pair<float, ObstacleSegment>> NeighboursObst;
286 std::vector <Line> ORCALines;
294 float invTimeBoundaryObst;
295 float invTimeBoundary;
298 unsigned int collisions;
299 unsigned int collisionsObst;
309 #endif //ORCA_AGENT_H #define CN_DEFAULT_AGENTS_MAX_NUM
Default agent max neighbours number value.
PathPlanner class implements base pathfinder interface and behavior.
float sightRadius
Radius in which the agent takes neighbors into account.
float radius
Size of the agent (radius of the agent).
AgentParam(float sr, float tb, float tbo, float r, float reps, float ms, int amn)
AgentParam constructor with parameters.
File contains Node, Point, Line, Vertex, ObstacleSegment classes and some methods and functions imple...
float rEps
Buffer size (more about buffer see Main page).
The Point class defines a position (or euclidean vector from (0,0)) in 2D space.
float timeBoundaryObst
Time within which ORCA algorithm ensures collision avoidance with neighbor obstacles.
int agentsMaxNum
Number of neighbors, that the agent takes into account.
void SetPlanner(const Planner &pl)
Set global planner object.
#define CN_DEFAULT_REPS
Default agent buffer size value.
File contains ThetaStar class.
Class AgentParam contains agent and algoritms parameters.
#define CN_DEFAULT_RADIUS_OF_SIGHT
Default agent radius of sight value.
#define CN_DEFAULT_TIME_BOUNDARY
Default ORCA time boundary value.
File contains PathPlanner class.
Agent class implements base agent interface and behavior.
~AgentParam()=default
AgentParam default destructor.
float timeBoundary
Time within which ORCA algorithm ensures collision avoidance with neighbor agents.
#define CN_DEFAULT_MAX_SPEED
Default agent max speed value.
#define CN_DEFAULT_OBS_TIME_BOUNDARY
Default ORCA time boundary for obstacles value.
Class EnvironmentOptions contains environment and algoritms parameters.
Map class describes static environment.
float maxSpeed
Maximum speed of agent.
File contains main constants.
#define CN_DEFAULT_SIZE
Default agent size value.
#define Velocity
Velocity type definition.
AgentParam()
AgentParam default constructor.