indoor speed

Signed-off-by: 李文龙 <liwenlong22@huawei.com>
This commit is contained in:
李文龙 2024-07-19 17:52:07 +08:00
parent fe64a3db9f
commit 53d7558ed6

View File

@ -36,6 +36,7 @@ const uint32_t NETWORK_SELF_REQUEST = 4;
const long NANOS_PER_MILLI = 1000000L;
const long MAX_GNSS_LOCATION_COMPARISON_MS = 30 * MILLI_PER_SEC;
const long MAX_INDOOR_LOCATION_COMPARISON_MS = 5 * MILLI_PER_SEC;
const double MAX_INDOOR_LOCATION_SPEED = 3.0;
FusionController* FusionController::GetInstance()
{
@ -111,9 +112,16 @@ std::unique_ptr<Location> FusionController::chooseBestLocation(const std::unique
return std::make_unique<Location>(*location);
}
if (location->GetLocationSourceType() == LocationSourceType::INDOOR_TYPE) {
if (CheckIfLastGnssLocationValid(location, std::make_unique<Location>(*lastFuseLocation)) &&
lastFuseLocation->GetSpeed() >= MAX_INDOOR_LOCATION_SPEED) {
return std::make_unique<Location>(*lastFuseLocation);
}
return std::make_unique<Location>(*location);
} else if (location->GetLocationSourceType() == LocationSourceType::GNSS_TYPE ||
location->GetLocationSourceType() == LocationSourceType::RTK_TYPE) {
if (location->GetSpeed() >= MAX_INDOOR_LOCATION_SPEED) {
return std::make_unique<Location>(*location);
}
if (CheckIfLastIndoorLocationValid(location, std::make_unique<Location>(*lastFuseLocation))) {
return std::make_unique<Location>(*lastFuseLocation);
}