11#include <initializer_list>
36 MotorGroup(
const std::initializer_list<std::shared_ptr<AbstractMotor>> &imotors,
58 std::int32_t
moveAbsolute(
double iposition, std::int32_t ivelocity)
override;
74 std::int32_t
moveRelative(
double iposition, std::int32_t ivelocity)
override;
387 std::shared_ptr<ContinuousRotarySensor>
getEncoder()
override;
395 virtual std::shared_ptr<ContinuousRotarySensor>
getEncoder(std::size_t index);
398 std::vector<std::shared_ptr<AbstractMotor>>
motors;
brakeMode
Indicates the 'brake mode' of a motor.
gearset
Indicates the internal gear ratio of a motor.
encoderUnits
Indicates the units used by the motor encoders.
static std::shared_ptr< Logger > getDefaultLogger()
std::vector< std::shared_ptr< AbstractMotor > > motors
virtual std::shared_ptr< ContinuousRotarySensor > getEncoder(std::size_t index)
Get the encoder associated with this motor.
double getEfficiency() override
Gets the efficiency of the motor in percent.
std::int32_t setVoltageLimit(std::int32_t ilimit) override
Sets the voltage limit for the motor in Volts.
uint32_t getFaults() override
Gets the faults experienced by the motor.
std::int32_t setBrakeMode(AbstractMotor::brakeMode imode) override
Motor configuration functions
gearset getGearing() override
Gets the gearset that was set for the motor.
encoderUnits getEncoderUnits() override
Gets the encoder units that were set for the motor.
std::int32_t getVoltage() override
Gets the voltage delivered to the motor in millivolts.
MotorGroup(const std::initializer_list< std::shared_ptr< AbstractMotor > > &imotors, const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
A group of V5 motors which act as one motor (i.e.
size_t getSize()
Gets the number of motors in the motor group.
std::int32_t moveRelative(double iposition, std::int32_t ivelocity) override
Sets the relative target position for the motor to move to.
std::int32_t isStopped() override
Checks if the motor is stopped.
std::int32_t getDirection() override
Gets the direction of movement for the motor.
std::int32_t setReversed(bool ireverse) override
Sets the reverse flag for the motor.
std::int32_t setGearing(AbstractMotor::gearset igearset) override
Sets one of AbstractMotor::gearset for the motor.
double getTorque() override
Gets the torque generated by the motor in Newton Metres (Nm).
std::int32_t tarePosition() override
Sets the "absolute" zero position of the motor to its current position.
uint32_t getFlags() override
Gets the flags set by the motor's operation.
double getActualVelocity() override
Gets the actual velocity of the motor.
std::int32_t getCurrentDraw() override
Gets the current drawn by the motor in mA.
std::int32_t isOverTemp() override
Checks if the motor's temperature is above its limit.
std::int32_t modifyProfiledVelocity(std::int32_t ivelocity) override
Changes the output velocity for a profiled movement (moveAbsolute or moveRelative).
double getPower() override
Gets the power drawn by the motor in Watts.
MotorGroup(const std::initializer_list< Motor > &imotors, const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
A group of V5 motors which act as one motor (i.e.
double getPosition() override
Gets the absolute position of the motor in its encoder units.
std::int32_t setCurrentLimit(std::int32_t ilimit) override
Sets the current limit for the motor in mA.
std::int32_t getTargetVelocity() override
Gets the velocity commanded to the motor by the user.
std::shared_ptr< ContinuousRotarySensor > getEncoder() override
Get the encoder associated with the first motor in this group.
std::int32_t getZeroPositionFlag() override
Checks if the motor is at its zero position.
void controllerSet(double ivalue) override
Writes the value of the controller output.
std::int32_t moveVelocity(std::int16_t ivelocity) override
Sets the velocity for the motor.
std::int32_t isOverCurrent() override
Checks if the motor is drawing over its current limit.
std::int32_t getRawPosition(std::uint32_t *timestamp) override
Gets the raw encoder count of the motor at a given timestamp.
double getTemperature() override
Gets the temperature of the motor in degrees Celsius.
std::int32_t moveVoltage(std::int16_t ivoltage) override
Sets the voltage for the motor from -12000 to 12000.
std::int32_t setEncoderUnits(AbstractMotor::encoderUnits iunits) override
Sets one of AbstractMotor::encoderUnits for the motor encoder.
double getTargetPosition() override
Motor telemetry functions
brakeMode getBrakeMode() override
Gets the brake mode that was set for the motor.
std::int32_t getCurrentLimit() override
Gets the current limit for the motor in mA.
std::int32_t moveAbsolute(double iposition, std::int32_t ivelocity) override
Motor movement functions