I wanted to use SetPose2d to set robot's position to a certain position I desire.
I made a cpp code that could run multiple robot model through the use of calling the robot's port, ./code -p 6665, ./code -p 6666
, and so on.
After reading the mailing-list archive I finally udnerstand how to use SetPose2d:
sp.SetPose2d( (char *)string("robot1").c_str(),x,y, (o- DTOR(90)));
My question is: how should I call the robot's name without typing it one-by-one in SetPose2d? Or is there another way?
Because I want to make the cpp code 'universal'.
So that if I run each robot by calling its port number, for example port 6668 belongs to robot3
the function SetPose2d will reposition robot model "robot3", and so on.
Hence I don't have to retype this part of the code
So later it might be looks like this:
string robot = getRobotName();
sp.SetPose2d( (char *)string(robot).c_str(),x,y, (o- DTOR(90)));
I hope I made myself clear enough because I'm not English :)
Thank you very much.