irsim.lib.algorithm.rvo#

This file is the implementation of the Reciprocal Velocity Obstacle (RVO) algorithm for multi-robot collision avoidance.

Author: Ruihua Han

reference: MengGuo/RVO_Py_MAS

Classes#

reciprocal_vel_obs

A class to implement the Reciprocal Velocity Obstacle (RVO) algorithm for multi-robot collision avoidance.

Module Contents#

class irsim.lib.algorithm.rvo.reciprocal_vel_obs(state: list, obs_state_list=None, vxmax=1.5, vymax=1.5, acce=0.5, factor=1.0)[source]#

A class to implement the Reciprocal Velocity Obstacle (RVO) algorithm for multi-robot collision avoidance.

Parameters:
  • state (list) – The rvo state of the agent [x, y, vx, vy, radius, vx_des, vy_des].

  • obs_state_list (list) – List of states of static obstacles [[x, y, vx, vy, radius]].

  • vxmax (float) – Maximum velocity in the x direction.

  • vymax (float) – Maximum velocity in the y direction.

  • acce (float) – Acceleration limit.

state#
obs_state_list = None#
vxmax = 1.5#
vymax = 1.5#
acce = 0.5#
factor = 1.0#
update(state, obs_state_list)[source]#
cal_vel(mode='rvo')[source]#

Calculate the velocity of the agent based on the Reciprocal Velocity Obstacle (RVO) algorithm.

Parameters:

mode (str) – The vo configure to calculate the velocity. It can be “rvo”, “hrvo”, or “vo”. - rvo: Reciprocal Velocity Obstacle (RVO) algorithm, for multi-robot collision avoidance. - hrvo: Hybrid Reciprocal Velocity Obstacle (HRVO) algorithm, for multi-robot collision avoidance. - vo: Velocity Obstacle (VO) algorithm, for obstacle-robot collision avoidance.

config_rvo()[source]#
config_rvo_mode(obstacle)[source]#
config_hrvo()[source]#
config_hrvo_mode(obstacle)[source]#
config_vo()[source]#
config_vo_mode(obstacle)[source]#
vel_candidate(rvo_list)[source]#
vo_out(vx, vy, rvo_list)[source]#
vel_select(vo_outside, vo_inside)[source]#
penalty(vel, vel_des, factor)[source]#
static between_vector(line_left_vector, line_right_vector, line_vector)[source]#
static cross_product(vector1, vector2)[source]#