Yes, you are on the right track. You can use the simulation device, like so:
robot.simulation[0].setPose("Puck1", 5, 5, 0)
where "Puck1" is the name given in the world file. Currently, there isn't
a specific method to dynamically see the robot names, but there is a
general eval mechanism that you can execute in the simulator and get the
return values. Knowing how the simulator works lets you:
robot.simulation[0].eval("[r.name for r in self.robots]")
which gives you the robot names.
-Doug
On Fri, March 2, 2007 1:47 am, Alexander Khasymski said:
> Hi,
>
> I am using the PyrobotSimulator to simulate two Pioneer robots and four
> tkPucks. I have written a brain for both robots to find the pucks and
> bring them to a corner in the environment where I have put a light. My
> question is the following: Is there a way get a puck to move to a random
> position in the environment as soon as one of the robots delivers it to
> the corner? Currently I can achieve this by clicking on the desired puck
> and than dragging it to a place in the environment. Presumably to
> automate this process I have add some code to each brain that will give
> it access to the list of robots in the simulator (pucks are types of
> robots I think) than find the coordinates of the puck (from the
> coordinates of the robot that dropped it off) and then setPose it to a
> random place. Am I on the right track?
>
> If anyone has done anything similar or has any suggestion please let me
> know.
> Thanks for the help.
> Aleksandr
> _______________________________________________
> Pyro-users mailing list
> [email protected]
> http://emergent.brynmawr.edu/mailman/listinfo/pyro-users
>
--
Douglas S. Blank
Associate Professor, Bryn Mawr College
http://cs.brynmawr.edu/~dblank/
Office: 610 526 6501
_______________________________________________
Pyro-users mailing list
[email protected]
http://emergent.brynmawr.edu/mailman/listinfo/pyro-users