coming from my previous posts (#1 & #2) I managed to create a working method to find the tin cans of my robot and correct the heading angles, so the robot really "hits" the tin cans in most cases.
Now I want to use a navigator to let the robot drive to a certain location and bring the collected can there.
I'm using a navigator class, I construct in a sub-method which is simplified in this bit of code (I left out all my debugging stuff and so on).
- Code: Select all
Navigator navigator = new Navigator(pilot);
navigator.goTo(50,50);
navigator.waitForStop();
pose = opp.getPose();
Now, the thing is, that navigator does not pilot the robot to the mentioned point 50,50 but somewhere else.
I drew a grid on my floor and extracted the different robot locations through the debugging console and compared the locations. The console values match the real values.
- Code: Select all
driveToDestination()
# Current position
X:38.12924 Y:-22.02335 H:-30.01062
# Current waypont of navigator
Point2D.Float[50.0, 50.0]
# Position after navigator.waitForStop()
X:106.4106 Y:-3.598501 H:14.71859
Why does the navigator not pilot the robot to 50,50.
I also tried out to use the navigator.getPoseProvider(); and navigator.clearPath(); commands directly after constructing the navigator, but somehow it doesn't work out that the robot drives to 50,50 but ends up in another place.
Could you again help me out to get further!
Thank you in advance!
Best, Aron
