aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ootx_decoder.c7
-rw-r--r--src/ootx_decoder.h2
-rw-r--r--src/poser_sba.c18
-rwxr-xr-xsrc/survive_cal.c5
4 files changed, 21 insertions, 11 deletions
diff --git a/src/ootx_decoder.c b/src/ootx_decoder.c
index 7d45626..e110d11 100644
--- a/src/ootx_decoder.c
+++ b/src/ootx_decoder.c
@@ -37,6 +37,7 @@ void ootx_init_decoder_context(ootx_decoder_context *ctx) {
ctx->preamble = 0XFFFFFFFF;
ctx->bits_processed = 0;
ctx->found_preamble = 0;
+ ctx->ignore_sync_bit_error = 0;
ctx->buffer = (uint8_t*)malloc(MAX_BUFF_SIZE);
ctx->payload_size = (uint16_t*)ctx->buffer;
@@ -122,9 +123,11 @@ void ootx_pump_bit(ootx_decoder_context *ctx, uint8_t dbit) {
// printf("drop %d\n", dbit);
if( !dbit )
{
- //printf("Bad sync bit\n");
+ // printf("Bad sync bit\n");
ootx_error(ctx, "OOTX Decoder: Bad sync bit");
- ootx_reset_buffer(ctx);
+
+ if (ctx->ignore_sync_bit_error == 0)
+ ootx_reset_buffer(ctx);
}
ctx->bits_processed = 0;
}
diff --git a/src/ootx_decoder.h b/src/ootx_decoder.h
index a96cb03..8360838 100644
--- a/src/ootx_decoder.h
+++ b/src/ootx_decoder.h
@@ -25,7 +25,7 @@ typedef struct {
uint8_t found_preamble;
uint8_t bit_count[2];
-
+ int ignore_sync_bit_error;
void * user;
int user1;
} ootx_decoder_context;
diff --git a/src/poser_sba.c b/src/poser_sba.c
index b049c80..8437d4d 100644
--- a/src/poser_sba.c
+++ b/src/poser_sba.c
@@ -20,13 +20,17 @@
#include "survive_kalman.h"
#include "survive_reproject.h"
-
-STATIC_CONFIG_ITEM( SBA_USE_IMU, "sba-use-imu", 'i', "[TODO: I don't know what this does]", 1 );
-STATIC_CONFIG_ITEM( SBA_REQUIRED_MEAS, "sba-required-meas", 'i', "[TODO: I don't know what this does]", 8 );
-STATIC_CONFIG_ITEM( SBA_TIME_WINDOW, "sba-time-window", 'i', "[TODO: I don't know what this does]", (int)SurviveSensorActivations_default_tolerance );
-STATIC_CONFIG_ITEM( SBA_SENSOR_VARIANCE_PER_SEC, "sba-sensor-variance-per-sec", 'f', "[TODO: I don't know what this does]", 10.0 );
-STATIC_CONFIG_ITEM( SBA_SENSOR_VARIANCE, "sba-sensor-variance", 'f', "[TODO: I don't know what this does]", 1.0 );
-STATIC_CONFIG_ITEM( SBA_USE_JACOBIAN_FUNCTION, "sba-use-jacobian-function", 'i', "Poser to be used to seed optimizer", 1);
+STATIC_CONFIG_ITEM(SBA_USE_IMU, "sba-use-imu", 'i', "Use the IMU as part of SBA", 1);
+STATIC_CONFIG_ITEM(SBA_REQUIRED_MEAS, "sba-required-meas", 'i',
+ "Minimum number of measurements needed to try and solve for position", 8);
+STATIC_CONFIG_ITEM(SBA_TIME_WINDOW, "sba-time-window", 'i',
+ "The length, in ticks, between sensor inputs to treat them as one snapshot",
+ (int)SurviveSensorActivations_default_tolerance);
+STATIC_CONFIG_ITEM(SBA_SENSOR_VARIANCE_PER_SEC, "sba-sensor-variance-per-sec", 'f',
+ "Variance per second to add to the sensor input -- discounts older data", 10.0);
+STATIC_CONFIG_ITEM(SBA_SENSOR_VARIANCE, "sba-sensor-variance", 'f', "Base variance for each sensor input", 1.0);
+STATIC_CONFIG_ITEM(SBA_USE_JACOBIAN_FUNCTION, "sba-use-jacobian-function", 'i',
+ "If set to false, a slower numerical approximation of the jacobian is used", 1);
typedef struct {
PoserData *pdfs;
diff --git a/src/survive_cal.c b/src/survive_cal.c
index f270065..a9f9e00 100755
--- a/src/survive_cal.c
+++ b/src/survive_cal.c
@@ -31,6 +31,7 @@ int mkdir(const char *);
STATIC_CONFIG_ITEM( REQ_TRACK_FOR_CAL, "requiredtrackersforcal", 's', "Which devices will be used, i.e. HMD,WM0,WM1", "" );
STATIC_CONFIG_ITEM( ALLOW_TRACK_FOR_CAL, "allowalltrackersforcal", 'i', "Allow use of additional connected devices for calibration", 0 );
STATIC_CONFIG_ITEM( CONFIG_POSER, "configposer", 's', "Poser used for calibration step", "SBA" );
+STATIC_CONFIG_ITEM(OOTX_IGNORE_SYNC_ERROR, "ootx-ignore-sync-error", 'i', "Ignore sync errors on ootx packets", 0);
#define PTS_BEFORE_COMMON 32
#define NEEDED_COMMON_POINTS 10
@@ -52,7 +53,8 @@ static void reset_calibration( struct SurviveCalData * cd );
void ootx_error_clbk_d(ootx_decoder_context *ct, const char *msg) {
SurviveContext *ctx = (SurviveContext *)(ct->user);
- SV_INFO("%s", msg);
+ int id = ct->user1;
+ SV_INFO("(%d) %s", id, msg);
}
void ootx_packet_clbk_d(ootx_decoder_context *ct, ootx_packet* packet)
@@ -142,6 +144,7 @@ void survive_cal_install( struct SurviveContext * ctx )
for( i = 0; i < NUM_LIGHTHOUSES; i++ )
{
ootx_init_decoder_context(&cd->ootx_decoders[i]);
+ survive_attach_configi(ctx, "ootx-ignore-sync-error", &cd->ootx_decoders[i].ignore_sync_bit_error);
cd->ootx_decoders[i].user = ctx;
cd->ootx_decoders[i].user1 = i;
}