ORCA#

#include "navground/core/behaviors/ORCA.h"
class ORCABehavior : public navground::core::Behavior#

Optimal Reciprocal Collision Avoidance (see http://gamma.cs.unc.edu/RVO2)

A wrapper of the open-source implementation from snape/RVO2

Registered properties:

State: GeometricState

Public Functions

ORCABehavior(std::shared_ptr<Kinematics> kinematics = nullptr, ng_float_t radius = 0)#

Contruct a new instance.

Parameters:
  • kinematics[in] The kinematics

  • radius[in] The radius

unsigned get_max_number_of_neighbors() const#

Gets the maximal number of neighbors.

Returns:

The maximal number of neighbors

void set_max_number_of_neighbors(unsigned value)#

Sets the maximal number of neighbors.

Parameters:

value[in] The desired value

bool get_treat_obstacles_as_agents() const#

Gets whether to treat obstacles as static, disc-shaped, [RVO] agents. Else will treat them as squared obstacles.

Returns:

True if static obstacles are passed as [RVO] neighbors.

void set_treat_obstacles_as_agents(bool value)#

Sets whether to treat obstacles as static, disc-shaped, [RVO] agents. Else will treat them as squared obstacles.

Parameters:

value[in] The desired value

ng_float_t get_time_horizon() const#

Gets the time horizon. Collisions predicted to happen after this time are ignored.

Returns:

The time horizon.

void set_time_horizon(ng_float_t value)#

Sets the time horizon. Collisions predicted to happen after this time are ignored.

Parameters:

value[in]

ng_float_t get_static_time_horizon() const#

Gets the time horizon applied to static linear obstacles. Collisions predicted to happen after this time are ignored.

Returns:

The time horizon.

void set_static_time_horizon(ng_float_t value)#

Sets the time horizon applied to static linear obstacles. Collisions predicted to happen after this time are ignored.

Parameters:

value[in]

inline bool is_using_effective_center() const#

Determines if an effective center is being used.

Using an effective center placed with an offset towards the front, allows to consider the kinematics as holonomic instead of a two-wheeled differential drive. See

J. Snape, J. van den Berg, S. J. Guy, and D. Manocha,
"Smooth and collision-free navigation for multiple robots under
differential-drive constraints," in 2010 IEEE/RSJ International
Conference on Intelligent, Robots and Systems, 2010, pp. 4584-4589.

with D=L/2.

Only possibly true if the kinematics is wheeled and constrained.

Returns:

True if using effective center, False otherwise.

inline void should_use_effective_center(bool value)#

Specifies if the kinematics should be using an shifted effective center, see set_time_horizon.

Parameters:

value[in] Whenever is should use an effective center when kinematics is wheeled and constrained.

std::vector<Line> get_lines() const#

Gets the ORCA lines computed during the last update.

Returns:

The ORCA lines.

struct Line#

A line.

Public Members

Vector2 point#

A point on the line

Vector2 direction#

The direction