MCPcopy Create free account
hub / github.com/KumarRobotics/sloam / filter

Method filter

sloam/src/objects/cylinder.cpp:57–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57bool Cylinder::filter(const Scalar &maxTreeRadius, const Scalar &maxAxisTheta, const Plane &gplane)
58{
59 if (model.radius == -1)
60 return false;
61
62 // use estimated ground plane to check if the ray direction is reasonable
63 Vector3 up(gplane.model.plane[0], gplane.model.plane[1], gplane.model.plane[2]);
64 Scalar theta = (180 / PIDEF) * acos(((model.ray).dot(up)) /
65 ((model.ray).norm() * up.norm()));
66 // Remove if radius is too large or angle to up is too large
67 if ((model.radius < maxTreeRadius) &&
68 ((theta <= maxAxisTheta) || (theta >= 180 - maxAxisTheta)))
69 {
70 return true;
71 }
72 return false;
73}
74
75void Cylinder::computeModel(const std::vector<TreeVertex> &landmarkVtxs,
76 const Scalar defaultTreeRadius, const Scalar featuresPerTree)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected