[Playerstage-users] Automatically get number of robot instances?

Is there a way that I can get the number of robot
instances from the .cfg / .world files automatically?
i.e. I have .cfg and .world files with X robots. In my C
files I have written functions to create X number of
robots. But I have to specify the value of X directly in
the C code. Is there any way I can get this value
automatically from Player / Stage, or the .cfg/.world
files? I'm trying to automate a batch processing job
where I can run through a loop and alter the number of
robots from a counter, but I need to manually specific the
number of robots at the start of my C program. I'd like
to be able to get it directly from Stage to avoid
recompiling.
Thanks
Sion

Thread view

Is there a way that I can get the number of robot
instances from the .cfg / .world files automatically?
i.e. I have .cfg and .world files with X robots. In my C
files I have written functions to create X number of
robots. But I have to specify the value of X directly in
the C code. Is there any way I can get this value
automatically from Player / Stage, or the .cfg/.world
files? I'm trying to automate a batch processing job
where I can run through a loop and alter the number of
robots from a counter, but I need to manually specific the
number of robots at the start of my C program. I'd like
to be able to get it directly from Stage to avoid
recompiling.
Thanks
Sion

The short answer is not easily. Two options come to mind, parse the world
file with a python/grep/sed/whatever script and use the result in your build
process. Or keep on connecting until you dont get a reply on a port and
thats how many robots you have.
Toby
2009/6/22 <S.P.Scone@...>
> Is there a way that I can get the number of robot
> instances from the .cfg / .world files automatically?
>
> i.e. I have .cfg and .world files with X robots. In my C
> files I have written functions to create X number of
> robots. But I have to specify the value of X directly in
> the C code. Is there any way I can get this value
> automatically from Player / Stage, or the .cfg/.world
> files? I'm trying to automate a batch processing job
> where I can run through a loop and alter the number of
> robots from a counter, but I need to manually specific the
> number of robots at the start of my C program. I'd like
> to be able to get it directly from Stage to avoid
> recompiling.
>
> Thanks
>
> Sion
>
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge
> conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference:
> $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
>
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> Playerstage-users mailing list
> Playerstage-users@...
> https://lists.sourceforge.net/lists/listinfo/playerstage-users
>
--
This email is intended for the addressee only and may contain privileged
and/or confidential information