agents package

Submodules

agents.Human module

class agents.Human.Human

Bases: agents.MobileAgent.MobileAgent

calc_control_input(dT, goal, fx, fu, Xr, Xh, dot_Xr, dot_Xh, Mr, Mh, p_Mr_p_Xr, p_Mh_p_Xh, u0, min_u, max_u)

This function return a control input based on internal state and obstacle information

Parameters
  • dT (float) – dT

  • goal (ndarray) – [x; y; z; 0; 0; 0]

  • fx (ndarray) – transition matrix

  • fu (ndarray) – transition matrix

  • Xr (ndarray) – estimate state of robot

  • Xh (ndarray) – estimate state of obstacle

  • dot_Xr (ndarray) – estimate gradient of robot state

  • dot_Xh (ndarray) – estimate gradient of obstacle state

  • Mr (ndarray) – cartesian position and velocity of the nearest point from robot to obstacle

  • Mh (ndarray) – cartesian position and velocity of the nearest point from obstacle to robot

  • p_Mr_p_Xr (ndarray) – derivative of robot cartesian state to internal state

  • p_Mh_p_Xh (ndarray) – derivative of obstacle cartesian state to internal state

  • u0 (ndarray) – reference control input, this is the default control input if there is no obstacle

  • min_u (ndarray) – control input saturation

  • max_u (ndarray) – control input saturation

d_min = 2
half_plane_ABC = []
k_v = 2
lambd = 0.5
yita = 2

agents.MobileAgent module

class agents.MobileAgent.MobileAgent

Bases: object

This is the base class for algorithms. We assume all the algorithms use relative cartesian position and velocity to evaluate current safety index.

calc_control_input(dT, goal, fx, fu, Xr, Xh, dot_Xr, dot_Xh, Mr, Mh, p_Mr_p_Xr, p_Mh_p_Xh, u0, min_u, max_u)

This function return a control input based on internal state and obstacle information

Parameters
  • dT (float) – dT

  • goal (ndarray) – [x; y; z; 0; 0; 0]

  • fx (ndarray) – transition matrix

  • fu (ndarray) – transition matrix

  • Xr (ndarray) – estimate state of robot

  • Xh (ndarray) – estimate state of obstacle

  • dot_Xr (ndarray) – estimate gradient of robot state

  • dot_Xh (ndarray) – estimate gradient of obstacle state

  • Mr (ndarray) – cartesian position and velocity of the nearest point from robot to obstacle

  • Mh (ndarray) – cartesian position and velocity of the nearest point from obstacle to robot

  • p_Mr_p_Xr (ndarray) – derivative of robot cartesian state to internal state

  • p_Mh_p_Xh (ndarray) – derivative of obstacle cartesian state to internal state

  • u0 (ndarray) – reference control input, this is the default control input if there is no obstacle

  • min_u (ndarray) – control input saturation

  • max_u (ndarray) – control input saturation

agents.PotentialField module

class agents.PotentialField.PotentialField

Bases: agents.MobileAgent.MobileAgent

Potential field method. This method is inspired from gravity potential field.

calc_control_input(dT, goal, fx, fu, Xr, Xh, dot_Xr, dot_Xh, Mr, Mh, p_Mr_p_Xr, p_Mh_p_Xh, u0, min_u, max_u)

This function return a control input based on internal state and obstacle information

Parameters
  • dT (float) – dT

  • goal (ndarray) – [x; y; z; 0; 0; 0]

  • fx (ndarray) – transition matrix

  • fu (ndarray) – transition matrix

  • Xr (ndarray) – estimate state of robot

  • Xh (ndarray) – estimate state of obstacle

  • dot_Xr (ndarray) – estimate gradient of robot state

  • dot_Xh (ndarray) – estimate gradient of obstacle state

  • Mr (ndarray) – cartesian position and velocity of the nearest point from robot to obstacle

  • Mh (ndarray) – cartesian position and velocity of the nearest point from obstacle to robot

  • p_Mr_p_Xr (ndarray) – derivative of robot cartesian state to internal state

  • p_Mh_p_Xh (ndarray) – derivative of obstacle cartesian state to internal state

  • u0 (ndarray) – reference control input, this is the default control input if there is no obstacle

  • min_u (ndarray) – control input saturation

  • max_u (ndarray) – control input saturation

agents.SafeSet module

class agents.SafeSet.SafeSet(d_min=2, k_v=2, yita=10)

Bases: agents.MobileAgent.MobileAgent

This is the Safe Set method. Please refer to the paper for details.

calc_control_input(dT, goal, fx, fu, Xr, Xh, dot_Xr, dot_Xh, Mr, Mh, p_Mr_p_Xr, p_Mh_p_Xh, u0, min_u, max_u)

This function return a control input based on internal state and obstacle information

