irsim.lib.behavior.behavior_methods#

Functions#

beh_diff_rvo(ego_object, external_objects, **kwargs)

Behavior function for differential drive robot using RVO (Reciprocal Velocity Obstacles).

beh_diff_dash(ego_object, external_objects, **kwargs)

Behavior function for differential drive robot using dash-to-goal behavior.

beh_omni_dash(ego_object, external_objects, **kwargs)

Behavior function for omnidirectional robot using dash-to-goal behavior.

beh_omni_rvo(ego_object, external_objects, **kwargs)

Behavior function for omnidirectional robot using RVO (Reciprocal Velocity Obstacles).

beh_acker_dash(ego_object, external_objects, **kwargs)

Behavior function for Ackermann steering robot using dash-to-goal behavior.

OmniRVO(state_tuple[, neighbor_list, vxmax, vymax, ...])

Calculate the omnidirectional velocity using RVO.

DiffRVO(state_tuple[, neighbor_list, vxmax, vymax, ...])

Calculate the differential drive velocity using RVO.

OmniDash(state, goal, max_vel[, goal_threshold])

Calculate the omnidirectional velocity to reach a goal.

DiffDash(state, goal, max_vel[, goal_threshold, ...])

Calculate the differential drive velocity to reach a goal.

AckerDash(state, goal, max_vel, goal_threshold, ...)

Calculate the Ackermann steering velocity to reach a goal.

Module Contents#

irsim.lib.behavior.behavior_methods.beh_diff_rvo(ego_object, external_objects, **kwargs)[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, external_objects, **kwargs)[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, external_objects, **kwargs)[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, external_objects, **kwargs)[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, external_objects, **kwargs)[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, neighbor_list=None, vxmax=1.5, vymax=1.5, acce=1, factor=1.0, mode='rvo', neighbor_threshold=3.0)[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, neighbor_list=None, vxmax=1.5, vymax=1.5, acce=1, factor=1.0, mode='rvo', neighbor_threshold=3.0)[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, goal, max_vel, goal_threshold=0.1)[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, goal, max_vel, goal_threshold=0.1, angle_tolerance=0.2)[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, goal, max_vel, goal_threshold, angle_tolerance)[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