Two wheels differential drive with dynamic constraints#
#include "navground/core/kinematics.h"
- 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::get_wheel_axis)
- max_forward_speed(float, TwoWheelsDifferentialDriveKinematics::get_max_forward_speed)
- max_backward_speed(float, TwoWheelsDifferentialDriveKinematics::get_max_backward_speed)
- max_acceleration(float, get_max_acceleration)
- moi(float, get_moi, 1.0 by default)
 - Public Functions - Constructs a new instance. - Parameters:
- max_speed – [in] The maximal wheel speed 
- wheel_axis – [in] The wheel axis (i.e., the distance between the wheels) 
- max_angular_speed – [in] The maximal angular speed, that is also limited by the 2 * max_speed / axis, if the axis is positive. 
- max_forward_speed – [in] The maximal linear speed when moving forwards (set to negative or infinite to leave unconstrained) 
- max_backward_speed – [in] The maximal linear speed when moving backwards (set to negative or infinite to leave unconstrained) 
- max_acceleration – [in] The maximal linear body acceleration 
- moi – [in] The scaled moment of inertial ( - moi = I / (mass * axis^2 / 8)) Equal to 1 for an homogeneous disc of diameter- wheel_axis.
 
 
 - Gets the scaled moment of inertial. - It is equal to 1 for an homogeneous of disc of diameter TwoWheelsDifferentialDriveKinematics::get_wheel_axis. Lower for when weight is shifted towards the center. - Returns:
- A positive value 
 
 - Sets the scaled moment of inertial. - It is equal to for an homogeneous of disc of diameter TwoWheelsDifferentialDriveKinematics::get_wheel_axis. Lower for when weight is shifted towards the center. - Parameters:
- value – [in] A positive value 
 
 - Gets the maximal (body) acceleration. - Returns:
- The acceleration. 
 
 - Sets the maximal (body) acceleration. - Parameters:
- value – [in] A positive value 
 
 - Gets the maximal (body) angular acceleration. - Returns:
- The angular acceleration. 
 
 - Sets the maximal (body) angular acceleration. - Parameters:
- value – [in] A positive value 
 
 - Computes the wheel torques required to accelerate over a time step. - Parameters:
- value – [in] The target value 
- current – [in] The current value 
- time_step – [in] The time step 
 
- Returns:
- {left, right} wheel torques. May not be feasible 
 
 - Applies wheel torques to accelerate a twist over a time step. - Warning - Does not check whether motor torques are feasible. - Parameters:
- values – [in] The motor torques 
- current – [in] The current twist 
- time_step – [in] The time step 
 
- Returns:
- The accelerated twist. 
 
 - Gets the maximal [scaled] wheel torque. - Returns:
- The maximal wheel torque (in acceleration units)