92 virtual std::int32_t
moveAbsolute(
double iposition, std::int32_t ivelocity) = 0;
111 virtual std::int32_t
moveRelative(
double iposition, std::int32_t ivelocity) = 0;
532 virtual std::shared_ptr<ContinuousRotarySensor>
getEncoder() = 0;
virtual std::int32_t getZeroPositionFlag()=0
Checks if the motor is at its zero position.
brakeMode
Indicates the 'brake mode' of a motor.
@ coast
Motor coasts when stopped, traditional behavior.
@ hold
Motor actively holds position when stopped.
@ brake
Motor brakes when stopped.
virtual double getTargetPosition()=0
Motor telemetry functions
virtual brakeMode getBrakeMode()=0
Gets the brake mode that was set for the motor.
virtual std::int32_t moveVoltage(std::int16_t ivoltage)=0
Sets the voltage for the motor from -12000 to 12000.
virtual std::int32_t modifyProfiledVelocity(std::int32_t ivelocity)=0
Changes the output velocity for a profiled movement (moveAbsolute or moveRelative).
virtual double getEfficiency()=0
Gets the efficiency of the motor in percent.
virtual std::int32_t setVoltageLimit(std::int32_t ilimit)=0
Sets the voltage limit for the motor in Volts.
virtual std::int32_t moveVelocity(std::int16_t ivelocity)=0
Sets the velocity for the motor.
virtual std::int32_t isOverCurrent()=0
Checks if the motor is drawing over its current limit.
virtual double getActualVelocity()=0
Gets the actual velocity of the motor.
virtual double getPosition()=0
Gets the absolute position of the motor in its encoder units.
virtual std::int32_t moveRelative(double iposition, std::int32_t ivelocity)=0
Sets the relative target position for the motor to move to.
virtual std::int32_t isOverTemp()=0
Checks if the motor's temperature is above its limit.
virtual std::int32_t setReversed(bool ireverse)=0
Sets the reverse flag for the motor.
virtual std::int32_t getCurrentDraw()=0
Gets the current drawn by the motor in mA.
virtual std::int32_t getVoltage()=0
Gets the voltage delivered to the motor in millivolts.
gearset
Indicates the internal gear ratio of a motor.
@ blue
6:1, 600 RPM, Blue gear set
@ green
18:1, 200 RPM, Green gear set
@ red
36:1, 100 RPM, Red gear set
virtual std::int32_t getDirection()=0
Gets the direction of movement for the motor.
virtual double getTorque()=0
Gets the torque generated by the motor in Newton Metres (Nm).
virtual std::int32_t getTargetVelocity()=0
Gets the velocity commanded to the motor by the user.
virtual double getTemperature()=0
Gets the temperature of the motor in degrees Celsius.
virtual std::int32_t getRawPosition(std::uint32_t *timestamp)=0
Gets the raw encoder count of the motor at a given timestamp.
virtual std::int32_t isStopped()=0
Checks if the motor is stopped.
virtual uint32_t getFlags()=0
Gets the flags set by the motor's operation.
virtual std::int32_t setEncoderUnits(encoderUnits iunits)=0
Sets one of encoderUnits for the motor encoder.
double getPositionError()
Gets the positional error (target position minus actual position) of the motor in its encoder units.
virtual std::int32_t getCurrentLimit()=0
Gets the current limit for the motor in mA.
virtual std::int32_t moveAbsolute(double iposition, std::int32_t ivelocity)=0
Motor movement functions
virtual std::int32_t setGearing(gearset igearset)=0
Sets one of gearset for the motor.
virtual std::int32_t tarePosition()=0
Sets the "absolute" zero position of the motor to its current position.
virtual std::shared_ptr< ContinuousRotarySensor > getEncoder()=0
Returns the encoder associated with this motor.
double getVelocityError()
Gets the difference between the target velocity of the motor and the actual velocity of the motor.
virtual gearset getGearing()=0
Gets the gearset that was set for the motor.
virtual uint32_t getFaults()=0
Gets the faults experienced by the motor.
encoderUnits
Indicates the units used by the motor encoders.
virtual encoderUnits getEncoderUnits()=0
Gets the encoder units that were set for the motor.
virtual std::int32_t setCurrentLimit(std::int32_t ilimit)=0
Sets the current limit for the motor in mA.
virtual double getPower()=0
Gets the power drawn by the motor in Watts.
virtual std::int32_t setBrakeMode(brakeMode imode)=0
Motor configuration functions
AbstractMotor::GearsetRatioPair operator*(AbstractMotor::gearset gearset, double ratio)
A simple structure representing the full ratio between motor and wheel.
~GearsetRatioPair()=default
GearsetRatioPair(const gearset igearset, const double iratio=1)
A simple structure representing the full ratio between motor and wheel.