pros::v5::Gps class

Base classes

class Device

Public static functions

static std::vector<Gps> get_all_devices()
Gets all GPS sensors.
static Gps get_gps()
Gets a gps sensor that is plugged in to the brain.

Constructors, destructors, conversion operators

Gps(const std::uint8_t port)
Creates a GPS object for the given port.
Gps(const Device& device)
Gps(const std::uint8_t port, double xInitial, double yInitial, double headingInitial) explicit
Creates a GPS object for the given port.
Gps(const std::uint8_t port, double xOffset, double yOffset) explicit
Creates a GPS object for the given port.
Gps(const std::uint8_t port, double xInitial, double yInitial, double headingInitial, double xOffset, double yOffset) explicit
Creates a GPS object for the given port.

Public functions

std::int32_t initialize_full(double xInitial, double yInitial, double headingInitial, double xOffset, double yOffset) const virtual
Set the GPS's offset relative to the center of turning in meters, as well as its initial position.
std::int32_t set_offset(double xOffset, double yOffset) const virtual
Set the GPS's offset relative to the center of turning in meters.
pros::gps_position_s_t get_offset() const virtual
Get the GPS's cartesian location relative to the center of turning/origin in meters.
std::int32_t set_position(double xInitial, double yInitial, double headingInitial) const virtual
Sets the robot's location relative to the center of the field in meters.
std::int32_t set_data_rate(std::uint32_t rate) const virtual
Set the GPS sensor's data rate in milliseconds, only applies to IMU on GPS.
double get_error() const virtual
Get the possible RMS (Root Mean Squared) error in meters for GPS position.
pros::gps_status_s_t get_position_and_orientation() const virtual
Gets the position and roll, yaw, and pitch of the GPS.
pros::gps_position_s_t get_position() const virtual
Gets the x and y position on the field of the GPS in meters.
double get_position_x() const virtual
Gets the X position in meters of the robot relative to the starting position.
double get_position_y() const virtual
Gets the Y position in meters of the robot relative to the starting position.
pros::gps_orientation_s_t get_orientation() const virtual
Gets the pitch, roll, and yaw of the GPS relative to the starting orientation.
double get_pitch() const virtual
Gets the pitch of the robot in degrees relative to the starting oreintation.
double get_roll() const virtual
Gets the roll of the robot in degrees relative to the starting oreintation.
double get_yaw() const virtual
Gets the yaw of the robot in degrees relative to the starting oreintation.
double get_heading() const virtual
Get the heading in [0,360) degree values.
double get_heading_raw() const virtual
Get the heading in the max double value and min double value scale.
pros::gps_gyro_s_t get_gyro_rate() const virtual
Get the GPS's raw gyroscope value in z-axis.
double get_gyro_rate_x() const virtual
Get the GPS's raw gyroscope value in x-axis.
double get_gyro_rate_y() const virtual
Get the GPS's raw gyroscope value in y-axis.
double get_gyro_rate_z() const virtual
Get the GPS's raw gyroscope value in z-axis.
pros::gps_accel_s_t get_accel() const virtual
Get the GPS's raw accelerometer values.
double get_accel_x() const virtual
Get the GPS's raw accelerometer value in x-axis.
double get_accel_y() const virtual
Get the GPS's raw accelerometer value in y-axis.
double get_accel_z() const virtual
Get the GPS's raw accelerometer value in z-axis.

Friends

std::ostream& operator<<(std::ostream& os, const pros::Gps& gps)
This is the overload for the << operator for printing to streams.