From 195053d034b2bca63db1f72be14bff9b2c7b1916 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Fri, 17 Mar 2017 01:13:42 -0400 Subject: bump rawdraw to newest version. --- calibrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index 9633a77..3d83baf 100644 --- a/calibrate.c +++ b/calibrate.c @@ -7,7 +7,7 @@ #include #include #include "src/survive_cal.h" -#include +#include #include "src/survive_config.h" -- cgit v1.2.3 From 743e4b60f03db3c8c340b63b8d27eac579e146dd Mon Sep 17 00:00:00 2001 From: CNLohr Date: Fri, 17 Mar 2017 03:10:55 -0400 Subject: Update Windows build to reflect changes in RawDraw. --- calibrate.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index 3d83baf..726a8cc 100644 --- a/calibrate.c +++ b/calibrate.c @@ -40,6 +40,10 @@ void HandleMotion( int x, int y, int mask ) { } +void HandleDestroy() +{ +} + //int bufferpts[32*2*3][2]; int bufferpts[32*2*3][2]; -- cgit v1.2.3 From 8253e3c3adbb54ebc3d3c8e02c017e900a83edb0 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Mon, 20 Mar 2017 01:42:32 -0400 Subject: log synctimes. --- calibrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index 726a8cc..f27131a 100644 --- a/calibrate.c +++ b/calibrate.c @@ -56,7 +56,7 @@ void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int // if( timeinsweep < 0 ) return; survive_default_light_process( so, sensor_id, acode, timeinsweep, timecode, length ); if( sensor_id < 0 ) return; - if( acode == -1 ) return; + if( acode < 0 ) return; //return; int jumpoffset = sensor_id; if( strcmp( so->codename, "WM0" ) == 0 ) jumpoffset += 32; -- cgit v1.2.3 From 472d05c2a356ec6d71669d67fb599e401a6f4a76 Mon Sep 17 00:00:00 2001 From: Mike Turvey Date: Thu, 23 Mar 2017 00:25:25 -0700 Subject: Updated disambiguator. Solid OOTX --- calibrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index 726a8cc..0f2d6ac 100644 --- a/calibrate.c +++ b/calibrate.c @@ -51,10 +51,10 @@ int bufferpts[32*2*3][2]; char buffermts[32*128*3]; int buffertimeto[32*3][2]; -void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length ) +void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length, int lh) { // if( timeinsweep < 0 ) return; - survive_default_light_process( so, sensor_id, acode, timeinsweep, timecode, length ); + survive_default_light_process( so, sensor_id, acode, timeinsweep, timecode, length, lh); if( sensor_id < 0 ) return; if( acode == -1 ) return; //return; -- cgit v1.2.3 From 280a6599fea76a7d2c16cfe0fcc5c8f37fde66de Mon Sep 17 00:00:00 2001 From: mwturvey Date: Thu, 23 Mar 2017 09:47:38 -0700 Subject: More cleanup --- calibrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index 0f2d6ac..82869e0 100644 --- a/calibrate.c +++ b/calibrate.c @@ -51,7 +51,7 @@ int bufferpts[32*2*3][2]; char buffermts[32*128*3]; int buffertimeto[32*3][2]; -void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length, int lh) +void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length, uint32_t lh) { // if( timeinsweep < 0 ) return; survive_default_light_process( so, sensor_id, acode, timeinsweep, timecode, length, lh); -- cgit v1.2.3 From a576703242adea11c012af5afdff38af84d22e2e Mon Sep 17 00:00:00 2001 From: mwturvey Date: Fri, 24 Mar 2017 13:44:38 -0700 Subject: Adaptive Acode Offset Compensation --- calibrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index 62acbf6..6e2b5d1 100644 --- a/calibrate.c +++ b/calibrate.c @@ -59,7 +59,7 @@ void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int if( acode < 0 ) return; //return; int jumpoffset = sensor_id; - if( strcmp( so->codename, "WM0" ) == 0 ) jumpoffset += 32; + if( strcmp( so->codename, "WM0" ) == 0 || strcmp( so->codename, "WW0" ) == 0) jumpoffset += 32; else if( strcmp( so->codename, "WM1" ) == 0 ) jumpoffset += 64; -- cgit v1.2.3 From f7d1c19e299df46087eb8693d2d0c0637d2e395f Mon Sep 17 00:00:00 2001 From: mwturvey Date: Fri, 24 Mar 2017 13:52:21 -0700 Subject: Fix Calibrate visualization to use proper lighthouse data --- calibrate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index 6e2b5d1..ee22abf 100644 --- a/calibrate.c +++ b/calibrate.c @@ -63,24 +63,24 @@ void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int else if( strcmp( so->codename, "WM1" ) == 0 ) jumpoffset += 64; - if( acode == 0 || acode == 2 ) //data = 0 + if( acode % 2 == 0 && lh == 0) //data = 0 { bufferpts[jumpoffset*2+0][0] = (timeinsweep-100000)/500; buffertimeto[jumpoffset][0] = 0; } - if( acode == 1 || acode == 3 ) //data = 1 + if( acode % 2 == 1 && lh == 0 ) //data = 1 { bufferpts[jumpoffset*2+1][0] = (timeinsweep-100000)/500; buffertimeto[jumpoffset][0] = 0; } - if( acode == 4 || acode == 6 ) //data = 0 + if( acode % 2 == 0 && lh == 1 ) //data = 0 { bufferpts[jumpoffset*2+0][1] = (timeinsweep-100000)/500; buffertimeto[jumpoffset][1] = 0; } - if( acode == 5 || acode == 7 ) //data = 1 + if( acode % 2 == 1 && lh == 1 ) //data = 1 { bufferpts[jumpoffset*2+1][1] = (timeinsweep-100000)/500; buffertimeto[jumpoffset][1] = 0; -- cgit v1.2.3 From 4dc1d72785c660c206f8def9d8c8aa32289c2709 Mon Sep 17 00:00:00 2001 From: mwturvey Date: Fri, 24 Mar 2017 15:19:59 -0700 Subject: More cleanup & finishing genericization of calibrator --- calibrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index ee22abf..abf592a 100644 --- a/calibrate.c +++ b/calibrate.c @@ -99,9 +99,9 @@ void my_imu_process( struct SurviveObject * so, int mask, FLT * accelgyro, uint3 } -void my_angle_process( struct SurviveObject * so, int sensor_id, int acode, uint32_t timecode, FLT length, FLT angle ) +void my_angle_process( struct SurviveObject * so, int sensor_id, int acode, uint32_t timecode, FLT length, FLT angle, uint32_t lh) { - survive_default_angle_process( so, sensor_id, acode, timecode, length, angle ); + survive_default_angle_process( so, sensor_id, acode, timecode, length, angle, lh ); } char* sensor_name[32]; -- cgit v1.2.3 From af0427bea12da9377eca4cc6a768762cf5a311c4 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Fri, 7 Apr 2017 00:52:11 -0400 Subject: Make output more visually clear (expanding window of possible area for angle sources. --- calibrate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index abf592a..3554295 100644 --- a/calibrate.c +++ b/calibrate.c @@ -62,27 +62,26 @@ void my_light_process( struct SurviveObject * so, int sensor_id, int acode, int if( strcmp( so->codename, "WM0" ) == 0 || strcmp( so->codename, "WW0" ) == 0) jumpoffset += 32; else if( strcmp( so->codename, "WM1" ) == 0 ) jumpoffset += 64; - if( acode % 2 == 0 && lh == 0) //data = 0 { - bufferpts[jumpoffset*2+0][0] = (timeinsweep-100000)/500; + bufferpts[jumpoffset*2+0][0] = (timeinsweep-100000)/300; buffertimeto[jumpoffset][0] = 0; } if( acode % 2 == 1 && lh == 0 ) //data = 1 { - bufferpts[jumpoffset*2+1][0] = (timeinsweep-100000)/500; + bufferpts[jumpoffset*2+1][0] = (timeinsweep-100000)/300; buffertimeto[jumpoffset][0] = 0; } if( acode % 2 == 0 && lh == 1 ) //data = 0 { - bufferpts[jumpoffset*2+0][1] = (timeinsweep-100000)/500; + bufferpts[jumpoffset*2+0][1] = (timeinsweep-100000)/300; buffertimeto[jumpoffset][1] = 0; } if( acode % 2 == 1 && lh == 1 ) //data = 1 { - bufferpts[jumpoffset*2+1][1] = (timeinsweep-100000)/500; + bufferpts[jumpoffset*2+1][1] = (timeinsweep-100000)/300; buffertimeto[jumpoffset][1] = 0; } } -- cgit v1.2.3 From 8d33ea461c38547736f963a575dd8dbc929383d9 Mon Sep 17 00:00:00 2001 From: Joshua Allen Date: Sat, 8 Apr 2017 10:30:57 -0400 Subject: clarify comment --- calibrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index 3554295..71bdcab 100644 --- a/calibrate.c +++ b/calibrate.c @@ -131,8 +131,8 @@ void * GuiThread( void * v ) uint8_t g = 0x00; uint8_t b = 0xff; - if (nn==0) b = 0; //lighthouse B - if (nn==1) r = 0; //lighthouse C + if (nn==0) b = 0; //lighthouse B, red, master + if (nn==1) r = 0; //lighthouse C, blue, slave // r = (r * (5-buffertimeto[i][nn])) / 5 ; // g = (g * (5-buffertimeto[i][nn])) / 5 ; -- cgit v1.2.3 From 1398b5dd201a69d4c769adce4bf4eabb5e3a28fa Mon Sep 17 00:00:00 2001 From: Joshua Allen Date: Sat, 8 Apr 2017 17:40:56 -0400 Subject: don't paint 0 coordinates --- calibrate.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'calibrate.c') diff --git a/calibrate.c b/calibrate.c index 71bdcab..67c1d27 100644 --- a/calibrate.c +++ b/calibrate.c @@ -138,6 +138,9 @@ void * GuiThread( void * v ) // g = (g * (5-buffertimeto[i][nn])) / 5 ; // b = (b * (5-buffertimeto[i][nn])) / 5 ; CNFGColor( (b<<16) | (g<<8) | r ); + + if (bufferpts[i*2+0][nn] == 0 || bufferpts[i*2+1][nn]==0) continue; //do not draw if aither coordinate is 0 + CNFGTackRectangle( bufferpts[i*2+0][nn], bufferpts[i*2+1][nn], bufferpts[i*2+0][nn] + 5, bufferpts[i*2+1][nn] + 5 ); CNFGPenX = bufferpts[i*2+0][nn]; CNFGPenY = bufferpts[i*2+1][nn]; CNFGDrawText( buffermts, 2 ); -- cgit v1.2.3