I ran exercise 4.1. The program seemed to run fine, but the values for the X coordinate seemed extremely small. Y was 0, which makes sense because we only move in the X-axis. But after 5 seconds (at which point I ran into the counter) the X was only “2.8026e-45”. I used other values for how many seconds, and got similar results. I compared my code to the example - they’re equivalent.
In exercise 4.2 I’m having the opposite issue - the X and Y values seem way too large. I’m also getting the exact same x and y value each time I check the coordinates. My code is below - you’ll see that initially I tried calling a function to print the coordinates, but when that game me the same values at every point, I thought it might be something to do with how I was passing the rosbot object. So I just checked in the same function after each turn (or going straight). Even with this I get the same values at each point. And they’re huge (X, Y coordinates: 6.7406e+22, 565990).
In the simulation it looks fine and moves as expected.
Code is below. Am I calling the get_position function wrong somehow?