17class MotorChangeBuilder;
28 int32_t
position()
const {
return m_position; }
36 void power(int16_t value);
42 void speed(int16_t ticksPerSecond);
48 void brake(uint16_t brakingPower);
71 void driveToValue(int32_t positionAbsolute, int16_t speedTicksPerSecond,
84 void drive(int32_t positionRelative, int16_t speedTicksPerSecond,
105 void sendPositionReq(
bool additive,
106 const CoprocReq_MotorReq_SetPosition& req,
callback_t&& callback);
107 void sendMotorReq(
const CoprocReq_MotorReq& req);
108 void onMotorStat(
const CoprocStat_MotorStat& msg);
110 int16_t scale(int16_t val);
113 std::vector<callback_t> m_infoCbs;
114 CoprocReq_MotorReq m_lastReq;
123 int8_t m_pwm_max_percent;
The main library class for working with the RBCX board. Call the install() method at the start of you...
Definition: RBCXManager.h:61
Helper class for building the motor change event.
Definition: RBCXManager.h:198
Definition: RBCXMotor.h:19
int8_t pwmMaxPercent() const
Get current maximum PWM percent value.
Definition: RBCXMotor.h:62
MotorId id() const
Definition: RBCXMotor.h:26
void brake(uint16_t brakingPower)
Start braking.
Definition: RBCXMotor.cpp:62
void setCurrentPosition(int32_t pos=0)
Set the encoder tick counter to some value.
Definition: RBCXMotor.cpp:121
void power(int16_t value)
Set motor power.
Definition: RBCXMotor.cpp:42
void driveToValue(int32_t positionAbsolute, int16_t speedTicksPerSecond, callback_t callback=nullptr)
Drive motor to set position (according absolute value).
Definition: RBCXMotor.cpp:76
int32_t position() const
Definition: RBCXMotor.h:28
void setConfig(const MotorConfig &cfg)
Set configuration, see MotorConfig & STM32 firmware.
Definition: RBCXMotor.cpp:101
void requestInfo(callback_t cb)
Definition: RBCXMotor.cpp:19
void speed(int16_t ticksPerSecond)
Set motor speed.
Definition: RBCXMotor.cpp:52
void drive(int32_t positionRelative, int16_t speedTicksPerSecond, callback_t callback=nullptr)
Drive motor to set position (according relative value).
Definition: RBCXMotor.cpp:89
std::function< void(Motor &)> callback_t
Definition: RBCXMotor.h:24
Definition: RBCXAngle.cpp:3
MotorId
Definition: RBCXPinout.h:8