From: Paul Osmialowski <newchief@ki...> - 2009-02-02 19:07:08
On Mon, 2 Feb 2009, S.P.Scone@... wrote:
> Thanks Paul. Currently I set the colour of a robot in the
> .world file, is this still the same?
I've set colour of all robots in .world file to grey, then at the run time
their colour changes depending on situation. It is done by sending
requests to the simulation proxy. But in most cases I don't even touch
world files as I'm working with Stage provided worlds (everything.cfg
> If you have a code
> snippet about how the robot is altered, I'd appreciate it
I doubt it will be useful for you, as it is written in octave 2.x (free
implementation of matlab) and it needs octplayer2. The script is here:
http://vlab.pjwstk.edu.pl/~vlabdemo/octave/follow.m it drives all the
robots defined in everything.cfg world. After starting of this script all
robots became black, then if any robot sees blue object it becames cyan,
so other robots can recognise if any of their fellows has seen blue
object which is the signal for them to follow that robot.
> (it doesn't seem obvious from
> how the colour is altered)
> Also, did you have one robot alter the colour of another
> robot? Or can a robot alter its own colour?
It depends on how you think about inter-robot communication. To change
colour of given robot (or any object in stage) you send a request to
subscribed 'simulation' interface. As a parameter you need to give a name
of affected object (name of your robot). Now you need to decide if one
robot knows names of other robots or not.