irsim.lib.algorithm.kinematics#

This file is the implementation of the kinematics for different robots.

reference: Lynch, Kevin M., and Frank C. Park. Modern Robotics: Mechanics, Planning, and Control. 1st ed. Cambridge, MA: Cambridge University Press, 2017.

Functions#

differential_kinematics(state, velocity, step_time[, ...])

Calculate the next state for a differential wheel robot.

ackermann_kinematics(state, velocity, step_time[, ...])

Calculate the next state for an Ackermann steering vehicle.

omni_kinematics(state, velocity, step_time[, noise, alpha])

Calculate the next position for an omnidirectional robot.

Module Contents#

irsim.lib.algorithm.kinematics.differential_kinematics(state, velocity, step_time, noise=False, alpha=[0.03, 0, 0, 0.03])[source]#

Calculate the next state for a differential wheel robot.

Parameters:
  • state – A 3x1 vector [x, y, theta] representing the current position and orientation.

  • velocity – A 2x1 vector [linear, angular] representing the current velocities.

  • step_time – The time step for the simulation.

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

  • alpha – List of noise parameters for the velocity model (default [0.03, 0, 0, 0.03]). alpha[0] and alpha[1] are for linear velocity, alpha[2] and alpha[3] are for angular velocity.

Returns:

A 3x1 vector [x, y, theta] representing the next state.

Return type:

next_state

irsim.lib.algorithm.kinematics.ackermann_kinematics(state, velocity, step_time, noise=False, alpha=[0.03, 0, 0, 0.03], mode='steer', wheelbase=1)[source]#

Calculate the next state for an Ackermann steering vehicle.

Parameters:
  • state – A 4x1 vector [x, y, theta, steer_angle] representing the current state.

  • velocity – A 2x1 vector representing the current velocities, format depends on mode. For “steer” mode, [linear, steer_angle] is expected. For “angular” mode, [linear, angular] is expected.

  • step_time – The time step for the simulation.

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

  • alpha – List of noise parameters for the velocity model (default [0.03, 0, 0, 0.03]). alpha[0] and alpha[1] are for linear velocity, alpha[2] and alpha[3] are for angular velocity.

  • mode – The kinematic mode, either “steer” or “angular” (default “steer”).

  • wheelbase – The distance between the front and rear axles (default 1).

Returns:

A 4x1 vector representing the next state.

Return type:

new_state

irsim.lib.algorithm.kinematics.omni_kinematics(state, velocity, step_time, noise=False, alpha=[0.03, 0, 0, 0.03])[source]#

Calculate the next position for an omnidirectional robot.

Parameters:
  • state – A 2x1 vector [x, y] representing the current position.

  • velocity – A 2x1 vector [vx, vy] representing the current velocities.

  • step_time – The time step for the simulation.

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

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

Returns:

A 2x1 vector [x, y] representing the next position.

Return type:

new_position