This is not going to be the easiest place to start hacking Pyro because
you are on two different sides: the pysim is a server, and the robot and
brain are over on the client side.

You would need a way to set a state property in the server. To test this
idea out, you could reach into the simulator from outside, and set a
robot's state property. For example, you could do something like:

robot.simulation[0].eval("self.robots[0].state = 'red'")

To do this in a more proper way, you'd probably want to create a method on
the client, like:

robot.setState('red')

That would take a method of encoding the arguments, and then decoding them
on the server side. This code is a major hack right now, where messages
get turned into a string (like "s_red") and then decoded in pysim.py.

As an aside, "self" in the Pyro Command window is the brain object.

-Doug

On Fri, March 16, 2007 5:26 pm, belinda thom said:
> I'm attempting to implement this suggestion (the step method in pysim
> has greatly aided in my understanding), but I'm having trouble
> figuring out how to get "robot.state".
>
> At the Pyro command line,
>
>    dir(robot)
>
> returns entries like move and brain, but
>
>    self.robot.brain
>
> returns
>
>    None
>
> and
>
>   type(robot.brain)
>
> returns
>
>    'NoneType'.
>
> Via the view button, I can view the brain and see the brain's
> attributes (e.g. behaviors, name='SubsumptionBrain`, found, which is
> my own personal attribute added to SubsumptionBrain), but am
> uncertain how to access them from within Simulator's addTrail method
> (I've tried doing robot.found in there but Python complains).
>
> Any pointers?
>
> --b
>


-- 
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

Reply via email to