Parameters
  • dT (float) – dT

  • goal (ndarray) – [x; y; z; 0; 0; 0]

  • fx (ndarray) – transition matrix

  • fu (ndarray) – transition matrix

  • Xr (ndarray) – estimate state of robot

  • Xh (ndarray) – estimate state of obstacle

  • dot_Xr (ndarray) – estimate gradient of robot state

  • dot_Xh (ndarray) – estimate gradient of obstacle state

  • Mr (ndarray) – cartesian position and velocity of the nearest point from robot to obstacle

  • Mh (ndarray) – cartesian position and velocity of the nearest point from obstacle to robot

  • p_Mr_p_Xr (ndarray) – derivative of robot cartesian state to internal state

  • p_Mh_p_Xh (ndarray) – derivative of obstacle cartesian state to internal state

  • u0 (ndarray) – reference control input, this is the default control input if there is no obstacle

  • min_u (ndarray) – control input saturation

  • max_u (ndarray) – control input saturation

agents.SlidingMode module

class agents.SlidingMode.SlidingMode

Bases: agents.MobileAgent.MobileAgent

calc_control_input(dT, goal, fx, fu, Xr, Xh, dot_Xr, dot_Xh, Mr, Mh, p_Mr_p_Xr, p_Mh_p_Xh, u0, min_u, max_u)

This function return a control input based on internal state and obstacle information

Parameters
  • dT (float) – dT

  • goal (ndarray) – [x; y; z; 0; 0; 0]

  • fx (ndarray) – transition matrix

  • fu (ndarray) – transition matrix

  • Xr (ndarray) – estimate state of robot

  • Xh (ndarray) – estimate state of obstacle

  • dot_Xr (ndarray) – estimate gradient of robot state

  • dot_Xh (ndarray) – estimate gradient of obstacle state

  • Mr (ndarray) – cartesian position and velocity of the nearest point from robot to obstacle

  • Mh (ndarray) – cartesian position and velocity of the nearest point from obstacle to robot

  • p_Mr_p_Xr (ndarray) – derivative of robot cartesian state to internal state

  • p_Mh_p_Xh (ndarray) – derivative of obstacle cartesian state to internal state

  • u0 (ndarray) – reference control input, this is the default control input if there is no obstacle

  • min_u (ndarray) – control input saturation

  • max_u (ndarray) – control input saturation

agents.SublevelSafeSet module

class agents.SublevelSafeSet.SublevelSafeSet(d_min=2, k_v=1, gamma=5)

Bases: agents.MobileAgent.MobileAgent

This is the sublevel safeset. Please refer to the paper for details.

calc_control_input(dT, goal, fx, fu, Xr, Xh, dot_Xr, dot_Xh, Mr, Mh, p_Mr_p_Xr, p_Mh_p_Xh, u0, min_u, max_u)

This function return a control input based on internal state and obstacle information

Parameters
  • dT (float) – dT

  • goal (ndarray) – [x; y; z; 0; 0; 0]

  • fx (ndarray) – transition matrix

  • fu (ndarray) – transition matrix

  • Xr (ndarray) – estimate state of robot

  • Xh (ndarray) – estimate state of obstacle

  • dot_Xr (ndarray) – estimate gradient of robot state

  • dot_Xh (ndarray) – estimate gradient of obstacle state

  • Mr (ndarray) – cartesian position and velocity of the nearest point from robot to obstacle

  • Mh (ndarray) – cartesian position and velocity of the nearest point from obstacle to robot

  • p_Mr_p_Xr (ndarray) – derivative of robot cartesian state to internal state

  • p_Mh_p_Xh (ndarray) – derivative of obstacle cartesian state to internal state

  • u0 (ndarray) – reference control input, this is the default control input if there is no obstacle

  • min_u (ndarray) – control input saturation

  • max_u (ndarray) – control input saturation

agents.ZeroingBarrierFunction module

class agents.ZeroingBarrierFunction.ZeroingBarrierFunction(d_min=3, t=0.5, gamma=1)

Bases: agents.MobileAgent.MobileAgent

This is the Zeroing Barrier Function method. Please refer to the paper for details.

calc_control_input(dT, goal, fx, fu, Xr, Xh, dot_Xr, dot_Xh, Mr, Mh, p_Mr_p_Xr, p_Mh_p_Xh, u0, min_u, max_u)

This function return a control input based on internal state and obstacle information

Parameters
  • dT (float) – dT

  • goal (ndarray) – [x; y; z; 0; 0; 0]

  • fx (ndarray) – transition matrix

  • fu (ndarray) – transition matrix

  • Xr (ndarray) – estimate state of robot

  • Xh (ndarray) – estimate state of obstacle

  • dot_Xr (ndarray) – estimate gradient of robot state

  • dot_Xh (ndarray) – estimate gradient of obstacle state

  • Mr (ndarray) – cartesian position and velocity of the nearest point from robot to obstacle

  • Mh (ndarray) – cartesian position and velocity of the nearest point from obstacle to robot

  • p_Mr_p_Xr (ndarray) – derivative of robot cartesian state to internal state

  • p_Mh_p_Xh (ndarray) – derivative of obstacle cartesian state to internal state

  • u0 (ndarray) – reference control input, this is the default control input if there is no obstacle

  • min_u (ndarray) – control input saturation

  • max_u (ndarray) – control input saturation

Module contents