libstageplugin is a plugin for Player that allows Player clients to access simulated robots as if they were normal Player devices.
Stage robots and sensors work like any other Player device: users write robot controllers and sensor algorithms as `clients' to the Player `server'. Typically, clients cannot tell the difference between the real robot devices and their simulated Stage equivalents (unless they try very hard). We have found that robot controllers developed as Player clients controlling Stage robots will work with little or no modification with the real robots and vice versa [1]. With a little care, the same binary program can often control Stage robots and real robots without even being recompiled [2]. Thus the Player/Stage system allows rapid prototyping of controllers destined for real robots. Stage can also be very useful by simulating populations of realistic robot devices you don't happen to own [3].
Richard Vaughan
[refs]
Creating two models in a Stage worldfile, saved as "example.world":
# this is a comment # create a position model - it can drive around like a robot position ( name "marvin" color "red" pose [ 1 1 0 ] # add a range scanner on top of the robot ranger() ) # create a position model with a gripper attached to each side position ( name "gort" color "silver" pose [ 6 1 0 ] size [ 1 2 ] gripper( pose [0 1 90] ) gripper( pose [0 -1 -90] ) )
Attaching Player interfaces to the Stage models "marvin" and "gort" in a Player config (.cfg) file:
# Present a simulation interface on the default port (6665). # Load the Stage plugin driver and create the world described # in the worldfile "example.world" # The simulation interface MUST be created before any simulated devices # models can be used. driver ( name "stage" provides ["simulation:0"] plugin "libstageplugin" worldfile "example.world" ) # Present a position interface on the default port (6665), connected # to the Stage position model "marvin", and a ranger interface connected to # the ranger child of "marvin". driver ( name "stage" provides ["position2d:0" "ranger:0"] model "marvin" ) # Present three interfaces on port 6666, connected to the Stage # position model "gort" and its two grippers. driver ( name "stage" provides ["6666:position2d:0" "6666:gripper:0" "6666:gripper:1"] model "gort" )
More examples can be found in the Stage source tree, in directory <stage-version>/worlds.
The stage plugin driver provides the following device interfaces: