pros::v5::AbstractMotor class

Derived classes

class Motor
class MotorGroup virtual

Motor movement functions

These functions allow programmers to make motors move

std::int32_t move(std::int32_t voltage) const pure virtual
Sets the voltage for the motor from -127 to 127.
std::int32_t move_absolute(const double position, const std::int32_t velocity) const pure virtual
Sets the target absolute position for the motor to move to.
std::int32_t move_relative(const double position, const std::int32_t velocity) const pure virtual
Sets the relative target position for the motor to move to.
std::int32_t move_velocity(const std::int32_t velocity) const pure virtual
Sets the velocity for the motor.
std::int32_t move_voltage(const std::int32_t voltage) const pure virtual
Sets the output voltage for the motor from -12000 to 12000 in millivolts.
std::int32_t brake(void) const pure virtual
Stops the motor using the currently configured brake mode.
std::int32_t modify_profiled_velocity(const std::int32_t velocity) const pure virtual
Changes the output velocity for a profiled movement (motor_move_absolute or motor_move_relative).
double get_target_position(const std::uint8_t index = 0) const pure virtual
Gets the target position set for the motor by the user, with a parameter for the motor index.
std::vector<double> get_target_position_all(void) const pure virtual
Gets a vector containing the target position(s) set for the motor(s) by the user.
std::int32_t get_target_velocity(const std::uint8_t index = 0) const pure virtual
Gets the velocity commanded to the motor by the user.
std::vector<std::int32_t> get_target_velocity_all(void) const pure virtual
Gets a vector containing the velocity/velocities commanded to the motor(s) by the user.

Motor telemetry functions

double get_actual_velocity(const std::uint8_t index = 0) const pure virtual
Gets the actual velocity of the motor.
std::vector<double> get_actual_velocity_all(void) const pure virtual
Gets a vector containing the actual velocity/velocities of the motor(s)
std::int32_t get_current_draw(const std::uint8_t index = 0) const pure virtual
Gets the current drawn by the motor in mA.
std::vector<std::int32_t> get_current_draw_all(void) const pure virtual
Gets a vector containing the current(s) drawn by the motor(s) in mA.
std::int32_t get_direction(const std::uint8_t index = 0) const pure virtual
Gets the direction of movement for the motor.
std::vector<std::int32_t> get_direction_all(void) const pure virtual
Gets a vector containing the direction(s) of movement for the motor(s).
double get_efficiency(const std::uint8_t index = 0) const pure virtual
Gets the efficiency of the motor in percent.
std::vector<double> get_efficiency_all(void) const pure virtual
Gets a vector containing the efficiency/efficiencies of the motor(s) in percent.
std::uint32_t get_faults(const std::uint8_t index = 0) const pure virtual
Gets the faults experienced by the motor.
std::vector<std::uint32_t> get_faults_all(void) const pure virtual
Gets a vector of the faults experienced by the motor(s).
std::uint32_t get_flags(const std::uint8_t index = 0) const pure virtual
Gets the flags set by the motor's operation.
std::vector<std::uint32_t> get_flags_all(void) const pure virtual
Gets a vector of the flags set by the motor's/motors' operation.
double get_position(const std::uint8_t index = 0) const pure virtual
Gets the absolute position of the motor in its encoder units.
std::vector<double> get_position_all(void) const pure virtual
Gets a vector containing the absolute position(s) of the motor(s) in its encoder units.
double get_power(const std::uint8_t index = 0) const pure virtual
Gets the power drawn by the motor in Watts.
std::vector<double> get_power_all(void) const pure virtual
Gets a vector containing the power(s) drawn by the motor(s) in Watts.
std::int32_t get_raw_position(std::uint32_t*const timestamp, const std::uint8_t index = 0) const pure virtual
Gets the raw encoder count of the motor at a given timestamp.
std::vector<std::int32_t> get_raw_position_all(std::uint32_t*const timestamp) const pure virtual
Gets a vector of the raw encoder count(s) of the motor(s) at a given timestamp.
double get_temperature(const std::uint8_t index = 0) const pure virtual
Gets the temperature of the motor in degrees Celsius.
std::vector<double> get_temperature_all(void) const pure virtual
Gets a vector of the temperature(s) of the motor(s) in degrees Celsius.
double get_torque(const std::uint8_t index = 0) const pure virtual
Gets the torque generated by the motor in Newton Meters (Nm).
std::vector<double> get_torque_all(void) const pure virtual
Gets a vector of the torque(s) generated by the motor(s) in Newton Meters (Nm).
std::int32_t get_voltage(const std::uint8_t index = 0) const pure virtual
Gets the voltage delivered to the motor in millivolts.
std::vector<std::int32_t> get_voltage_all(void) const pure virtual
Gets a vector of the voltage(s) delivered to the motor(s) in millivolts.
std::int32_t is_over_current(const std::uint8_t index = 0) const pure virtual
Checks if the motor is drawing over its current limit.
std::vector<std::int32_t> is_over_current_all(void) const pure virtual
Gets a vector of whether each motor is drawing over its current limit.
std::int32_t is_over_temp(const std::uint8_t index = 0) const pure virtual
Gets the temperature limit flag for the motor.
std::vector<std::int32_t> is_over_temp_all(void) const pure virtual
Gets a vector of the temperature limit flag(s) for the motor(s).

