irsim.lib.handler.kinematics_handler#

Classes#

KinematicsHandler

Abstract base class for handling robot kinematics.

OmniKinematics

Abstract base class for handling robot kinematics.

DifferentialKinematics

Abstract base class for handling robot kinematics.

AckermannKinematics

Abstract base class for handling robot kinematics.

KinematicsFactory

Factory class to create kinematics handlers.

Module Contents#

class irsim.lib.handler.kinematics_handler.KinematicsHandler(name, noise: bool = False, alpha: list | None = None)[source]#

Bases: abc.ABC

Abstract base class for handling robot kinematics.

Initialize the KinematicsHandler class.

Parameters:
  • name (str) – Kinematics model name.

  • noise (bool) – Boolean indicating whether to add noise to the velocity (default False).

  • alpha (list) – List of noise parameters for the velocity model (default [0.03, 0, 0, 0.03]).

name#
noise = False#
alpha = [0.03, 0, 0, 0.03]#
abstractmethod step(state: numpy.ndarray, velocity: numpy.ndarray, step_time: float) numpy.ndarray[source]#

Calculate the next state using the kinematics model.

Parameters:
  • state (np.ndarray) – Current state.

  • velocity (np.ndarray) – Velocity vector.

  • step_time (float) – Time step for simulation.

Returns:

Next state.

Return type:

np.ndarray

class irsim.lib.handler.kinematics_handler.OmniKinematics(name, noise, alpha)[source]#

Bases: KinematicsHandler

Abstract base class for handling robot kinematics.

Initialize the KinematicsHandler class.

Parameters:
  • name (str) – Kinematics model name.

  • noise (bool) – Boolean indicating whether to add noise to the velocity (default False).

  • alpha (list) – List of noise parameters for the velocity model (default [0.03, 0, 0, 0.03]).

step(state: numpy.ndarray, velocity: numpy.ndarray, step_time: float) numpy.ndarray[source]#

Advance omnidirectional state one step.

Parameters:
  • state (np.ndarray) – Current state [x, y, theta, …].

  • velocity (np.ndarray) – Velocity [vx, vy].

  • step_time (float) – Time step.

Returns:

New state (x, y updated; rest preserved).

Return type:

np.ndarray

class irsim.lib.handler.kinematics_handler.DifferentialKinematics(name, noise, alpha)[source]#

Bases: KinematicsHandler

Abstract base class for handling robot kinematics.

Initialize the KinematicsHandler class.

Parameters:
  • name (str) – Kinematics model name.

  • noise (bool) – Boolean indicating whether to add noise to the velocity (default False).

  • alpha (list) – List of noise parameters for the velocity model (default [0.03, 0, 0, 0.03]).

step(state: numpy.ndarray, velocity: numpy.ndarray, step_time: float) numpy.ndarray[source]#

Advance differential-drive state one step.

Parameters:
  • state (np.ndarray) – Current state [x, y, theta].

  • velocity (np.ndarray) – [linear, angular].

  • step_time (float) – Time step.

Returns:

Next state.

Return type:

np.ndarray

class irsim.lib.handler.kinematics_handler.AckermannKinematics(name, noise: bool = False, alpha: list | None = None, mode: str = 'steer', wheelbase: float = 1.0)[source]#

Bases: KinematicsHandler

Abstract base class for handling robot kinematics.

Initialize the KinematicsHandler class.

Parameters:
  • name (str) – Kinematics model name.

  • noise (bool) – Boolean indicating whether to add noise to the velocity (default False).

  • alpha (list) – List of noise parameters for the velocity model (default [0.03, 0, 0, 0.03]).

mode = 'steer'#
wheelbase = 1.0#
step(state: numpy.ndarray, velocity: numpy.ndarray, step_time: float) numpy.ndarray[source]#

Advance Ackermann-steered state one step.

Parameters:
  • state (np.ndarray) – Current state [x, y, theta, steer].

  • velocity (np.ndarray) – Depending on mode: [linear, steer] or [linear, angular].

  • step_time (float) – Time step.

Returns:

Next state.

Return type:

np.ndarray

class irsim.lib.handler.kinematics_handler.KinematicsFactory[source]#

Factory class to create kinematics handlers.

static create_kinematics(name: str | None = None, noise: bool = False, alpha: list | None = None, mode: str = 'steer', wheelbase: float | None = None, role: str = 'robot') KinematicsHandler[source]#