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#
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, line_obs_list=None)[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.
factor (float) β Penalty weighting factor for velocity selection.
line_obs_list (list) β List of line segments [[x1, y1, x2, y2], β¦].
- state#
- obs_state_list = None#
- line_obs_list = None#
- vxmax = 1.5#
- vymax = 1.5#
- acce = 0.5#
- factor = 1.0#
- 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.
- Returns:
Selected velocity [vx, vy].
- Return type:
list[float]