diff --git a/include/LidarOdometry.h b/include/LidarOdometry.h index b27806d494a87d1960112b18c90a721519aaf722..9dd3533de5c1cb8828fa0663e5bb66fdadf089c2 100644 --- a/include/LidarOdometry.h +++ b/include/LidarOdometry.h @@ -80,7 +80,7 @@ protected: static const unsigned short mMaxDists = 100; bool mDetectWalls = true; - float mMaxDistTolerance = 0.05f, mMaxDistAbsTolerance = 0.8f, mMinDistAbsTolerance = 0.4f; + float mMaxDistTolerance = 0.05f, mMaxDistAbsTolerance = 0.8f, mMinDistAbsTolerance = 0.2f; float mMaxAngleTolerance = 0.05f; float mMaxWallAngleTolerance = 0.03f; float mMaxSearchRadius = 1.0f; diff --git a/src/LidarOdometry.cpp b/src/LidarOdometry.cpp index 6792970418004ec0950c8b68c8d22e698ee5884d..1f62ee9fb3f90a3ffcf1c283c7e1f9a6866cef51 100644 --- a/src/LidarOdometry.cpp +++ b/src/LidarOdometry.cpp @@ -569,14 +569,6 @@ double LidarOdometry::calcAngle(const Pole& pole1, const Pole& pole2) const if(isEdgeType(pole1) && isEdgeType(pole2)) return pole1.pose.orientation.z; // for walls just use their own angle geometry_msgs::Point other, p1UTM = pole1.pose.position, p2UTM = pole2.pose.position; - -// if(isEdgeType(pole1) && isEdgeType(pole2)){ -// auto points = edgeToPoints(pole1); -// geometry_msgs::Point startUTM = map2UTM(points.first, pole1.header.stamp); -// geometry_msgs::Point endUTM = map2UTM(points.second, pole1.header.stamp); -// return calcAngle((tf2::Vector3(endUTM.x-startUTM.x, endUTM.y-startUTM.y, 0.0))); -// } - if(pole1.header.frame_id == "map") p1UTM = map2UTM(pole1.pose.position, pole1.header.stamp); if(pole2.header.frame_id == "map") @@ -768,7 +760,7 @@ std::vector<std::tuple<pole_based_localization::Pole, std::vector<std::tuple<dou sqlite3_bind_double(stmt, ++i, it->second.first - dist_tol); sqlite3_bind_double(stmt, ++i, it->second.first + dist_tol); - double minAngle = it->second.second - ((angleTolerance)/it->second.first), maxAngle = it->second.second + ((angleTolerance)/it->second.first); + double minAngle = it->second.second - ((angleTolerance*10.0)/it->second.first), maxAngle = it->second.second + ((angleTolerance*10.0)/it->second.first); sqlite3_bind_double(stmt, ++i, minAngle); sqlite3_bind_double(stmt, ++i, maxAngle); @@ -1051,9 +1043,9 @@ std::array<double, 3> LidarOdometry::calcVariances(const std::vector<std::pair<P std::array<double, 3> res; measurementUncertainty = measurementUncertainty + std::min(mMaxSearchRadius/2.0, 0.3/(matchings.size()+1.0)); - res[0] = var.x + measurementUncertainty * 2.0; - res[1] = var.y + measurementUncertainty * 2.0; - res[2] = std::min(0.00001, varZ + measurementUncertainty/10.0) * 2.0; + res[0] = var.x + measurementUncertainty; + res[1] = var.y + measurementUncertainty; + res[2] = std::min(0.00001, varZ + measurementUncertainty/10.0); return res; }