inc/common.h File Reference

Go to the source code of this file.

Defines

#define PI   3.141592653589793
#define FEET_PER_METER   3.280839895
#define METERS_PER_FOOT   (1.0/FEET_PER_METER)
#define GRAVITY_CONSTANT   9.80665
#define GYRO_SENSITIVITY_2009   0.0125
#define GYRO_SENSITIVITY_2010   0.007
#define __in
#define __out
#define __inout
#define ARRAYSIZE(a)   (sizeof(a)/sizeof(a[0]))
#define SAFE_DELETE(p)
#define MAGNITUDE(x, y)   sqrt(pow(x, 2) + pow(y, 2))
#define RADIANS_TO_DEGREES(n)   ((n)*180.0/PI)
#define DIR_RADIANS(x, y)   (((x == 0.0) && (y == 0.0))? 0.0: atan2(x, y))
#define DIR_DEGREES(x, y)   RADIANS_TO_DEGREES(DIR_RADIANS(x, y))
#define GetMsecTime()   (GetFPGATime()/1000)
#define BOUND(n, l, h)   (((n) < (l))? (l): ((n) > (h))? (h): (n))
#define NORMALIZE(n, sl, sh, tl, th)   (((n) - (sl))*((th) - (tl))/((sh) - (sl)) + (tl))
#define NORMALIZE_DRIVE(n, m)   NORMALIZE(n, -1.0, 1.0, -(m), (m))
#define ABS(n)   (((n) < 0)? -(n): (n))
#define DEADBAND(n, t)   ((ABS(n) > (t))? (n): 0)
#define BOUND_INPUT(n)   BOUND(n, -1.0, 1.0)

Define Documentation

#define __in
#define __inout
#define __out
#define ABS (  )     (((n) < 0)? -(n): (n))
#define ARRAYSIZE (  )     (sizeof(a)/sizeof(a[0]))
#define BOUND ( n,
l,
 )     (((n) < (l))? (l): ((n) > (h))? (h): (n))
#define BOUND_INPUT (  )     BOUND(n, -1.0, 1.0)
#define DEADBAND ( n,
 )     ((ABS(n) > (t))? (n): 0)
#define DIR_DEGREES ( x,
 )     RADIANS_TO_DEGREES(DIR_RADIANS(x, y))
#define DIR_RADIANS ( x,
 )     (((x == 0.0) && (y == 0.0))? 0.0: atan2(x, y))
#define FEET_PER_METER   3.280839895
 
#define GetMsecTime (  )     (GetFPGATime()/1000)
#define GRAVITY_CONSTANT   9.80665
#define GYRO_SENSITIVITY_2009   0.0125
#define GYRO_SENSITIVITY_2010   0.007
#define MAGNITUDE ( x,
 )     sqrt(pow(x, 2) + pow(y, 2))
#define METERS_PER_FOOT   (1.0/FEET_PER_METER)
#define NORMALIZE ( n,
sl,
sh,
tl,
th   )     (((n) - (sl))*((th) - (tl))/((sh) - (sl)) + (tl))
#define NORMALIZE_DRIVE ( n,
 )     NORMALIZE(n, -1.0, 1.0, -(m), (m))
#define PI   3.141592653589793
#define RADIANS_TO_DEGREES (  )     ((n)*180.0/PI)
#define SAFE_DELETE (  ) 
Value:
if (p != NULL) \
                                { \
                                    delete p; \
                                    p = NULL; \
                                }

Generated by  doxygen 1.6.2