Issues with GPS in PROS

Hi. I have attempted to use the GPS sensors in PROS, to aid my okapi Odometry system. However, when told to drive to a point after using the GPS values in the Odometry system, the robot’s movement is not accurate and although hits around the same point, is very inconsistent in how much it moves. When printing the raw GPS values, the GPS is still roughly accurate, although the movement is not. Is there anything I can do to resolve this? Thanks.

void autonomous() {
pros::delay(200);
pros::c::gps_status_s_t status;
status = GPS.get_status();
double heading = GPS.get_heading();
heading = heading + 90;
pros::delay(100);
odom → setState({status.x1_m, status.y1_m, heading1_deg});
pros::delay(100);
move(0,0);
pros::delay(50);
odom → turnToPoint({0_in, 48_in});
pros::delay(50);
status = GPS.get_status();
heading = GPS.get_heading();
pros::delay(50);
pros::Controller master (pros::E_CONTROLLER_MASTER);
master.print(0, 0, “X: %3f”, status.x
39.37);
pros::delay(50);
master.print(1, 0, “Y: %3f”, status.y*39.37);
pros::delay(50);
master.print(2, 0, “Heading: %3f”, heading + 90);

So honestly, I’m not sure what the issue is exactly here. While Okapi is a great library and the GPS is a great sensor, there’s always inherently going to be some inaccuracies with both given that’s the nature of robotics. The best advice I can give you is to just continue to tune it and get it as close as you can, even if the numbers in code don’t match up with the numbers IRL. Good luck!

2 Likes