|
libstp
Robotics library for Botball
|
#include <differential.hpp>
Public Member Functions | |
| DifferentialKinematics (hal::motor::IMotor *left_motor, hal::motor::IMotor *right_motor, double wheelbase, double wheelRadius) | |
| ~DifferentialKinematics () override=default | |
| std::size_t | wheelCount () const override |
| MotorCommands | applyCommand (const foundation::ChassisVelocity &cmd, double dt) override |
| foundation::ChassisVelocity | estimateState () const override |
| void | hardStop () override |
| bool | supportsLateralMotion () const override |
| void | resetEncoders () override |
| double | getWheelRadius () const override |
| Get the wheel radius used by this kinematics model. | |
| std::vector< hal::motor::IMotor * > | getMotors () override |
| StmOdometryConfig | getStmOdometryConfig () override |
| void | applyPowerCommand (const foundation::ChassisVelocity &direction, int power_percent) override |
| void | setMaxWheelSpeed (double max_wheel_speed) |
| double | getMaxWheelSpeed () const |
| double | maxYawRateForArcRadius (double radius_m, bool) const override |
| Public Member Functions inherited from libstp::kinematics::IKinematics | |
| virtual | ~IKinematics ()=default |
| virtual void | setVelocityCommandGains (double, double, double) |
| virtual std::array< double, 3 > | getVelocityCommandGains () const |
Differential-drive implementation of IKinematics.
The model assumes two independently driven wheels separated by m_wheelbase, with no direct lateral degree of freedom.
Definition at line 15 of file differential.hpp.
| libstp::kinematics::differential::DifferentialKinematics::DifferentialKinematics | ( | hal::motor::IMotor * | left_motor, |
| hal::motor::IMotor * | right_motor, | ||
| double | wheelbase, | ||
| double | wheelRadius ) |
| left_motor | Non-owning pointer to the left drive motor. |
| right_motor | Non-owning pointer to the right drive motor. |
| wheelbase | Distance between left and right wheel contact lines. |
| wheelRadius | Radius of each drive wheel in meters. |
|
overridedefault |
|
overridevirtual |
Convert (vx, wz) into left and right wheel angular velocities.
Implements libstp::kinematics::IKinematics.
|
overridevirtual |
Command motors at raw open-loop power using differential inverse kinematics for direction.
Implements libstp::kinematics::IKinematics.
|
nodiscardoverridevirtual |
Recover (vx, wz) from the measured left and right wheel speeds.
Implements libstp::kinematics::IKinematics.
|
inlinenodiscard |
Definition at line 68 of file differential.hpp.
|
nodiscardoverridevirtual |
Return the underlying motors in left, right order.
Implements libstp::kinematics::IKinematics.
|
nodiscardoverridevirtual |
Implements libstp::kinematics::IKinematics.
|
inlinenodiscardoverridevirtual |
Get the wheel radius used by this kinematics model.
Implements libstp::kinematics::IKinematics.
Definition at line 56 of file differential.hpp.
|
overridevirtual |
Brake both drive motors immediately.
Implements libstp::kinematics::IKinematics.
|
inlinenodiscardoverridevirtual |
Outer wheel on an arc travels at omega * (radius + wheelbase/2); keep it inside the wheel-speed limit. lateral is irrelevant — a differential base has no strafe arcs.
Reimplemented from libstp::kinematics::IKinematics.
Definition at line 75 of file differential.hpp.
|
overridevirtual |
Clear encoder history in both MotorAdapter instances.
Implements libstp::kinematics::IKinematics.
|
inline |
Definition at line 67 of file differential.hpp.
|
nodiscardoverridevirtual |
Differential drivetrains cannot command lateral motion directly.
Implements libstp::kinematics::IKinematics.
|
nodiscardoverridevirtual |
Always returns 2.
Implements libstp::kinematics::IKinematics.