Nidhi Kalra
 
Home Research Publications Resources
 
¤ Overview

Topic: Overview
I’m beginning some development and testing with the player/stage simulator. This page contains observations and tips about player stage that may be useful to others as well. From the Player/Stage website:

“Player is a device server that provides a powerful, flexible interface to a variety of sensors and actuators (e.g., robots). Because Player uses a TCP socket-based client/server model, robot control programs can be written in any programming language and can execute on any computer with network connectivity to the robot. In addition, Player supports multiple concurrent client connections to devices, creating new possibilities for distributed and collaborative sensing and control.”

“Stage is a scaleable multiple robot simulator; it simulates a population of mobile robots moving in and sensing a two-dimensional bitmapped environment, controlled through Player. Stage provides virtual Player robots which interact with simulated rather than physical devices. Various sensor models are provided, including sonar, scanning laser rangefinder, pan-tilt-zoom camera with color blob detection and odometry.”

¤ Get started

Topic: Getting Started
To use player-stage, you need to install player and then stage. Gazebo is for 3D simulation.

To run:
1. Open the file stage-1.6/worlds/everything.cfg and change line 11:
from plugin "libstage" to plugin "../src/.libs/libstage"

2. Start player
player <path-to-player-src>/stage-1.6/worlds/everything.cfg

3. Run an example in player
<path-to-player-src>/examples/c++/laserobstacleavoid

¤ Coordinate System

Topic: Coordinate System 1
On Sat, 1 Feb 2003, Minh Tran wrote:

Q:
According to the docs, scale is how many units per pixel. So I"m guessing it"s 0.2 metres per pixel. Now some sample readings from the laser proxy is giving me huge values like 8000. I would like to know what this number means and how to convert it to pixel units and physical units.

A:

As stated in the C++ Client Library Reference Manual (page 16), the LaserProxy reports laser range values in millimeters and angular resolution in hundredths of a degree (0.01 degree). Note that other client libraries may transform such values into different units (e.g., I suspect that libplayerc converts to meters and radians).

To convert from laser range and angle values to world pixel values, you just need to do a standard polar->rectangular coordinate transformation, then scale the result according to your simulation scale.

By the way, you"ll see lots of ranges of 8000, because the maximum range of the simulated laser is 8 meters (that"s the max range for the physical SICK LMS 200 laser rangefinder).


Q: Also when the robot position is specified as 10, 10. What units is this in??

A: The values given for "unit_length" and "unit_angle" are sticky, in that they persist throughout parsing of the configuration file. So, if you specify "unit_length" as "m" and "unit_angle" as "degrees" (which are the defaults, by the way), then give a robot (or any other) pose as [10.0 10.0 0.0], your robot will be 10 meters up and 10 meters right of the origin, facing to the right (we’re using a standard right-handed coordinate system).

Note that changing the values for "unit_length" or "unit_angle" ONLY affect how your configuration file is parsed. In particular, they have NO effect on how data is passed between server and client or how data is reported by a client library.

Topic: Coordinate System 2
The size of the map in meters is determined in the world file. That is what player and stage use and those are the world coordinates.
+x
^
|
|_ _ _ > +y

The robot’s position as it comes out of PositionProxy is relative to its starting position. Need to transform by starting position.

[ ]
[ ]
U----->+y
|
|
v
+x

¤ Proxies

Topic: LaserProxy
The output of the laser scanner is a distance to the object in that direction.

As stated in the C++ Client Library Reference Manual (page 16), the LaserProxy reports laser range values in millimeters and angular resolution in hundredths of a degree (0.01 degree). Note that other client libraries may transform such values into different units (e.g., I suspect that libplayerc converts to meters and radians).

To convert from laser range and angle values to world pixel values, you just need to do a standard polar->rectangular coordinate transformation, then scale the result according to your simulation scale.

By the way, you"ll see lots of ranges of 8000, because the maximum range of the simulated laser is 8 meters (that"s the max range for the physical SICK LMS 200 laser rangefinder).

Topic: MapProxy
To get map data, need to use a MapProxy.

Player:
-----
For this, a driver can be instantiated in the .cfg file as:

driver
(
name "mapfile"
provides ["map:0"]
filename "bitmaps/cave.png"
resolution 0.05
negate 0
)

Then, when you start player, the console will read:
MapFile read a 500 x 500 map, 0.050 m/pix
which indicates that we have a 500 by 500 pixel map and each pixel corresponds to 5 cm.

Client:
Then, in the client, you instantiate the proxy with:
        MapProxy mp(&robot, device_index, 'r');
        
And then call GetMap to write the map.
        mp.GetMap();

Values such as height and width can be accessed with mp.height and mp.width.

Topic: PositionProxy
Do not use Position2DProxy. It seems angular rotation for Position2DProxy is not in radians/second but something else.

Topic: Proxy - General
Access options for a proxy are “r” (read) “w” (write) and “a” (all??).

¤ Links