trikRuntime
|
TRIK servomotor. More...
#include <servoMotor.h>
Public Slots | |
int | power () const override |
int | frequency () const |
Returns currently set frequency of PWM signal supplied to the motor. More... | |
int | duty () const |
Returns currently set duty of PWM signal supplied to the motor. More... | |
void | powerOff () override |
void | setPower (int power, bool constrain=true) override |
For angular servos sets current motor angle to specified value. More... | |
void | brake (int=0) override |
void | setPeriod (int uSec=20000) override |
Public Slots inherited from trikControl::MotorInterface | |
virtual void | setPower (int power, bool constrain=true)=0 |
Sets current motor power to specified value, 0 to stop motor. More... | |
virtual int | power () const =0 |
Returns currently set power of a motor. More... | |
virtual void | powerOff ()=0 |
Turns off motor. More... | |
virtual void | brake (int durationMs=500)=0 |
Force brake state for durationMs and then powerOff() More... | |
virtual void | setPeriod (int uSec=20000)=0 |
Set period for PWM generator. More... | |
Public Member Functions | |
ServoMotor (const QString &port, const trikKernel::Configurer &configurer, const trikHal::HardwareAbstractionInterface &hardwareAbstraction) | |
Constructor. More... | |
~ServoMotor () override | |
Status | status () const override |
Returns current status of the device. More... | |
int | minControl () const override |
Returns minimal value of control accepted by a motor (-90..90, 0..100, for example). More... | |
int | maxControl () const override |
Returns maximal value of control accepted by a motor (-90..90, 0..100, for example). More... | |
Public Member Functions inherited from trikControl::DeviceInterface | |
DeviceInterface ()=default | |
virtual | ~DeviceInterface ()=default |
Additional Inherited Members | |
Public Types inherited from trikControl::MotorInterface | |
enum | Type { Type::powerMotor, Type::servoMotor } |
Public Types inherited from trikControl::DeviceInterface | |
enum | Status { Status::permanentFailure, Status::temporaryFailure, Status::off, Status::starting, Status::ready, Status::stopping } |
Device status. More... | |
Static Public Member Functions inherited from trikControl::DeviceInterface | |
static Status | combine (const DeviceInterface &underlying, const DeviceInterface::Status &dependent) |
Helper method to return status of a device relying on other device to work. More... | |
TRIK servomotor.
ServoMotor::ServoMotor | ( | const QString & | port, |
const trikKernel::Configurer & | configurer, | ||
const trikHal::HardwareAbstractionInterface & | hardwareAbstraction | ||
) |
Constructor.
port | - port on which this motor is configured. |
configurer | - configurer object containing preparsed XML files with motor parameters. |
|
override |
|
inlineoverrideslot |
Makes no sense, neither for angular servo nor for rotational
|
slot |
Returns currently set duty of PWM signal supplied to the motor.
|
slot |
Returns currently set frequency of PWM signal supplied to the motor.
|
overridevirtual |
Returns maximal value of control accepted by a motor (-90..90, 0..100, for example).
Implements trikControl::MotorInterface.
|
overridevirtual |
Returns minimal value of control accepted by a motor (-90..90, 0..100, for example).
Implements trikControl::MotorInterface.
|
overrideslot |
|
overrideslot |
|
overrideslot |
|
overrideslot |
For angular servos sets current motor angle to specified value.
For continious rotation servos sets power of a motor.
power | - for angular servos — servo shaft angle, allowed values are from -90 to 90, for continious rotation servos — power, allowed values are from -100 to 100. |
constrain | - if true, power will be constrained in an interval [-100, 100], if false, "power" value will be sent to a motor unaltered. |
|
overridevirtual |
Returns current status of the device.
Implements trikControl::DeviceInterface.