25 #ifndef INCLUDED_BeaconSetupData_h_GUID_AEDF8B01_FC4D_4388_2C88_0351E5E7FD83 26 #define INCLUDED_BeaconSetupData_h_GUID_AEDF8B01_FC4D_4388_2C88_0351E5E7FD83 33 #include <opencv2/core/core.hpp> 41 using EmissionDirectionVec = ::cv::Vec3d;
42 using LocationPoint = ::cv::Point3f;
45 std::vector<OneBasedBeaconId> disabledByPattern;
46 std::vector<OneBasedBeaconId> disabledByEmptyPattern;
47 std::vector<std::pair<OneBasedBeaconId, std::string>> errors;
48 std::vector<OneBasedBeaconId> validBeacons;
54 std::vector<std::string> patterns;
55 Point3Vector locations;
56 Vec3Vector emissionDirections;
57 std::vector<double> baseMeasurementVariances;
58 std::vector<double> initialAutocalibrationErrors;
59 std::vector<bool> isFixed;
61 using size_type = std::vector<double>::size_type;
63 size_type numBeacons()
const {
return locations.size(); }
68 return LocationPoint(-10000.f, -10000.f, -87314159.f);
75 double baseMeasurementVariance,
76 double initialAutocalibrationError) {
77 patterns.resize(numBeacons);
78 locations.resize(numBeacons, getBogusLocation());
80 emissionDirections.resize(numBeacons,
81 EmissionDirectionVec(0, 0, 0));
82 baseMeasurementVariances.resize(numBeacons,
83 baseMeasurementVariance);
84 initialAutocalibrationErrors.resize(numBeacons,
85 initialAutocalibrationError);
86 isFixed.resize(numBeacons,
false);
91 isFixed.at(beacon.value()) =
true;
92 initialAutocalibrationErrors.at(beacon.value()) = 0;
111 template <
typename Stream>
113 os <<
"\n\nTarget Data Summary:\n";
114 os <<
"\nBeacons disabled by their pattern:\n";
115 for (
auto id : summary.disabledByPattern) {
116 os <<
id.value() <<
"\n";
118 os <<
"\nBeacons disabled by empty pattern:\n";
119 for (
auto id : summary.disabledByEmptyPattern) {
120 os <<
id.value() <<
"\n";
122 os <<
"\nBeacons with errors:\n";
123 for (
auto &err : summary.errors) {
124 os << err.first.value() <<
": " << err.second <<
"\n";
126 os <<
"\nValid beacons:\n";
127 for (
auto id : summary.validBeacons) {
128 os <<
id.value() <<
" ";
136 #endif // INCLUDED_BeaconSetupData_h_GUID_AEDF8B01_FC4D_4388_2C88_0351E5E7FD83 ZeroBasedBeaconId makeZeroBased(OneBasedBeaconId id)
Overloaded conversion function to turn any beacon ID into zero-based, respecting the convention that ...
Definition: BeaconIdTypes.h:99
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
static LocationPoint getBogusLocation()
This is both an entirely unlikely out of bounds value and a specific sentinel value.
Definition: BeaconSetupData.h:67
void markBeaconFixed(ZeroBasedBeaconId beacon)
Mark a beacon, by zero-based ID, as being fixed.
Definition: BeaconSetupData.h:90
void markBeaconFixed(OneBasedBeaconId beacon)
Mark a beacon, by one-based ID, as being fixed.
Definition: BeaconSetupData.h:95
Definition: BeaconSetupData.h:44
Data for a full target (all the beacons), unswizzled into a "struct of vectors".
Definition: BeaconSetupData.h:53
void setBeaconCount(std::size_t numBeacons, double baseMeasurementVariance, double initialAutocalibrationError)
Resizes all arrays to the numBeacons.
Definition: BeaconSetupData.h:74