From 7ea248577178f45033802ba5cc2867f8a66d69f8 Mon Sep 17 00:00:00 2001 From: Mike Turvey Date: Sun, 5 Feb 2017 23:01:34 -0700 Subject: Adding lighthousefind_tori --- tools/lighthousefind_tori/tori_includes.h | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 tools/lighthousefind_tori/tori_includes.h (limited to 'tools/lighthousefind_tori/tori_includes.h') diff --git a/tools/lighthousefind_tori/tori_includes.h b/tools/lighthousefind_tori/tori_includes.h new file mode 100644 index 0000000..a6820b5 --- /dev/null +++ b/tools/lighthousefind_tori/tori_includes.h @@ -0,0 +1,70 @@ +#ifndef __TORI_INCLUDES_H +#define __TORI_INCLUDES_H + +#include +#include +#include + + +typedef struct +{ + double x; + double y; + double z; +} Point; + +typedef struct +{ + Point point; // location of the sensor on the tracked object; + Point normal; // unit vector indicating the normal for the sensor + double theta; // "horizontal" angular measurement from lighthouse radians + double phi; // "vertical" angular measurement from lighthouse in radians. +} TrackedSensor; + +typedef struct +{ + size_t numSensors; + TrackedSensor sensor[0]; +} TrackedObject; + + +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327 +#endif + +#define SQUARED(x) ((x)*(x)) + +typedef union +{ + struct + { + unsigned char Blue; + unsigned char Green; + unsigned char Red; + unsigned char Alpha; + }; +// float float_value; + uint32_t long_value; +} RGBValue; + +static RGBValue RED = { .Red = 255, .Green = 0, .Blue = 0, .Alpha = 125 }; +static RGBValue GREEN = { .Red = 0, .Green = 255, .Blue = 0, .Alpha = 125 }; +static RGBValue BLUE = { .Red = 0, .Green = 0, .Blue = 255, .Alpha = 125 }; + +static const double WORLD_BOUNDS = 100; +#define MAX_TRACKED_POINTS 40 + +static const float DefaultPointsPerOuterDiameter = 60; + + + +typedef struct +{ + // row, column, (0,0) in upper left + double val[3][3]; +} Matrix3x3; + + +//#define TORI_DEBUG + +#endif -- cgit v1.2.3 From a4cf0b14abb17c313243d0fb84555aec2cef61a0 Mon Sep 17 00:00:00 2001 From: Mike Turvey Date: Tue, 7 Feb 2017 00:11:39 -0700 Subject: Merging math libraries --- tools/lighthousefind_tori/tori_includes.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'tools/lighthousefind_tori/tori_includes.h') diff --git a/tools/lighthousefind_tori/tori_includes.h b/tools/lighthousefind_tori/tori_includes.h index a6820b5..51cd04f 100644 --- a/tools/lighthousefind_tori/tori_includes.h +++ b/tools/lighthousefind_tori/tori_includes.h @@ -58,11 +58,6 @@ static const float DefaultPointsPerOuterDiameter = 60; -typedef struct -{ - // row, column, (0,0) in upper left - double val[3][3]; -} Matrix3x3; //#define TORI_DEBUG -- cgit v1.2.3 From ae522f8a06848d467c835d87772580fa7cceb5cd Mon Sep 17 00:00:00 2001 From: mwturvey Date: Wed, 8 Feb 2017 11:42:46 -0700 Subject: Replaced rotation algorithm & cleanup --- tools/lighthousefind_tori/tori_includes.h | 39 ++++++++++++++----------------- 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'tools/lighthousefind_tori/tori_includes.h') diff --git a/tools/lighthousefind_tori/tori_includes.h b/tools/lighthousefind_tori/tori_includes.h index 51cd04f..4cfbcdc 100644 --- a/tools/lighthousefind_tori/tori_includes.h +++ b/tools/lighthousefind_tori/tori_includes.h @@ -8,23 +8,23 @@ typedef struct { - double x; - double y; - double z; + double x; + double y; + double z; } Point; typedef struct { - Point point; // location of the sensor on the tracked object; - Point normal; // unit vector indicating the normal for the sensor - double theta; // "horizontal" angular measurement from lighthouse radians - double phi; // "vertical" angular measurement from lighthouse in radians. + Point point; // location of the sensor on the tracked object; + Point normal; // unit vector indicating the normal for the sensor + double theta; // "horizontal" angular measurement from lighthouse radians + double phi; // "vertical" angular measurement from lighthouse in radians. } TrackedSensor; typedef struct { - size_t numSensors; - TrackedSensor sensor[0]; + size_t numSensors; + TrackedSensor sensor[0]; } TrackedObject; @@ -36,15 +36,14 @@ typedef struct typedef union { - struct - { - unsigned char Blue; - unsigned char Green; - unsigned char Red; - unsigned char Alpha; - }; -// float float_value; - uint32_t long_value; + struct + { + unsigned char Blue; + unsigned char Green; + unsigned char Red; + unsigned char Alpha; + }; + uint32_t long_value; } RGBValue; static RGBValue RED = { .Red = 255, .Green = 0, .Blue = 0, .Alpha = 125 }; @@ -56,10 +55,6 @@ static const double WORLD_BOUNDS = 100; static const float DefaultPointsPerOuterDiameter = 60; - - - - //#define TORI_DEBUG #endif -- cgit v1.2.3