Forum: PogamutUT2004

Path planning to a location

I have path planning from center point of a cell to another on a grid map. The center points are definitely not NavPoints. In order to move the bot I used
Location nextLocation = ... center location of next cell
getAct().act(new Move().setFirstLocation(nextLocation));
and moved to next location when the
bot.getVelocity().isZero()

It's working but the problem is the movement is not continuous, it's jerky. I tried to use pathPlanner and pathExecutor in the tutorial, however, in my experience, it only works in between NavPoints. Is there a way to make the movement more natural and continuous and still not use NavPoint as use only target Location information.
Well the movement is jerky, because you send new move command only when the bot velocity is zero. So he needs to do a full stop before next movement will be issued. There are two solutions to your problem:

1) Use pathExecutor from the tutorial. It really does not work with custom locations? That is suprising - Jakub, you here? Is it true? If yes, never mind. What you want to do is to find the nearest navigation point to your location, issue pathExecutor command to get the bot there. When you are there, you just issue move command to get you to your custom location.

2) Move command has this feature - you can support two consecutive locations in it. That way the movement will not be jerky.
new Move().setFirstLocation(first).setSecondLocation(second);

Now in logic method, check when the bot already passed "first" location. If yes, send another movement command:

new Move().setFirstLocation(second).setSecondLocation(third);


etc.

The logic method is called 4 times per second, so normally everything should be smooth.

Best,
Michal
Hi!

I think it should be possible to plan your path wherever you want (to a certain degree), but haven't ever tested that.

Also, the path won't be computed if you try to execute a movement to a location that is very near to you (I think...).

I will have a look at this issue.

Best,
Jimmy
Moving along two consecutive locations idea worked nicely.
Thanks