irsim.lib.behavior.behavior_methods#
Functions#
|
Behavior function for differential drive robot using RVO (Reciprocal Velocity Obstacles). |
|
Behavior function for differential drive robot using dash-to-goal behavior. |
|
Behavior function for omnidirectional robot using dash-to-goal behavior. |
|
Behavior function for omnidirectional robot using RVO (Reciprocal Velocity Obstacles). |
|
Behavior function for Ackermann steering robot using dash-to-goal behavior. |
|
Calculate the omnidirectional velocity using RVO. |
|
Calculate the differential drive velocity using RVO. |
|
Calculate the omnidirectional velocity to reach a goal. |
|
Calculate the differential drive velocity to reach a goal. |
|
Calculate the Ackermann steering velocity to reach a goal. |
Module Contents#
- irsim.lib.behavior.behavior_methods.beh_diff_rvo(ego_object: Any, external_objects: list[Any], **kwargs: Any) numpy.ndarray[source]#
Behavior function for differential drive robot using RVO (Reciprocal Velocity Obstacles).
- Parameters:
ego_object – The ego robot object.
external_objects (list) – List of external objects in the environment.
**kwargs – Additional keyword arguments: - vxmax (float): Maximum x velocity, default 1.5. - vymax (float): Maximum y velocity, default 1.5. - acce (float): Acceleration factor, default 1.0. - factor (float): Additional scaling factor, default 1.0. - mode (str): RVO calculation mode, default “rvo”. - neighbor_threshold (float): Neighbor threshold distance, default 10.0.
- Returns:
Velocity [linear, angular] (2x1) for differential drive.
- Return type:
np.array
- irsim.lib.behavior.behavior_methods.beh_diff_dash(ego_object: Any, external_objects: list[Any], **kwargs: Any) numpy.ndarray[source]#
Behavior function for differential drive robot using dash-to-goal behavior.
- Parameters:
ego_object – The ego robot object.
external_objects (list) – List of external objects in the environment.
**kwargs – Additional keyword arguments: - angle_tolerance (float): Allowable angular deviation, default 0.1.
- Returns:
Velocity [linear, angular] (2x1) for differential drive.
- Return type:
np.array
- irsim.lib.behavior.behavior_methods.beh_omni_dash(ego_object: Any, external_objects: list[Any], **kwargs: Any) numpy.ndarray[source]#
Behavior function for omnidirectional robot using dash-to-goal behavior.
- Parameters:
ego_object – The ego robot object.
external_objects (list) – List of external objects in the environment.
**kwargs – Additional keyword arguments (currently unused).
- Returns:
Velocity [vx, vy] (2x1) for omnidirectional drive.
- Return type:
np.array
- irsim.lib.behavior.behavior_methods.beh_omni_rvo(ego_object: Any, external_objects: list[Any], **kwargs: Any) numpy.ndarray[source]#
Behavior function for omnidirectional robot using RVO (Reciprocal Velocity Obstacles).
- Parameters:
ego_object – The ego robot object.
external_objects (list) – List of external objects in the environment.
**kwargs – Additional keyword arguments: - vxmax (float): Maximum x velocity, default 1.5. - vymax (float): Maximum y velocity, default 1.5. - acce (float): Acceleration factor, default 1.0. - factor (float): Additional scaling factor, default 1.0. - mode (str): RVO calculation mode, default “rvo”. - neighbor_threshold (float): Neighbor threshold distance, default 3.0.
- Returns:
Velocity [vx, vy] (2x1) for omnidirectional drive.
- Return type:
np.array
- irsim.lib.behavior.behavior_methods.beh_acker_dash(ego_object: Any, external_objects: list[Any], **kwargs: Any) numpy.ndarray[source]#
Behavior function for Ackermann steering robot using dash-to-goal behavior.
- Parameters:
ego_object – The ego robot object.
external_objects (list) – List of external objects in the environment.
**kwargs – Additional keyword arguments: - angle_tolerance (float): Allowable angular deviation, default 0.1.
- Returns:
Velocity [linear, steering angle] (2x1) for Ackermann drive.
- Return type:
np.array
- irsim.lib.behavior.behavior_methods.OmniRVO(state_tuple: Any, neighbor_list: list[Any] | None = None, vxmax: float = 1.5, vymax: float = 1.5, acce: float = 1, factor: float = 1.0, mode: str = 'rvo', neighbor_threshold: float = 3.0) numpy.ndarray[source]#
Calculate the omnidirectional velocity using RVO.
- Parameters:
state_tuple (tuple) – Current state and orientation.
neighbor_list (list) – List of neighboring agents (default None).
vxmax (float) – Maximum x velocity (default 1.5).
vymax (float) – Maximum y velocity (default 1.5).
acce (float) – Acceleration factor (default 1).
factor (float) – Additional scaling factor (default 1.0).
mode (str) – RVO calculation mode (default “rvo”).
neighbor_threshold (float) – Neighbor threshold (default 3.0).
- Returns:
Velocity [vx, vy] (2x1).
- Return type:
np.array
- irsim.lib.behavior.behavior_methods.DiffRVO(state_tuple: Any, neighbor_list: list[Any] | None = None, vxmax: float = 1.5, vymax: float = 1.5, acce: float = 1, factor: float = 1.0, mode: str = 'rvo', neighbor_threshold: float = 3.0) numpy.ndarray[source]#
Calculate the differential drive velocity using RVO.
- Parameters:
state_tuple (tuple) – Current state and orientation.
neighbor_list (list) – List of neighboring agents (default None).
vxmax (float) – Maximum x velocity (default 1.5).
vymax (float) – Maximum y velocity (default 1.5).
acce (float) – Acceleration factor (default 1).
factor (float) – Additional scaling factor (default 1.0).
mode (str) – RVO calculation mode (default “rvo”).
neighbor_threshold (float) – Neighbor threshold (default 3.0).
- Returns:
Velocity [linear, angular] (2x1).
- Return type:
np.array
- irsim.lib.behavior.behavior_methods.OmniDash(state: numpy.ndarray, goal: numpy.ndarray, max_vel: numpy.ndarray, goal_threshold: float = 0.1) numpy.ndarray[source]#
Calculate the omnidirectional velocity to reach a goal.
- Parameters:
state (np.array) – Current state [x, y] (2x1).
goal (np.array) – Goal position [x, y] (2x1).
max_vel (np.array) – Maximum velocity [vx, vy] (2x1).
goal_threshold (float) – Distance threshold to consider goal reached (default 0.1).
- Returns:
Velocity [vx, vy] (2x1).
- Return type:
np.array
- irsim.lib.behavior.behavior_methods.DiffDash(state: numpy.ndarray, goal: numpy.ndarray, max_vel: numpy.ndarray, goal_threshold: float = 0.1, angle_tolerance: float = 0.2) numpy.ndarray[source]#
Calculate the differential drive velocity to reach a goal.
- Parameters:
state (np.array) – Current state [x, y, theta] (3x1).
goal (np.array) – Goal position [x, y] (2x1).
max_vel (np.array) – Maximum velocity [linear, angular] (2x1).
goal_threshold (float) – Distance threshold to consider goal reached (default 0.1).
angle_tolerance (float) – Allowable angular deviation (default 0.2).
- Returns:
Velocity [linear, angular] (2x1).
- Return type:
np.array
- irsim.lib.behavior.behavior_methods.AckerDash(state: numpy.ndarray, goal: numpy.ndarray, max_vel: numpy.ndarray, goal_threshold: float, angle_tolerance: float) numpy.ndarray[source]#
Calculate the Ackermann steering velocity to reach a goal.
- Parameters:
state (np.array) – Current state [x, y, theta] (3x1).
goal (np.array) – Goal position [x, y] (2x1).
max_vel (np.array) – Maximum velocity [linear, steering angle] (2x1).
goal_threshold (float) – Distance threshold to consider goal reached.
angle_tolerance (float) – Allowable angular deviation.
- Returns:
Velocity [linear, steering angle] (2x1).
- Return type:
np.array