Skip to content

Commit

Permalink
#679 Stream lighthouse angles also when geo data is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed Feb 11, 2021
1 parent 222bf9c commit 864ae1c
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/modules/src/lighthouse/lighthouse_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void ledTimer()
ledInternalStatus = systemStatus;
}
break;
case statusMissingData:
case statusMissingData:
if(ledInternalStatus != systemStatus)
{
lighthouseCoreSetLeds(lh_led_off, lh_led_slow_blink, lh_led_off);
Expand All @@ -185,7 +185,7 @@ void ledTimer()
break;
default:
ASSERT(false);
}
}
}
}

Expand Down Expand Up @@ -303,8 +303,7 @@ static void convertV2AnglesToV1Angles(pulseProcessorResult_t* angles) {
static void usePulseResult(pulseProcessor_t *appState, pulseProcessorResult_t* angles, int basestation, int sweepId) {
if (sweepId == sweepIdSecond) {
const bool hasCalibrationData = pulseProcessorApplyCalibration(appState, angles, basestation);
const bool hasGeoData = appState->bsGeometry[basestation].valid;
if (hasCalibrationData && hasGeoData) {
if (hasCalibrationData) {
if (lighthouseBsTypeV2 == angles->measurementType) {
// Emulate V1 base stations for now, convert to V1 angles
convertV2AnglesToV1Angles(angles);
Expand All @@ -313,17 +312,20 @@ static void usePulseResult(pulseProcessor_t *appState, pulseProcessorResult_t* a
// Send measurement to the ground
locSrvSendLighthouseAngle(basestation, angles);

baseStationActiveMapWs = baseStationActiveMapWs | (1 << basestation);

switch(estimationMethod) {
case 0:
usePulseResultCrossingBeams(appState, angles, basestation);
break;
case 1:
usePulseResultSweeps(appState, angles, basestation);
break;
default:
break;
const bool hasGeoData = appState->bsGeometry[basestation].valid;
if (hasGeoData) {
baseStationActiveMapWs = baseStationActiveMapWs | (1 << basestation);

switch(estimationMethod) {
case 0:
usePulseResultCrossingBeams(appState, angles, basestation);
break;
case 1:
usePulseResultSweeps(appState, angles, basestation);
break;
default:
break;
}
}
}

Expand Down

0 comments on commit 864ae1c

Please sign in to comment.