45 #include <RobotComponents/interface/components/LaserScannerFeatureExtraction/LaserScannerFeatureExtraction.h>
110 void createRemoteGuiTab();
115 void RemoteGui_update() override;
119 struct FramedFeatures
121 std::vector<Features> features;
125 void runPeriodically();
128 const std::vector<Features>& features);
130 Throttler& getOrCreateThrottler(std::string frame);
132 void drawFeatures(
const std::vector<Features>& features,
134 const std::string frame,
136 const Eigen::Isometry3f& global_T_sensor);
138 void mergeFeatures(
const std::vector<FramedFeatures>& framedFeatures,
151 void drawBoxes(const Properties& p, viz::Client& arviz);
155 static const std::string defaultName;
160 int taskPeriodMs = 100;
189 .angleThreshold = 2 * M_PIf32 / 1000.F * 5.F,
190 .maxDistance = 3
'000.F // [mm]
193 ChainApproximation::Params chainApproximationParams{
194 .distanceTh = 40.F // [mm]
199 bool drawRawPoints = {true};
200 bool visualizeSeparateFeatures = {false};
201 bool visualizeMergedFeatures = {true};
205 Properties properties;
206 /* Use a mutex if you access variables from different threads
207 * (e.g. ice functions and RemoteGui_update()).
208 std::mutex propertiesMutex;
211 /* (Requires the armarx::LightweightRemoteGuiComponentPluginUser.)
213 struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
215 armarx::RemoteGui::Client::LineEdit boxLayerName;
216 armarx::RemoteGui::Client::IntSpinBox numBoxes;
218 armarx::RemoteGui::Client::Button drawBoxes;
223 /* (Requires the armarx::ArVizComponentPluginUser.)
224 * When used from different threads, an ArViz client needs to be synchronized.
226 std::mutex arvizMutex;
229 PeriodicTask<LaserScannerFeatureExtraction>::pointer_type task;
231 std::unique_ptr<FeatureExtractor> featureExtractor;
232 std::unique_ptr<ArVizDrawer> arVizDrawer;
234 std::unique_ptr<FrequencyReporter> frequencyReporterPublish;
235 std::unique_ptr<FrequencyReporter> frequencyReporterRun;
237 std::unordered_map<std::string, Throttler> throttlers;
239 VirtualRobot::RobotPtr robot;
241 LaserScannerFeaturesListenerPrx featuresTopic;
243 std::variant<std::monostate, VirtualRobot::MathTools::ConvexHull2DPtr, Eigen::Vector2f>
245 VirtualRobot::MathTools::ConvexHull2DPtr cableArea;
248 armem::client::plugins::ReaderWriterPlugin<armem::laser_scans::client::Reader>*
249 laserScannerReaderPlugin = nullptr;
252 armem::client::plugins::ReaderWriterPlugin<memory::client::laser_scanner_features::Writer>*
253 laserScannerFeatureWriterPlugin = nullptr;
255 } // namespace armarx::navigation::components::laser_scanner_feature_extraction