Skip to content

Commit

Permalink
Merge branch 'pros-4/docs' into develop-pros-4
Browse files Browse the repository at this point in the history
  • Loading branch information
noam987 authored May 5, 2024
2 parents 3301261 + c445161 commit 0b98d82
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 64 deletions.
30 changes: 15 additions & 15 deletions include/pros/abstract_motor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace pros {
inline namespace v5 {

/**
* \enum motor_brake
* \enum MotorBrake
* Indicates the current 'brake mode' of a motor.
*/
enum class MotorBrake {
Expand All @@ -42,7 +42,7 @@ enum class MotorBrake {
};

/**
* \enum Motor_Encoder_Units
* \enum MotorEncoderUnits
* Indicates the units used by the motor encoders.
*/
enum class MotorEncoderUnits {
Expand All @@ -53,7 +53,7 @@ enum class MotorEncoderUnits {
invalid = INT32_MAX ///< Invalid motor encoder units
};

// Alias for Motor_Encoder_Units
// Alias for MotorEncoderUnits
using MotorUnits = MotorEncoderUnits;

enum class MotorGears {
Expand All @@ -70,7 +70,7 @@ enum class MotorGears {
};


// Provide Aliases for Motor_Gears
// Provide Aliases for MotorGears
using MotorGearset = MotorGears;
using MotorCart = MotorGears;
using MotorCartridge = MotorGears;
Expand Down Expand Up @@ -759,7 +759,7 @@ class AbstractMotor {
* The index of the motor to get the target position of.
* By default index is 0, and will return an error for an out of bounds index
*
* \return One of Motor_Brake, according to what was set for the
* \return One of MotorBrake, according to what was set for the
* motor, or E_MOTOR_BRAKE_INVALID if the operation failed, setting errno.
*/
virtual MotorBrake get_brake_mode(const std::uint8_t index = 0) const = 0;
Expand All @@ -775,7 +775,7 @@ class AbstractMotor {
* The index of the motor to get the target position of.
* By default index is 0, and will return an error for an out of bounds index
*
* \return A vector containing Motor_Brake(s), according to what was set for the
* \return A vector containing MotorBrake(s), according to what was set for the
* motor(s), or E_MOTOR_BRAKE_INVALID if the operation failed, setting errno.
*/
virtual std::vector<MotorBrake> get_brake_mode_all(void) const = 0;
Expand Down Expand Up @@ -827,7 +827,7 @@ class AbstractMotor {
* The index of the motor to get the target position of.
* By default index is 0, and will return an error for an out of bounds index
*
* \return One of Motor_Units according to what is set for the
* \return One of MotorUnits according to what is set for the
* motor or E_MOTOR_ENCODER_INVALID if the operation failed.
*/
virtual MotorUnits get_encoder_units(const std::uint8_t index = 0) const = 0;
Expand All @@ -843,7 +843,7 @@ class AbstractMotor {
* The index of the motor to get the target position of.
* By default index is 0, and will return an error for an out of bounds index
*
* \return A vector of Motor_Units according to what is set for the
* \return A vector of MotorUnits according to what is set for the
* motor(s) or E_MOTOR_ENCODER_INVALID if the operation failed.
*/
virtual std::vector<MotorUnits> get_encoder_units_all(void) const = 0;
Expand All @@ -859,8 +859,8 @@ class AbstractMotor {
* The index of the motor to get the target position of.
* By default index is 0, and will return an error for an out of bounds index
*
* \return One of Motor_Gears according to what is set for the motor,
* or pros::Motor_Gears::invalid if the operation failed.
* \return One of MotorGears according to what is set for the motor,
* or pros::MotorGears::invalid if the operation failed.
*/
virtual MotorGears get_gearing(const std::uint8_t index = 0) const = 0;

Expand All @@ -875,8 +875,8 @@ class AbstractMotor {
* The index of the motor to get the target position of.
* By default index is 0, and will return an error for an out of bounds index
*
* \return A vector of Motor_Gears according to what is set for the motor(s),
* or pros::Motor_Gears::invalid if the operation failed.
* \return A vector of MotorGears according to what is set for the motor(s),
* or pros::MotorGears::invalid if the operation failed.
*/
virtual std::vector<MotorGears> get_gearing_all(void) const = 0;

Expand Down Expand Up @@ -958,15 +958,15 @@ class AbstractMotor {
virtual std::vector<std::int32_t> is_reversed_all(void) const = 0;

/**
* Sets one of Motor_Brake to the motor. Works with the C enum
* Sets one of MotorBrake to the motor. Works with the C enum
* and the C++ enum class.
*
* This function uses the following values of errno when an error state is
* reached:
* ENODEV - The port cannot be configured as a motor
*
* \param mode
* The Motor_Brake to set for the motor
* The MotorBrake to set for the motor
*
* \param index Optional parameter.
* The index of the motor to get the target position of.
Expand Down Expand Up @@ -999,7 +999,7 @@ class AbstractMotor {
virtual std::int32_t set_current_limit(const std::int32_t limit, const std::uint8_t index = 0) const = 0;
virtual std::int32_t set_current_limit_all(const std::int32_t limit) const = 0;
/**
* Sets one of Motor_Units for the motor encoder. Works with the C
* Sets one of MotorUnits for the motor encoder. Works with the C
* enum and the C++ enum class.
*
* This function uses the following values of errno when an error state is
Expand Down
4 changes: 2 additions & 2 deletions include/pros/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ namespace pros {
* \brief Enum for the type of link (TX or RX)
*/
typedef enum link_type_e {
E_LINK_RECEIVER = 0, ///< Indicates that the radio is a receiver.
E_LINK_RECIEVER = 0, ///< Indicates that the radio is a reciever.
E_LINK_TRANSMITTER, ///< Indicates that the link is a transmitter.
E_LINK_RX = E_LINK_RECEIVER, ///< Alias for E_LINK_RECEIVER
E_LINK_RX = E_LINK_RECIEVER, ///< Alias for E_LINK_RECIEVER
E_LINK_TX = E_LINK_TRANSMITTER ///< Alias for E_LINK_TRANSMITTER
} link_type_e_t;

Expand Down
46 changes: 24 additions & 22 deletions include/pros/motor_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* \defgroup cpp-motor-group Motor Groups C++ API
* \defgroup cpp-motor-group Motors C++ API
* \note Additional example code for this module can be found in its [Tutorial](@ref motors).
*/

#ifndef _PROS_MOTOR_GROUP_HPP_
Expand Down Expand Up @@ -91,6 +92,7 @@ class MotorGroup : public virtual AbstractMotor {
* telemetry in order to produce consistant behavior with non-reversed motors
*
* \param gearset = pros::v5::MotorGears::invalid
* \param gearset = pros::v5::MotorGears::green
* Optional parameter for the gearset for the motor.
* Does not explicitly set the motor gearset if it is invalid or not specified
*
Expand Down Expand Up @@ -440,7 +442,7 @@ class MotorGroup : public virtual AbstractMotor {
* }
* \endcode
*/
double get_target_position(const std::uint8_t index = 0) const;
double get_target_position(const std::uint8_t index) const;

/**
* Gets a vector of the the target positions set for the motor group
Expand Down Expand Up @@ -1361,7 +1363,7 @@ class MotorGroup : public virtual AbstractMotor {
* \param index Optional parameter, 0 by default.
* The zero indexed index of the motor in the motor group
*
* \return One of Motor_Brake, according to what was set for the
* \return One of MotorBrake, according to what was set for the
* motor, or E_MOTOR_BRAKE_INVALID if the operation failed, setting errno.
*
* \b Example
Expand All @@ -1382,7 +1384,7 @@ class MotorGroup : public virtual AbstractMotor {
* ENODEV - The port cannot be configured as a motor
* EDOM - The motor group is empty
*
* \return A vector with one of Motor_Brake for each motor in the motor group, according to what was set for the
* \return A vector with one of MotorBrake for each motor in the motor group, according to what was set for the
* motor, or E_MOTOR_BRAKE_INVALID if the operation failed, setting errno.
*
* \b Example
Expand Down Expand Up @@ -1464,7 +1466,7 @@ class MotorGroup : public virtual AbstractMotor {
* \param index Optional parameter, 0 by default.
* The zero indexed index of the motor in the motor group
*
* \return One of Motor_Units according to what is set for the
* \return One of MotorUnits according to what is set for the
* motor or E_MOTOR_ENCODER_INVALID if the operation failed.
*
* \b Example
Expand All @@ -1485,7 +1487,7 @@ class MotorGroup : public virtual AbstractMotor {
* ENODEV - The port cannot be configured as a motor
* EDOM - The motor group is empty
*
* \return A vector with the following for each motor, One of Motor_Units according to what is set for the
* \return A vector with the following for each motor, One of MotorUnits according to what is set for the
* motor or E_MOTOR_ENCODER_INVALID if the operation failed.
*
* \b Example
Expand All @@ -1510,8 +1512,8 @@ class MotorGroup : public virtual AbstractMotor {
*\param index Optional parameter, 0 by default.
* The zero indexed index of the motor in the motor group
*
* \return One of Motor_Gears according to what is set for the motor,
* or pros::Motor_Gears::invalid if the operation failed.
* \return One of MotorGears according to what is set for the motor,
* or pros::MotorGears::invalid if the operation failed.
*
* \b Example
* \code
Expand All @@ -1531,8 +1533,8 @@ class MotorGroup : public virtual AbstractMotor {
* EDOM - The motor group is empty
*
*
* \return A vector with one of Motor_Gears according to what is set for the motor,
* or pros::Motor_Gears::invalid if the operation failed for each motor.
* \return A vector with one of MotorGears according to what is set for the motor,
* or pros::MotorGears::invalid if the operation failed for each motor.
*
* \b Example
* \code
Expand Down Expand Up @@ -1651,7 +1653,7 @@ class MotorGroup : public virtual AbstractMotor {
std::vector<std::int32_t> is_reversed_all(void) const;

/**
* Sets one of Motor_Brake to a motor in the motor group. Works with the C enum
* Sets one of MotorBrake to a motor in the motor group. Works with the C enum
* and the C++ enum class.
*
* This function uses the following values of errno when an error state is
Expand All @@ -1661,7 +1663,7 @@ class MotorGroup : public virtual AbstractMotor {
* EOVERFLOW - The index is greater than or equal to MotorGroup::size()
*
* \param mode
* The Motor_Brake to set for the motor
* The MotorBrake to set for the motor
*
* \param index Optional parameter, 0 by default.
* The zero indexed index of the motor in the motor group
Expand All @@ -1681,7 +1683,7 @@ class MotorGroup : public virtual AbstractMotor {
*/
std::int32_t set_brake_mode(const MotorBrake mode, const std::uint8_t index = 0) const;
/**
* Sets one of Motor_Brake to a motor in the motor group. Works with the C enum
* Sets one of MotorBrake to a motor in the motor group. Works with the C enum
* and the C++ enum class.
*
* This function uses the following values of errno when an error state is
Expand All @@ -1691,7 +1693,7 @@ class MotorGroup : public virtual AbstractMotor {
* EOVERFLOW - The index is greater than or equal to MotorGroup::size()
*
* \param mode
* The Motor_Brake to set for the motor
* The MotorBrake to set for the motor
*
* \param index Optional parameter, 0 by default.
* The zero indexed index of the motor in the motor group
Expand All @@ -1711,7 +1713,7 @@ class MotorGroup : public virtual AbstractMotor {
*/
std::int32_t set_brake_mode(const pros::motor_brake_mode_e_t mode, const std::uint8_t index = 0) const;
/**
* Sets one of Motor_Brake all the motors in the motor group. Works with the C enum
* Sets one of MotorBrake all the motors in the motor group. Works with the C enum
* and the C++ enum class.
*
* This function uses the following values of errno when an error state is
Expand All @@ -1720,7 +1722,7 @@ class MotorGroup : public virtual AbstractMotor {
* EDOM - The motor group is empty
*
* \param mode
* The Motor_Brake to set for the motor
* The MotorBrake to set for the motor
*
*
* \return 1 if the operation was successful or PROS_ERR if the operation
Expand All @@ -1737,7 +1739,7 @@ class MotorGroup : public virtual AbstractMotor {
*/
std::int32_t set_brake_mode_all(const MotorBrake mode) const;
/**
* Sets one of Motor_Brake to a motor in the motor group. Works with the C enum
* Sets one of MotorBrake to a motor in the motor group. Works with the C enum
* and the C++ enum class.
*
* This function uses the following values of errno when an error state is
Expand All @@ -1746,7 +1748,7 @@ class MotorGroup : public virtual AbstractMotor {
* EDOM - The motor group is empty
*
* \param mode
* The Motor_Brake to set for the motor
* The MotorBrake to set for the motor
*
*
* \return 1 if the operation was successful or PROS_ERR if the operation
Expand Down Expand Up @@ -1828,7 +1830,7 @@ class MotorGroup : public virtual AbstractMotor {
*/
std::int32_t set_current_limit_all(const std::int32_t limit) const;
/**
* Sets one of Motor_Units for one motor in the motor group's motor encoder. Works with the C
* Sets one of MotorUnits for one motor in the motor group's motor encoder. Works with the C
* enum and the C++ enum class.
*
* This function uses the following values of errno when an error state is
Expand Down Expand Up @@ -1856,7 +1858,7 @@ class MotorGroup : public virtual AbstractMotor {
*/
std::int32_t set_encoder_units(const MotorUnits units, const std::uint8_t index = 0) const;
/**
* Sets one of Motor_Units for one motor in the motor group's motor encoder. Works with the C
* Sets one of MotorUnits for one motor in the motor group's motor encoder. Works with the C
* enum and the C++ enum class.
*
* This function uses the following values of errno when an error state is
Expand Down Expand Up @@ -1884,7 +1886,7 @@ class MotorGroup : public virtual AbstractMotor {
*/
std::int32_t set_encoder_units(const pros::motor_encoder_units_e_t units, const std::uint8_t index = 0) const;
/**
* Sets one of Motor_Units for every motor in the motor group's motor encoder. Works with the C
* Sets one of MotorUnits for every motor in the motor group's motor encoder. Works with the C
* enum and the C++ enum class.
*
* This function uses the following values of errno when an error state is
Expand All @@ -1909,7 +1911,7 @@ class MotorGroup : public virtual AbstractMotor {
*/
std::int32_t set_encoder_units_all(const MotorUnits units) const;
/**
* Sets one of Motor_Units for every motor in the motor group's motor encoder. Works with the C
* Sets one of MotorUnits for every motor in the motor group's motor encoder. Works with the C
* enum and the C++ enum class.
*
* This function uses the following values of errno when an error state is
Expand Down
2 changes: 1 addition & 1 deletion include/pros/motors.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ int32_t motor_move_relative(int8_t port, double position, const int32_t velocity
int32_t motor_move_velocity(int8_t port, const int32_t velocity);

/**
* Sets the output voltage for the motor from -12000 to 12000 in millivolts
* Sets the output voltage for the motor from -12000 to 12000 in millivolts.
*
* \note A negative port negates the voltage
*
Expand Down
Loading

0 comments on commit 0b98d82

Please sign in to comment.