GPS coordinates messing up when heading changes

I have been working on setting up the GPS for pure pursuit, and PID, so to make it easier to program I set the orgin in a corner, however weirdly now when I change heading the sign values change, so if I were at 12,12 (inches) and turned 180 degrees I without changing position I would then be at -12,-12 and this problem doesn’t occur until I change to orgin. Any help would be appriciated.

disintegrate

2 Likes

Yeah I was considering switching to odometery, but I’m currently waiting on the builders to finish the tracking wheels up

3 Likes

Ok, I think this problem may be with only having 1 gps sensor, OR it may be the fact that you have your field strips or code wrong. I haven’t used the gps sensor, so I am unsure if it goes from 0,0 » 12,12, but if it does, you can just get the abs of the value and it will turn positive

2 Likes

Go read this.

There might be a misunderstanding here. If you change the x and y offset that doesn’t change the orgin. Changeing the orgin would require taking the GPS coordinate output and then shift it so that the orgin is at the corner.

Is this looking at the GPS sensor’s device view or is this filtered through your program because this could be an issue.

4 Likes