First of all, I'm sorry for the double post. I didn't know how to reply my own email thread in this mailing list.
I did not see any "reply button" or something like that;

Thank you Rich and Richard for your idea. Yesterday I decided to hard-coded the robot model's name using switch-case.
Which is actually avoid, because I'm simulating a lot number of robots.
Code:
switch (port_number){
case 6666: robot = "robot2"; break;
case 6667: robot = "robot3"; break;
:
:
default: robot = "robot1";
}
then I call this function
Code:
sp.SetPose2d( (char *)string(robot).c_str(),x,y, (o- DTOR(90)));
However, I found out that the SimulationProxy prevented me to run another robot with port other than 6665 (the default).
If I run this command,
Code:
./program -p 6666
an error popped out:
Code:
playerc error   : got NACK from request
playerc error : failed to get response
terminate called after throwing an instance of 'PlayerCc::PlayerError'
Aborted
I tried to change the cfg file by adding more simulation interface:
Code:
driver
(
name "stage"
provides ["simulation:0"]
provides ["6666:simulation:0"]
provides ["6667:simulation:0"]
provides ["6668:simulation:0"]
plugin "libstageplugin"
worldfile "AMiR.world"
)
But then I could not run the robot with default port 6665. Instead I was able to run robot with port 6668 only.
So, I thought It might be something related to the definition of simulation proxy within the config file. Or I could be wrong.

Any idea? Thanks.