Utilities
[libstage API reference]


Detailed Description

Various useful macros and functions that don't belong anywhere else.


Modules

 Floating point comparisons

Defines

#define BILLION   1e9
#define DTOR(d)   ((d) * M_PI / 180.0)
#define FALSE   0
#define M_PI   3.14159265358979323846
#define MILLION   1e6
#define NORMALIZE(z)   atan2(sin(z), cos(z))
#define PRINT_DEBUG(m)
#define PRINT_DEBUG1(m, a)
#define PRINT_DEBUG2(m, a, b)
#define PRINT_DEBUG3(m, a, b, c)
#define PRINT_DEBUG4(m, a, b, c, d)
#define PRINT_DEBUG5(m, a, b, c, d, e)
#define PRINT_ERR(m)   fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", __FILE__, __FUNCTION__)
#define PRINT_ERR1(m, a)   fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, __FILE__, __FUNCTION__)
#define PRINT_ERR2(m, a, b)   fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, __FILE__, __FUNCTION__)
#define PRINT_ERR3(m, a, b, c)   fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, c, __FILE__, __FUNCTION__)
#define PRINT_ERR4(m, a, b, c, d)   fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, c, d, __FILE__, __FUNCTION__)
#define PRINT_ERR5(m, a, b, c, d, e)   fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, c, d, e, __FILE__, __FUNCTION__)
#define PRINT_MSG(m)   printf( "Stage: "m"\n" )
#define PRINT_MSG1(m, a)   printf( "Stage: "m"\n", a)
#define PRINT_MSG2(m, a, b)   printf( "Stage: "m"\n,", a, b )
#define PRINT_MSG3(m, a, b, c)   printf( "Stage: "m"\n", a, b, c )
#define PRINT_MSG4(m, a, b, c, d)   printf( "Stage: "m"\n", a, b, c, d )
#define PRINT_MSG5(m, a, b, c, d, e)   printf( "Stage: "m"\n", a, b, c, d, e )
#define PRINT_WARN(m)   printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", __FILE__, __FUNCTION__)
#define PRINT_WARN1(m, a)   printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", a, __FILE__, __FUNCTION__)
#define PRINT_WARN2(m, a, b)   printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", a, b, __FILE__, __FUNCTION__)
#define PRINT_WARN3(m, a, b, c)   printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", a, b, c, __FILE__, __FUNCTION__)
#define PRINT_WARN4(m, a, b, c, d)   printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", a, b, c, d, __FILE__, __FUNCTION__)
#define PRINT_WARN5(m, a, b, c, d, e)   printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", a, b, c, d, e, __FILE__, __FUNCTION__)
#define RTOD(r)   ((r) * 180.0 / M_PI)
#define TRUE   1
#define TWOPI   (2.0*M_PI)

Functions

stg_color_t stg_lookup_color (const char *name)
void stg_pose_sum (stg_pose_t *result, stg_pose_t *p1, stg_pose_t *p2)
void stg_print_err (const char *err)
void stg_print_geom (stg_geom_t *geom)
void stg_print_gripper_config (stg_gripper_config_t *slc)
void stg_print_laser_config (stg_laser_config_t *slc)
void stg_print_pose (stg_pose_t *pose)
void stg_print_velocity (stg_velocity_t *vel)

Define Documentation

#define BILLION   1e9
 

#define DTOR  )     ((d) * M_PI / 180.0)
 

Convert degrees to radians.

#define FALSE   0
 

#define M_PI   3.14159265358979323846
 

#define MILLION   1e6
 

#define NORMALIZE  )     atan2(sin(z), cos(z))
 

Normalize angle to domain -pi, pi.

#define PRINT_DEBUG  ) 
 

#define PRINT_DEBUG1 m,
 ) 
 

#define PRINT_DEBUG2 m,
a,
 ) 
 

#define PRINT_DEBUG3 m,
a,
b,
 ) 
 

#define PRINT_DEBUG4 m,
a,
b,
c,
 ) 
 

#define PRINT_DEBUG5 m,
a,
b,
c,
d,
 ) 
 

#define PRINT_ERR  )     fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", __FILE__, __FUNCTION__)
 

#define PRINT_ERR1 m,
 )     fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, __FILE__, __FUNCTION__)
 

#define PRINT_ERR2 m,
a,
 )     fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, __FILE__, __FUNCTION__)
 

#define PRINT_ERR3 m,
a,
b,
 )     fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, c, __FILE__, __FUNCTION__)
 

#define PRINT_ERR4 m,
a,
b,
c,
 )     fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, c, d, __FILE__, __FUNCTION__)
 

#define PRINT_ERR5 m,
a,
b,
c,
d,
 )     fprintf( stderr, "\033[41merr\033[0m: "m" (%s %s)\n", a, b, c, d, e, __FILE__, __FUNCTION__)
 

#define PRINT_MSG  )     printf( "Stage: "m"\n" )
 

#define PRINT_MSG1 m,
 )     printf( "Stage: "m"\n", a)
 

#define PRINT_MSG2 m,
a,
 )     printf( "Stage: "m"\n,", a, b )
 

#define PRINT_MSG3 m,
a,
b,
 )     printf( "Stage: "m"\n", a, b, c )
 

#define PRINT_MSG4 m,
a,
b,
c,
 )     printf( "Stage: "m"\n", a, b, c, d )
 

#define PRINT_MSG5 m,
a,
b,
c,
d,
 )     printf( "Stage: "m"\n", a, b, c, d, e )
 

#define PRINT_WARN  )     printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", __FILE__, __FUNCTION__)
 

#define PRINT_WARN1 m,
 )     printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", a, __FILE__, __FUNCTION__)
 

#define PRINT_WARN2 m,
a,
 )     printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", a, b, __FILE__, __FUNCTION__)
 

#define PRINT_WARN3 m,
a,
b,
 )     printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", a, b, c, __FILE__, __FUNCTION__)
 

#define PRINT_WARN4 m,
a,
b,
c,
 )     printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", a, b, c, d, __FILE__, __FUNCTION__)
 

#define PRINT_WARN5 m,
a,
b,
c,
d,
 )     printf( "\033[44mwarn\033[0m: "m" (%s %s)\n", a, b, c, d, e, __FILE__, __FUNCTION__)
 

#define RTOD  )     ((r) * 180.0 / M_PI)
 

Convert radians to degrees.

#define TRUE   1
 

#define TWOPI   (2.0*M_PI)
 


Function Documentation

stg_color_t stg_lookup_color const char *  name  ) 
 

Look up the color in the X11 database. (i.e. transform color name to color value). If the color is not found in the database, a bright red color (0xF00) will be returned instead.

void stg_pose_sum stg_pose_t result,
stg_pose_t p1,
stg_pose_t p2
 

calculate the sum of [p1] and [p2], in [p1]'s coordinate system, and copy the result into result.

void stg_print_err const char *  err  ) 
 

Report an error, with a standard, friendly message header

void stg_print_geom stg_geom_t geom  ) 
 

Print human-readable geometry on stdout

void stg_print_gripper_config stg_gripper_config_t slc  ) 
 

Print human-readable version of the gripper config struct

void stg_print_laser_config stg_laser_config_t slc  ) 
 

Print human-readable version of the laser config struct

void stg_print_pose stg_pose_t pose  ) 
 

Print human-readable pose on stdout

void stg_print_velocity stg_velocity_t vel  ) 
 

Print human-readable velocity on stdout


Generated on Thu Dec 13 14:35:18 2007 for Stage by  doxygen 1.4.6