Alinti Samuel Lopes Grigolato <samuel.grigolato@gmail.com>

You can start with the worst possible algorithm: recursively
classification of every possible step from the little yellow ball
start position till the desired coin. Pacman mazes are so small that
even that algorithm should be acceptable to put on a real robot. But,
as a nice student (you are one, right? =D) you certainly should try to
improve the algorithm and compare the results. You could improve it
with:

1) Initially dealing only with the more obvious paths.
2) Memoization of key paths to use when calculating the path to the next coin.
3) Defining a threshold to accept a path even if you are not sure if
it is the best.

Have fun!

On Tue, Feb 4, 2014 at 7:46 PM,  <ozdayi@itu.edu.tr> wrote:

Alinti Samuel Lopes Grigolato <samuel.grigolato@gmail.com>

It's simulating a real thing, isn't it? =D

I meant exactly what you ended up answering: the type of movement.

Consider carefully to write your own algorithm from scratch rather
than to adapt a more complex one, it might just end up being a lot
easier ^^.

Cheers!

On Tue, Feb 4, 2014 at 7:27 PM,  <ozdayi@itu.edu.tr> wrote:

Alinti Samuel Lopes Grigolato <samuel.grigolato@gmail.com>

I think you'll need to customize the planner's algorithm, constraining
it so it won't be able to move diagonally. I did a little research but
didn't find any ready-to-use configuration property (perhaps someone
could shed some light on this =]).

Maybe it will be easier to just remove the "planner" interface
dependency and write your own path-finding algorithm communicating
directly with the "position2d" interface.

Remember that you need to consider physical constraints as well, you
might not be able to just "turn without stoping" like pacman do,
that's very hardware specific. What "legs" are you considering to put
on the physical thing?

http://stackoverflow.com/questions/2604022/pathfinding-algorithm-for-pacman




On Tue, Feb 4, 2014 at 6:33 PM,  <ozdayi@itu.edu.tr> wrote:

Alinti Samuel Lopes Grigolato <samuel.grigolato@gmail.com>

Will your robot be aware of the entire map? Or will it just go on
collecting random coins avoiding walls?

In the first case I think you'll be fine with a combo of "position2d"
and some kind of range-finder like "sonar" or "laser". Otherwise you
should specify more your requirements =).

Remember, think about the interfaces [1], then and only then start
choosing the drivers [2] that will be providing the functionality.

For example, "wavefront" provides "planner" and >>requires<<
"position2d", so maybe it's not the driver you wan't to add to your
project. On the other hand, the "rflex" driver provides position2d
(and a lot of other cool things that you should not be needing for
this project) considering that you will be using a RWI robot.

[1]
http://playerstage.sourceforge.net/doc/Player-2.0.0/player/group__interfaces.html
[2]
http://playerstage.sourceforge.net/doc/Player-2.0.0/player/group__drivers.html

Hope it helps!

Regards,
Samuel.

On Tue, Feb 4, 2014 at 12:36 PM,  <ozdayi@itu.edu.tr> wrote:

Hello all,

I'm working on a project and my aim is to implement Pac-Man on
Player/Stage.
My first goal is to create a robot that travels the Pac-Man map and picks
the coins as it does so. I'm having issues with my robots navigation.

At first I tried wavefront driver however, it really doesn't do
what I want.
Basically, I want my robot to have 4 direction options just as in real
Pac-Man (up, down, left, right). I believe I can  achieve that my
configuring VFH driver to work so but I don't know where to
begin. Any other
suggestion is much appreciated too.

Thanks.


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/playerstage-users


Thank you for your answer. Yes, the robot will be aware of the whole map
just like a real player would do. It'll know where the coins, pills and
ghosts are located.

This is what i did using wavefront:

I defined a few coins on the map named "coin1", "coin2" etc and used
PositionProxy to get their X, Y coords with GetPose2d() and then passed
these coordinates to PlannerProxy's SetGoalPose(). Well, it does what I
want, I mean the robot goes to coins and picks them but it doesn't really
look like Pac-Man. It stops for a few seconds when it goes near a coin and
also takes any degree between 0-360 when turning where I want it to only
turn for 90 degrees.

I'll take a look to that driver and will work on PositionProxy for a while
then. Hope I can achieve something :)




------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users
This is exactly what I though ( I think you'll need to customize the
planner's algorithm, constraining

it so it won't be able to move diagonally). Stopping for a while is
OK, I might get some help later to behave it in a more realistic way
but it is not required now. What do you mean by legs btw? I'm just
working on a simulator there is no real robot if that's what you
mean :) Drive type is "diff" if that's you asked.

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users
Aye, you are right :) I think I'll start with a wall-following
algorithm and see how it turns out. I hope it will atleast give me
something to show me to my professor and perhaps he can help me from
there. Feel free to throw suggestions though.


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/playerstage-users



Okay, it seems like I've managed to write an algorithm. It seems to be working however, it has a small problem. The scans sonar sensors do as robot makes it turns seem to confuse it a little bit(I don't want them to scan as robot turns basically). I can fix it by using sleep() but don't really like it. Is there a function to turn them off/on ? Couldn't find anything on API ref.