Skip to content

Class Motor

ClassList > Motor

Abstract base class for all motor drivers.

  • #include <motor.hpp>

Inherited by the following classes: DRVMotor, SNMotor

Public Functions

Type Name
virtual void coast () = 0
Let the motor coast (no braking force).
virtual void forward (float duty) = 0
Drive forward at the given PWM duty cycle [0, 1].
virtual void hard_brake () = 0
Apply electronic braking immediately.
virtual void reverse (float duty) = 0
Drive in reverse at the given PWM duty cycle [0, 1].
virtual void set_speed (float speed) = 0
Set motor speed in [-1, 1] (negative = reverse).
virtual ~Motor () = default

Public Functions Documentation

function coast

Let the motor coast (no braking force).

virtual void Motor::coast () = 0

function forward

Drive forward at the given PWM duty cycle [0, 1].

virtual void Motor::forward (
    float duty
) = 0

function hard_brake

Apply electronic braking immediately.

virtual void Motor::hard_brake () = 0

function reverse

Drive in reverse at the given PWM duty cycle [0, 1].

virtual void Motor::reverse (
    float duty
) = 0

function set_speed

Set motor speed in [-1, 1] (negative = reverse).

virtual void Motor::set_speed (
    float speed
) = 0

function ~Motor

virtual Motor::~Motor () = default


The documentation for this class was generated from the following file controls/sae_2025_ws/src/payload/include/payload/motor.hpp