58 std::int32_t
moveAbsolute(
double iposition, std::int32_t ivelocity)
override;
74 std::int32_t
moveRelative(
double iposition, std::int32_t ivelocity)
override;
370 virtual std::int32_t
setPosPID(
double ikF,
double ikP,
double ikI,
double ikD);
404 virtual std::int32_t
setVelPID(
double ikF,
double ikP,
double ikI,
double ikD);
433 std::shared_ptr<ContinuousRotarySensor>
getEncoder()
override;
PROS API header provides high-level user functionality.
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()
double getActualVelocity() override
Gets the actual velocity of the motor.
void controllerSet(double ivalue) override
Writes the value of the controller output.
std::int32_t getZeroPositionFlag() override
Checks if the motor is at its zero position.
std::int32_t setBrakeMode(AbstractMotor::brakeMode imode) override
Motor configuration functions
std::int32_t moveRelative(double iposition, std::int32_t ivelocity) override
Sets the relative target position for the motor to move to.
Motor(std::uint8_t iport, bool ireverse, AbstractMotor::gearset igearset, AbstractMotor::encoderUnits iencoderUnits, const std::shared_ptr< Logger > &logger=Logger::getDefaultLogger())
A V5 motor.
double getPosition() override
Gets the absolute position of the motor in its encoder units.
double getTorque() override
Gets the torque generated by the motor in Newton Metres (Nm).
std::int32_t setReversed(bool ireverse) override
Sets the reverse flag for the motor.
std::shared_ptr< ContinuousRotarySensor > getEncoder() override
Get the encoder associated with this motor.
std::int32_t setVoltageLimit(std::int32_t ilimit) override
Sets the voltage limit for the motor in Volts.
virtual std::int32_t setVelPID(double ikF, double ikP, double ikI, double ikD)
Sets new PID constants.
std::int32_t moveAbsolute(double iposition, std::int32_t ivelocity) override
Motor movement functions
std::int32_t moveVoltage(std::int16_t ivoltage) override
Sets the voltage for the motor from -12000 to 12000.
Motor(std::int8_t iport)
A V5 motor.
std::int32_t setGearing(AbstractMotor::gearset igearset) override
Sets one of AbstractMotor::gearset for the motor.
std::int32_t getDirection() override
Gets the direction of movement for the motor.
std::int32_t getRawPosition(std::uint32_t *timestamp) override
Gets the raw encoder count of the motor at a given timestamp.
double getEfficiency() override
Gets the efficiency of the motor in percent.
uint32_t getFaults() override
Gets the faults experienced by the motor.
virtual std::int32_t setVelPIDFull(double ikF, double ikP, double ikI, double ikD, double ifilter, double ilimit, double ithreshold, double iloopSpeed)
Sets new PID constants.
gearset getGearing() override
Gets the gearset that was set for the motor.
std::int32_t modifyProfiledVelocity(std::int32_t ivelocity) override
Changes the output velocity for a profiled movement (moveAbsolute or moveRelative).
encoderUnits getEncoderUnits() override
Gets the encoder units that were set for the motor.
std::int32_t isOverTemp() override
Checks if the motor's temperature is above its limit.
std::int32_t setEncoderUnits(AbstractMotor::encoderUnits iunits) override
Sets one of AbstractMotor::encoderUnits for the motor encoder.
double getPower() override
Gets the power drawn by the motor in Watts.
std::int32_t tarePosition() override
Sets the "absolute" zero position of the motor to its current position.
std::int32_t isStopped() override
Checks if the motor is stopped.
std::int32_t setCurrentLimit(std::int32_t ilimit) override
Sets the current limit for the motor in mA.
double getTemperature() override
Gets the temperature of the motor in degrees Celsius.
brakeMode getBrakeMode() override
Gets the brake mode that was set for the motor.
std::uint8_t getPort() const
std::int32_t getCurrentDraw() override
Gets the current drawn by the motor in mA.
uint32_t getFlags() override
Gets the flags set by the motor's operation.
virtual std::int32_t setPosPIDFull(double ikF, double ikP, double ikI, double ikD, double ifilter, double ilimit, double ithreshold, double iloopSpeed)
Sets new PID constants.
std::int32_t getCurrentLimit() override
Gets the current limit for the motor in mA.
virtual std::int32_t setPosPID(double ikF, double ikP, double ikI, double ikD)
Sets new PID constants.
std::int32_t getTargetVelocity() override
Gets the velocity commanded to the motor by the user.
double getTargetPosition() override
Motor telemetry functions
std::int32_t getVoltage() override
Gets the voltage delivered to the motor in millivolts.
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.