Two wheels differential drive with dynamic constraints#
- module:
Bases:
TwoWheelsDifferentialDriveKinematics
,WheeledKinematics
Two differential drive wheels (left, right) (e.g., a wheelchair) with acceleration limits due to limited motor torque.
The two motors have the same maximal torque.
Registered properties:
wheel_axis (float,
TwoWheelsDifferentialDriveKinematics.wheel_axis
)max_forward_speed (float,
TwoWheelsDifferentialDriveKinematics.max_forward_speed
)max_backward_speed (float,
TwoWheelsDifferentialDriveKinematics.max_backward_speed
)max_acceleration (float,
max_acceleration
)moi (float,
moi
, 1.0 by default)
Constructs a new instance.
- Parameters:
max_speed – The maximal wheel speed
wheel_axis – The wheel axis (i.e., the distance between the wheels)
max_angular_speed – The maximal angular speed, that is also limited by the 2 * max_speed / axis, if the axis is positive.
max_forward_speed – The maximal linear speed when moving forwards (set to negative or infinite to leave unconstrained)
max_backward_speed – The maximal linear speed when moving backwards (set to negative or infinite to leave unconstrained)
max_acceleration – The maximal linear body acceleration
moi – The scaled moment of inertial (
moi = I / (mass * axis^2 / 8)
) Equal to 1 for an homogeneous disc of diameterwheel_axis
.
Applies wheel torques to accelerate a twist over a time step
Does not check the motor torques are feasible.
- Parameters:
values – The motor torques
current – The current twist
time_step – The time step
- Returns:
The accelerated twist.
Computes the wheel torques required to accelerate over a time step
- Parameters:
value – The target value
current – The current value
time_step – The time step
- Returns:
{left, right} wheel torques. May not be feasible
- Type:
The maximal (body) acceleration.
- Type:
The maximal (body) angular acceleration.
- Type:
The maximal [scaled] wheel torque.
- Type:
The scaled moment of inertial
it is equal to 1 for an homogeneous of disc of diameter
twowheelsdifferentialdrivekinematics.wheel_axis
. lower for when weight is shifted towards the center.