Flavio,

This is a bit ugly, but should do what you want:

There is a simulation method from the robot for general access to a simulator. In the PyrobotSimulator there is also an .eval() method. You can pass in a string that will get evaluated in the simulator, where self if the sim.

For example, after starting the simulator and connecting onto it:

robot.simulation[0].eval("self.drawLine(0, 0, 1, 1, fill='blue', tag='particle')")

will draw a blue line from (0,0) to (1,1) in the coordinates of the room, with the tag "particle".

The lines aren't very persistent and will go away if the window is completely redraw. You can force them to go away with:

robot.simulation[0].eval("self.remove('particle')")

But, that should do what you want. Consider adding a method to pyrobot/simulators/pysim.py (and contribute it back to pyrobot). You could also add a module on this to the pyrobot wiki materials, if you like. Also, if you make a movie, I hope you show it!

Good luck!

-Doug

Flavio Coelho wrote:
Hi,

I am trying to implement a localization algorithm in a brain script using the particle filter method.

I want to draw the particles in the simulator canvas to illustrate the progression of the localization algorithm.

For those who don't know what this algorithm is all about, all I want to do is to draw and erase pixels on the main simulator canvas where the robot is moving

is there an easy way to do that?

thanks,

Flávio


------------------------------------------------------------------------

_______________________________________________
Pyro-users mailing list
[email protected]
http://emergent.brynmawr.edu/mailman/listinfo/pyro-users

_______________________________________________
Pyro-users mailing list
[email protected]
http://emergent.brynmawr.edu/mailman/listinfo/pyro-users

Reply via email to