Does anybody know how we can read the result of RangeScanModel component? And how can we use this component in our codelets? Thanks

RangeScanModel is used to evaluate how close two scans match each other. The key method is:

double evaluate(const Scan& expected, const Scan& measured)

That method will return a value between 0 and 1, where 1 means the two scans are very similar, and 0 means the two scans are very different.

Here is key comments from RangeScanModel.hpp:

// Range scan models describe how well two range scans match with each other. The matching result
// is expressed as a similarity value in the range [0,1]. Similar range scans will result in a value
// close to one, while dissimilar range scans will give a value close to zero.
// Range scan models are for example used by scan localization components like the
// ParticleFilterLocalization or the GridSearchLocalizer. In order for these components to work
// properly you will have to create a range scan component inside a node and specify the
// corresponding configuration parameter for the localization components.

You will need to add the either the RangeScanModelFlatloc or the RangeScanModelClassic component to your app in the json file:

"graph": {
  "nodes": [
    // ...
      "name": "my_component",
      "components": [
      // ...
        "name": "RangeScanModel",
        "type": "isaac::navigation::RangeScanModelFlatloc"

Then in your component, you’ll access it like so:

// init
range_scan_model_ = node()->app()->findComponentByName<RangeScanModel>("my_component");
if (!range_scan_model_) {
  reportFailure("Failed to load `my_component`");

// evaluate
double result = range_scan_model_->evaluate(expected_scan, measured_scan);

Here is the API documentation for this component: