#define MACH 343 // speed of sound in m/s /*#define ds 0.3 // distance between sensors in m (should be in equilateral triangle shape)*/ #define ns_to_s(x) (x / 1000000000) // convert nanoseconds to seconds #define pi 3.14159265358979323846 // ... pi. Like the constant, y'know? /* relative positions of sensors */ #define TOP 0 #define LEFT 1 #define RIGHT 2 #define TOPLEFT 0 #define LEFTRIGHT 1 #define RIGHTTOP 2 typedef struct { double x; double y; } coord; typedef struct { int sensor_id[3]; PaStream *sensor_stream[2]; double ds; int16_t sensor_data[2]; int16_t threshold; } sonar_config; void sonar_init (void); void sonar_listdev (void); void sonar_getloc ( coord *loc, sonar_config conf ); int sonar_coord_cmp (coord a, coord b);