Human-Like#

#include "navground/core/behaviors/HL.h"
class HLBehavior : public navground::core::Behavior#

Human-like obstacle avoidance behavior.

The behavior inspired by how pedestrian move, has been originally presented in

Guzzi, J.; Giusti, A.; Gambardella, L.M.; Theraulaz, G.; Di Caro, G.A.,
"Human-friendly robot navigation in dynamic environments,"
Robotics and Automation (ICRA), 2013 IEEE International Conference on,
vol., no., pp.423,430, 6-10 May 2013

Registered properties:

State: GeometricState

Public Functions

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

Contruct a new instance.

Parameters:
  • kinematics[in] The kinematics

  • radius[in] The radius

inline ng_float_t get_eta() const#

Gets the time \(\eta\) that the behavior keeps away from collisions. Higher values lead to slower speeds.

Returns:

\(\eta\)

inline void set_eta(ng_float_t value)#

Sets the time \(\eta\) that the behavior keeps away from collisions. Higher values lead to slower speeds.

Parameters:

value[in] A strict positive value.

inline ng_float_t get_tau() const#

Gets the relaxation time \(\tau\). Higher values lead to lower accelerations.

Returns:

\(\eta\)

inline void set_tau(ng_float_t value)#

Sets the relaxation time \(\tau\). Higher values lead to lower accelerations.

Parameters:

value[in] A positive value. If zero, relaxation is disabled.

inline Radians get_aperture() const#

Gets the aperture \(\alpha\): desired velocity is searched on a circular sector \([-\alpha, \alpha]\).

Returns:

The positive \(\alpha\) in radians.

inline void set_aperture(Radians value)#

Sets the aperture, see get_aperture.

Parameters:

value[in] A positive value

inline unsigned get_resolution() const#

Gets the number of subdivision of \([-\alpha, \alpha]\) to search for optimal directions.

Returns:

The resolution.

inline void set_resolution(unsigned value)#

Sets the number of subdivision of \([-\alpha, \alpha]\) to search for optimal directions.

Parameters:

value[in] A strict positive value. The larger the value, the more precise the motion but also the more expensive the computations.

inline Radians get_angular_resolution() const#

Convenience method that return the size of an angular segment in \([-\alpha, \alpha]\) to search for optimal directions.

Returns:

The angular resolution for the optimal direction search in radians.

inline ng_float_t get_epsilon() const#

Gets the lowest margin to an obstacle or neighbor.

Any obstacles nearer than this this value will be virtually pushing away from the agent.

Returns:

Epsilon.

inline void set_epsilon(ng_float_t value)#

Sets the lowest margin to an obstacle or neighbor.

Any obstacles nearer than this this value will be virtually pushing away from the agent.

Parameters:

value[in] Zero or negative values disable virtually pushing away obstacles.

inline ng_float_t get_barrier_angle() const#

Gets the barrier angle, i.e., the minimal angle with respect to a currently virtually colliding obstacle to ignore it.

Returns:

Epsilon.

inline void set_barrier_angle(ng_float_t value)#

Sets the barrier angle, i.e., the minimal angle with respect to a currently virtually colliding obstacle to ignore it.

Parameters:

value[in] A positive value. Higher values makes the agent more cautious.

std::valarray<ng_float_t> get_collision_distance(bool assuming_static = false, std::optional<ng_float_t> speed = std::nullopt)#

Gets the free distance to collision in \([-\alpha, \alpha]\) at regular intervals.

Parameters:
  • assuming_static[in] If True, all obstacles are assumed static.

  • speed[in] The desired speed. Will be set to the last used target speed if not specified.

Returns:

A vector of distances of size get_resolution. Angles are in the agent frame.

std::valarray<ng_float_t> get_collision_angles() const#

Gets the angles in \([-\alpha, \alpha]\) at regular intervals used for collision checking.

Returns:

A vector of angles in the fixed frame of size get_resolution.

Public Static Attributes

static ng_float_t default_eta = static_cast<ng_float_t>(0.5)#

Default \(\eta\)

static ng_float_t default_tau = static_cast<ng_float_t>(0.125)#

Default \(\tau\)

static ng_float_t default_aperture = static_cast<ng_float_t>(PI)#

Default aperture (full circular sector)

static unsigned max_resolution = 361#

Maximal resolution

static unsigned default_resolution = 101#

Default resolution. Should be less than max_resolution

static ng_float_t default_epsilon = 0#

Default epsilon.

static ng_float_t default_barrier_angle = static_cast<ng_float_t>(HALF_PI)#

Default barrier angle.