Motor configuration functions

MotorBrake get_brake_mode(const std::uint8_t index = 0) const pure virtual
Gets the brake mode that was set for the motor.
std::vector<MotorBrake> get_brake_mode_all(void) const pure virtual
Gets a vector of the brake mode(s) that was set for the motor(s).
std::int32_t get_current_limit(const std::uint8_t index = 0) const pure virtual
Gets the current limit for the motor in mA.
std::vector<std::int32_t> get_current_limit_all(void) const pure virtual
Gets a vector of the current limit(s) for the motor(s) in mA.
MotorUnits get_encoder_units(const std::uint8_t index = 0) const pure virtual
Gets the encoder units that were set for the motor.
std::vector<MotorUnits> get_encoder_units_all(void) const pure virtual
Gets a vector of the encoder units that were set for the motor(s).
MotorGears get_gearing(const std::uint8_t index = 0) const pure virtual
Gets the gearset that was set for the motor.
std::vector<MotorGears> get_gearing_all(void) const pure virtual
Gets a vector of the gearset(s) that was/were set for the motor(s).
std::vector<std::int8_t> get_port_all(void) const pure virtual
Gets returns a vector with all the port numbers in the motor group.
std::int32_t get_voltage_limit(const std::uint8_t index = 0) const pure virtual
Gets the voltage limit set by the user.
std::vector<std::int32_t> get_voltage_limit_all(void) const pure virtual
Gets a vector of the voltage limit(s) set by the user.
std::int32_t is_reversed(const std::uint8_t index = 0) const pure virtual
Gets the operation direction of the motor as set by the user.
std::vector<std::int32_t> is_reversed_all(void) const pure virtual
Gets a vector of the operation direction(s) of the motor(s) as set by the user.
std::int32_t set_brake_mode(const MotorBrake mode, const std::uint8_t index = 0) const pure virtual
Sets one of MotorBrake to the motor.
std::int32_t set_brake_mode(const pros::motor_brake_mode_e_t mode, const std::uint8_t index = 0) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_brake_mode_all(const MotorBrake mode) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_brake_mode_all(const pros::motor_brake_mode_e_t mode) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_current_limit(const std::int32_t limit, const std::uint8_t index = 0) const pure virtual
Sets the current limit for the motor in mA.
std::int32_t set_current_limit_all(const std::int32_t limit) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_encoder_units(const MotorUnits units, const std::uint8_t index = 0) const pure virtual
Sets one of MotorUnits for the motor encoder.
std::int32_t set_encoder_units(const pros::motor_encoder_units_e_t units, const std::uint8_t index = 0) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_encoder_units_all(const MotorUnits units) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_encoder_units_all(const pros::motor_encoder_units_e_t units) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_gearing(const MotorGears gearset, const std::uint8_t index = 0) const pure virtual
Sets one of the gear cartridge (red, green, blue) for the motor.
std::int32_t set_gearing(const pros::motor_gearset_e_t gearset, const std::uint8_t index = 0) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_gearing_all(const MotorGears gearset) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_gearing_all(const pros::motor_gearset_e_t gearset) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_reversed(const bool reverse, const std::uint8_t index = 0) pure virtual
Sets the reverse flag for the motor.
std::int32_t set_reversed_all(const bool reverse) pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_voltage_limit(const std::int32_t limit, const std::uint8_t index = 0) const pure virtual
Sets the voltage limit for the motor in Volts.
std::int32_t set_voltage_limit_all(const std::int32_t limit) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t set_zero_position(const double position, const std::uint8_t index = 0) const pure virtual
Sets the position for the motor in its encoder units.
std::int32_t set_zero_position_all(const double position) const pure virtual
Gets the brake mode that was set for the motor.
std::int32_t tare_position(const std::uint8_t index = 0) const pure virtual
Sets the "absolute" zero position of the motor to its current position.
std::int32_t tare_position_all(void) const pure virtual
Gets the brake mode that was set for the motor.
std::int8_t get_port(const std::uint8_t index = 0) const pure virtual
Gets the brake mode that was set for the motor.
std::int8_t size(void) const pure virtual
Returns the number of objects.