51 std::vector<double> meanErrorXYZ;
52 config[
"noise"][
"cartesian"].
getElement<std::vector<double>>(&meanErrorXYZ,
"mean");
53 this->
errorMeanXYZ = Eigen::Vector3d(meanErrorXYZ[0], meanErrorXYZ[1], meanErrorXYZ[2]);
55 std::vector<double> sigmaErrorXYZ;
56 config[
"noise"][
"cartesian"].
getElement<std::vector<double>>(&sigmaErrorXYZ,
"sigma");
57 this->
errorSigmaXYZ = Eigen::Vector3d(sigmaErrorXYZ[0], sigmaErrorXYZ[1], sigmaErrorXYZ[2]);
59 std::vector<double> meanErrorAngle;
60 config[
"noise"][
"angle"].
getElement<std::vector<double>>(&meanErrorAngle,
"mean");
61 this->
errorMeanAngle = Eigen::Vector2d(meanErrorAngle[0], meanErrorAngle[1]);
63 std::vector<double> sigmaErrorAngle;
64 config[
"noise"][
"angle"].
getElement<std::vector<double>>(&sigmaErrorAngle,
"sigma");
65 this->
errorSigmaAngle = Eigen::Vector2d(sigmaErrorAngle[0], sigmaErrorAngle[1]);
139 std::vector<Landmark> listNew;
142 std::default_random_engine generator(
numFrames);
153 Eigen::Matrix3d rotationJacobian;
157 double dist = lm.position.norm();
158 double theta = std::acos(lm.position.z() / dist);
159 double phi = std::atan2(lm.position.y(), lm.position.x());
161 Eigen::Matrix3d covSpherical = Eigen::Matrix3d::Zero();
167 rotationJacobian(0, 0) = dist * std::cos(theta) * std::cos(phi);
168 rotationJacobian(0, 1) = dist * std::sin(theta) * -std::sin(phi);
169 rotationJacobian(0, 2) = std::sin(theta) * std::cos(phi);
171 rotationJacobian(1, 0) = dist * std::cos(theta) * std::sin(phi);
172 rotationJacobian(1, 1) = dist * std::sin(theta) * std::cos(phi);
173 rotationJacobian(1, 2) = std::sin(theta) * std::sin(phi);
175 rotationJacobian(2, 0) = -dist * std::sin(theta);
176 rotationJacobian(2, 1) = 0.0;
177 rotationJacobian(2, 2) = std::cos(theta);
179 theta += distTheta(generator);
180 phi += distPhi(generator);
182 dist += dist * distRangeRelative(generator);
183 dist += distRange(generator);
185 lm.position.x() = dist * std::sin(theta) * std::cos(phi);
186 lm.position.y() = dist * std::sin(theta) * std::sin(phi);
187 lm.position.z() = dist * std::cos(theta);
189 lm.position.x() += distX(generator);
190 lm.position.y() += distY(generator);
191 lm.position.z() += distZ(generator);
193 lm.cov = rotationJacobian * covSpherical * rotationJacobian.transpose();
198 listNew.push_back(lm);
205 std::vector<Landmark> listNew;
206 bool detect_big_orange =
true;
207 bool detect_timekeeping =
true;
208 std::default_random_engine random_generator(this->
numFrames);
209 std::uniform_real_distribution<double> unif(0, 1.0);
215 double dist = lm.position.norm();
226 if (std::find(detectionClasses.begin(), detectionClasses.end(), lm.type) == detectionClasses.end())
231 lm.typeWeights[lm.type] = prob;
232 for (
auto i : detectionClasses)
236 lm.typeWeights[i] = (1 - prob) / ((
double)detectionClasses.size() - 1);
240 double randomNum = unif(random_generator);
244 acc += lm.typeWeights[i];
247 double tmp = lm.typeWeights[i];
248 lm.typeWeights[i] = lm.typeWeights[lm.type];
249 lm.typeWeights[lm.type] = tmp;
255 listNew.push_back(lm);
262 std::vector<Landmark> listNew;
264 std::default_random_engine random_generator(this->
numFrames);
265 std::uniform_real_distribution<double> unif(0, 1.0);
269 double dist = lm.position.norm();
274 double random = unif(random_generator);
275 if (random < detection_prob)
277 lm.detection_probability = detection_prob;
278 listNew.push_back(lm);