Version:

ROS 2 Vehicle Dynamics

Vehicle Model

VehicleModelComponent serves the purpose of converting inputs such as target velocity, steering or acceleration to physical forces on parts of a vehicle (robot). VehicleModel has a VehicleConfiguration which is used to define axles, parametrize and assign wheels. The model requires a WheelControllerComponent present in each wheel entity. It also uses an implementation of DriveModel, which converts vehicle inputs to forces acting on steering elements and wheels.

Wheel Controller

A wheel controller is a controller that should be attached to the vehicle’s wheel. The wheel entity should have PhysX Hinge Joint attached. The Joint controller should have:

  • Motor Configuration / Use Motor enabled,
  • Motor Configuration / Force Limit Value set to a desirable value.

PhysX Joint

The wheel controller has the following parameters shown below.

Wheel Controller

Parameter NameDescription
Steering EntityThe entity that has a PhysX Hinge Joint that changes the direction of the wheel.
Scale of steering axisAllows the user to change the ratio or / and direction of wheel steering.

Ackermann Drive Model

The implementation of AckermannDriveModel uses PID controllers from control_toolbox package. The model computes velocities or forces in the joints of the vehicle and applies it accordingly to commanded velocity.

AckermannModel

Parameters of the model are exposed to the user via AckermannVehicleModelComponent:

Parameter NameDescription
DriveModel / AxlesList of axles of the vehicle.
DriveModel / Axles / Axle WheelsList of wheels in axis.
DriveModel / Axles / Is it a steeringIf it is enabled the Ackermann Drive Model will apply a steering angle.
DriveModel / Axles / Is it a driveIf it is enabled the Ackermann Drive Model will apply drive force.
DriveModel / Axles / TrackDistance between front and rear axis.
DriveModel / Axles / WheelbaseDistance between left and right wheel.
DriveModel / Steering PID / PProportional gain of PID controller for steering servo.
DriveModel / Steering PID / IIntegral gain of PID controller for steering servo.
DriveModel / Steering PID / DDerivative gain of PID controller for steering servo.
DriveModel / Steering PID / IMinMinimum integration impact of PID.
DriveModel / Steering PID / IMaxMaximum integration impact of PID.
DriveModel / Steering PID / AntiWindUpPrevents integral wind-up in PID.
DriveModel / Steering PID / OutputLimitClamps output to maximum value.
DriveModel / Vehicles Limits / Speed limitMaximum achievable linear speed in meters per second.
DriveModel / Vehicles Limits / Steering limitMaximum achievable steering angle.

Skid Steering Drive Model

The model computes velocities in the joints of the vehicle and applies it accordingly to commanded velocity and configuration.

SkidSteeringModel
Parameters of the model are exposed to the user via AckermannVehicleModelComponent:

Parameter NameDescription
DriveModel / AxlesList of axles of the vehicle.
DriveModel / Axles / Axle WheelsList of wheels in axis.
DriveModel / Axles / Is it a steeringIt is ignored in this model.
DriveModel / Axles / Is it a driveIf it is enabled, the Skid Steering Drive Model will apply velocities to the axis’ wheels.
DriveModel / Axles / TrackDistance between front and rear axis.
DriveModel / Axles / WheelbaseDistance between left and right wheel.
DriveModel / Vehicles Limits / Linear speed limitMaximum achievable linear speed in meters per second.
DriveModel / Vehicles Limits / Angular speed limitMaximum achievable angular speed in radians per second.

Manual control

The VehicleModel will handle input events with names “steering” and “accelerate”. This means you can add an InputComponent to the same entity and define an input map for your input devices (such as a keyboard or a gamepad) to control the vehicle manually.

You can use tools such as rqt_robot_steering to move your robot with Twist messages. RobotControl is suitable to use with ROS 2 navigation stack .

It is possible to implement your own control mechanisms with this component.