RBControl
Library for the RB3201-RBControl board with the ESP32 by RoboticsBrno.
|
Helper class for building the motor change event. More...
#include <RBControl_manager.hpp>
Public Member Functions | |
MotorChangeBuilder (Manager &manager) | |
MotorChangeBuilder (const MotorChangeBuilder &o)=delete | |
MotorChangeBuilder (MotorChangeBuilder &&o) | |
~MotorChangeBuilder () | |
MotorChangeBuilder & | power (MotorId id, int8_t value) |
Set single motor power. More... | |
MotorChangeBuilder & | pwmMaxPercent (MotorId id, int8_t percent) |
Limit motor index's power to percent. More... | |
MotorChangeBuilder & | stop (MotorId id) |
Stop motor. More... | |
void | set (bool toFront=false) |
Finish the changes and submit the events. More... | |
Helper class for building the motor change event.
rb::MotorChangeBuilder::MotorChangeBuilder | ( | Manager & | manager | ) |
|
delete |
rb::MotorChangeBuilder::MotorChangeBuilder | ( | MotorChangeBuilder && | o | ) |
rb::MotorChangeBuilder::~MotorChangeBuilder | ( | ) |
MotorChangeBuilder & rb::MotorChangeBuilder::power | ( | MotorId | id, |
int8_t | value | ||
) |
Set single motor power.
id | of the motor (e.g. rb:MotorId::M1) |
power | of the motor <-100 - 100> |
MotorChangeBuilder & rb::MotorChangeBuilder::pwmMaxPercent | ( | MotorId | id, |
int8_t | percent | ||
) |
Limit motor index's power to percent.
id | of the motor (e.g. rb:MotorId::M1) |
percent | of the maximal power of the motor <0 - 100> |
void rb::MotorChangeBuilder::set | ( | bool | toFront = false | ) |
Finish the changes and submit the events.
toFront | add this event to front of the event queue |
MotorChangeBuilder & rb::MotorChangeBuilder::stop | ( | MotorId | id | ) |
Stop motor.
id | of the motor (e.g. rb:MotorId::M1) |