libstage - Stage library API

Detailed Description

libstage (The Stage Library) provides a C code library for simulating a population of mobile robots and sensors. It is usually used as a plugin driver for Player, but it can also be used directly to build custom simulations.

libstage is modular and fairly simple to use. The following code is enough to get a complete robot simulation running:

#include "stage.h"

int main( int argc, char* argv[] )
  stg_init( argc, argv );

  stg_world_t* world = stg_world_create_from_file( argv[1] );
  while( (stg_world_update( world,TRUE )==0) )
  stg_world_destroy( world );
  return 0;

Contact and support
For help with libstage, please use the mailing list


Pretty-printing: console output functions.
Laser range scanner
Fidicial detector
Range finder
Internals - not intended for the libstage end user

Data Structures

struct  stg_size_t
struct  stg_pose_t
struct  stg_geom_t
struct  stg_bounds_t
struct  stg_fov_t
struct  stg_energy_data_t
struct  stg_energy_config_t
struct  stg_pose_t
struct  opaque
struct  opaque


#define FiducialNone   0
#define STG_MOVE_TRANS   (1 << 0)
#define STG_MOVE_ROT   (1 << 1)
#define STG_MOVE_SCALE   (1 << 2)


typedef int stg_id_t
typedef double stg_meters_t
typedef double stg_radians_t
typedef unsigned long stg_msec_t
typedef double stg_kg_t
typedef double stg_joules_t
typedef double stg_watts_t
typedef int stg_bool_t
typedef uint32_t stg_color_t
typedef int stg_obstacle_return_t
typedef int stg_blob_return_t
typedef int stg_fiducial_return_t
typedef int stg_ranger_return_t
typedef stg_pose_t stg_velocity_t
typedef int stg_movemask_t
typedef _stg_world stg_world_t
typedef _stg_model stg_model_t


enum  stg_gripper_return_t { STG_GRIP_NO = 0, STG_GRIP_YES }
enum  stg_laser_return_t { LaserTransparent, LaserVisible, LaserBright }


stg_msec_t stg_timenow (void)
int stg_init (int argc, char **argv)
int stg_quit_test (void)
void stg_quit_request (void)

Define Documentation

#define FiducialNone   0

any integer value other than this is a valid fiducial ID

#define STG_MOVE_TRANS   (1 << 0)

#define STG_MOVE_ROT   (1 << 1)

#define STG_MOVE_SCALE   (1 << 2)

Typedef Documentation

typedef int stg_id_t

uniquely identify a model

typedef double stg_meters_t

unit of distance

typedef double stg_radians_t

unit of angle

typedef unsigned long stg_msec_t

unit of (short) time

typedef double stg_kg_t

unit of mass

typedef double stg_joules_t

unit of energy

typedef double stg_watts_t

unit of power

typedef int stg_bool_t


typedef uint32_t stg_color_t

24-bit RGB color packed 0x00RRGGBB

typedef int stg_obstacle_return_t

obstacle value. 0 means the model does not behave, or is sensed, as an obstacle

typedef int stg_blob_return_t

blobfinder return value. 0 means not detected by the blobfinder

typedef int stg_fiducial_return_t

fiducial return value. 0 means not detected as a fiducial

typedef int stg_ranger_return_t

typedef stg_pose_t stg_velocity_t

specify a 3 axis velocity in x, y and heading.

typedef int stg_movemask_t

typedef struct _stg_world stg_world_t

typedef struct _stg_model stg_model_t

Enumeration Type Documentation

enum stg_gripper_return_t

Enumeration values:

enum stg_laser_return_t

laser return value

Enumeration values:
LaserTransparent  not detected by laser model
LaserVisible  detected by laser with a reflected intensity of 0

Function Documentation

stg_msec_t stg_timenow void   ) 

returns the real (wall-clock) time in milliseconds since the simulation started.

int stg_init int  argc,
char **  argv

initialize the stage library. Optionally pass in the arguments from main(), so Stage can read cmdline options. Stage then passes the arguments to GTK+ and Xlib so they can read their own options.

int stg_quit_test void   ) 

if stage wants to quit, this will return non-zero

void stg_quit_request void   ) 

set stage's quit flag. Stage will quit cleanly very soon after this function is called.

Generated on Thu Aug 11 13:08:10 2005 for Stage by  doxygen 1.4.0