Main Content

Differential Drive Kinematic Model

Compute vehicle motion using differential drive kinematic model

Since R2019b

  • Differential Drive Kinematic Model block

Libraries:
Robotics System Toolbox / Mobile Robot Algorithms

Description

The Differential Drive Kinematic Model block creates a differential-drive vehicle model to simulate simplified vehicle dynamics. This model approximates a vehicle with a single fixed axle and wheels separated by a specified track width Track width. Each of the wheels can be driven independently using speed inputs, L/dt and R/dt, for the left and right wheels respectively. Vehicle speed and heading is defined from the axle center.

Differential drive kinematic model diagram with x, y, theta, velocity, track width, and wheel radius labeled

Ports

Input

expand all

Left wheel speed of the vehicle, specified in radians per second.

Dependencies

To enable this port, set the Vehicle inputs parameter to Wheel Speeds.

Right wheel speed of the vehicle, specified in radians per second.

Dependencies

To enable this port, set the Vehicle inputs parameter to Wheel Speeds.

Vehicle speed, specified in meters per second.

Dependencies

To enable this port, set the Vehicle inputs parameter to Vehicle Speed & Heading Angular Velocity.

Angular velocity of the vehicle, specified in radians per second. A positive value steers the vehicle left and negative values steer the vehicle right.

Dependencies

To enable this port, set the Vehicle inputs parameter to Vehicle Speed & Heading Angular Velocity.

Output

expand all

Current position and orientation of the vehicle, specified as a [x y theta] vector in meters and radians.

The current linear and angular velocities of the vehicle specified as a [xDot yDot thetaDot] vector in meters per second and radians per second. The linear and angular velocities are calculated by taking the derivative of the state output.

Parameters

expand all

The format of the model input commands

  • Wheel Speeds — Angular speeds of the two wheels in radians per second.

  • Vehicle Speed & Heading Angular Velocity — Vehicle speed in meters per second with a heading angular velocity in radians per second.

The radius of the wheels on the vehicle, specified in meters.

The wheel speed range is a two-element vector that provides the minimum and maximum vehicle wheel speeds, [MinSpeed MaxSpeed], specified in radians per second.

Length of the track from the left wheel to right wheel, specified in meters.

The initial xy-position and orientation, θ, of the vehicle.

  • Interpreted execution — Simulate model using the MATLAB® interpreter. For more information, see Simulation Modes (Simulink).

  • Code generation — Simulate model using generated C code. The first time you run a simulation, Simulink® generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change.

Tunable: No

References

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

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2019b