25 #ifndef INCLUDED_BeaconBasedPoseEstimator_h_GUID_7B983CED_F2C5_4B86_109A_948863B665B1 26 #define INCLUDED_BeaconBasedPoseEstimator_h_GUID_7B983CED_F2C5_4B86_109A_948863B665B1 52 cv::Point2d measurement = {0, 0};
53 cv::Point2d residual = {0, 0};
55 void reset() { *
this = BeaconData{}; }
66 return [](
int id) {
return id <= 4; };
81 size_t requiredInliers = 4,
82 size_t permittedOutliers = 2,
84 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
93 bool EstimatePoseFromLeds(LedGroup &leds,
OSVR_TimeValue const &tv,
96 std::size_t getNumBeacons()
const {
return m_beacons.size(); }
101 bool ProjectBeaconsToImage(std::vector<cv::Point2f> &outPose);
105 void permitKalmanMode(
bool permitKalman);
113 Eigen::Vector3d GetLinearVelocity()
const;
114 Eigen::Vector3d GetAngularVelocity()
const;
120 bool SetBeacons(
const Point3Vector &beacons,
121 Vec3Vector
const &emissionDirection,
122 std::vector<double>
const &variance,
124 double beaconAutocalibErrorScale = 1);
128 void dumpBeaconLocationsToStream(std::ostream &os)
const;
130 std::vector<BeaconData>
const &getBeaconDebugData()
const {
131 return m_beaconDebugData;
134 Eigen::Vector3d getBeaconAutocalibPosition(std::size_t i)
const;
136 Eigen::Vector3d getBeaconAutocalibVariance(std::size_t i)
const;
139 void m_updateBeaconCentroid(
const Point3Vector &beacons);
140 void m_updateBeaconDebugInfoArray();
143 Eigen::Vector3d m_convertInternalPositionRepToExternal(
144 Eigen::Vector3d
const &pos)
const;
147 bool m_estimatePoseFromLeds(LedGroup &leds,
OSVR_TimeValue const &tv,
152 bool m_pnpransacEstimator(LedGroup &leds);
156 bool m_kalmanAutocalibEstimator(LedGroup &leds,
double dt);
164 bool m_forceRansacIfKalmanNeedsReset(LedGroup
const &leds);
168 void m_resetState(Eigen::Vector3d
const &xlate,
171 using BeaconStateVec = std::vector<std::unique_ptr<BeaconState>>;
172 BeaconStateVec m_beacons;
173 std::vector<double> m_beaconMeasurementVariance;
175 std::vector<bool> m_beaconFixed;
176 Vec3Vector m_beaconEmissionDirection;
178 std::vector<BeaconData> m_beaconDebugData;
181 size_t m_requiredInliers;
182 size_t m_permittedOutliers;
189 Eigen::Vector3d m_centroid;
194 bool m_gotPrev =
false;
196 bool m_permitKalman =
true;
203 bool m_gotPose =
false;
205 bool m_gotMeasurement =
false;
220 std::size_t m_framesInProbation = 0;
223 std::size_t m_framesWithoutUtilizedMeasurements = 0;
225 std::size_t m_framesWithoutIdentifiedBlobs = 0;
232 #endif // INCLUDED_BeaconBasedPoseEstimator_h_GUID_7B983CED_F2C5_4B86_109A_948863B665B1
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Definition: CameraParameters.h:41
Header file for class that tracks and identifies LEDs.
std::function< bool(int)> BeaconIDPredicate
Takes in a 1-based index, returns true or false (true if the beacon should be considered fixed - not ...
Definition: Types.h:81
General configuration parameters.
Definition: ConfigParams.h:82
Class to track an object that has identified LED beacons on it as seen in a camera, where the absolute location of the LEDs with respect to a common frame of reference is known.
Definition: BeaconBasedPoseEstimator.h:63
Header providing a C++ wrapper around TimeValueC.h.
Definition: Quaternion.h:47
A structure defining a 3D (6DOF) rigid body pose: translation and rotation.
Definition: Pose3C.h:54
Definition: PoseState.h:164
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Definition: TimeValueC.h:81
A very simple (3D by default) vector state with no velocity, ideal for use as a position, with ConstantProcess for beacon autocalibration.
Definition: PureVectorState.h:40
A basically-constant-velocity model, with the addition of some damping of the velocities inspired by ...
Definition: PoseSeparatelyDampedConstantVelocity.h:43