> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# File distance_calculator.h

![][C++]

**Location**: `autonomy/evaluator/distance_calculator/distance_calculator.h`

## Classes

* [simulation\_framework::evaluator::DistanceDrivenCalculator](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/classsimulation__framework_1_1evaluator_1_1DistanceDrivenCalculator.md)

## Namespaces

* [simulation\_framework](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/namespacesimulation__framework.md)
* [evaluator](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/namespaceevaluator.md)
* [simulation\_framework::evaluator](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/namespacesimulation__framework_1_1evaluator.md)

## Includes

* \<osi\_groundtruth.pb.h>
* \<optional>

## Included by

* [distance\_calculator.cpp](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/distance__calculator_8cpp.md)
* [distance\_driven\_evaluator.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/distance__driven__evaluator_8h.md)

## Source

```cpp theme={null}


#ifndef SIMFWK_AUTONOMY_AUTONOMY_EVALUATOR_DISTANCECALCULATOR_DISTANCECALCULATOR_H
#define SIMFWK_AUTONOMY_AUTONOMY_EVALUATOR_DISTANCECALCULATOR_DISTANCECALCULATOR_H

#include <osi_groundtruth.pb.h>
#include <optional>

namespace simulation_framework
{

namespace evaluator
{


class DistanceDrivenCalculator
{
  public:
    double Calculate(const osi3::GroundTruth& ground_truth);

  private:
    std::optional<double> last_xpos_;
    std::optional<double> last_ypos_;
    bool is_initialized_{false};
};

}  // namespace evaluator
}  // namespace simulation_framework

#endif  // SIMFWK_AUTONOMY_AUTONOMY_EVALUATOR_DISTANCECALCULATOR_DISTANCECALCULATOR_H
```

[private]: https://img.shields.io/badge/-private-red "private"

[public]: https://img.shields.io/badge/-public-brightgreen "public"

[const]: https://img.shields.io/badge/-const-lightblue "const"

[C++]: https://img.shields.io/badge/language-C%2B%2B-blue "C++"

[protected]: https://img.shields.io/badge/-protected-yellow "protected"

[static]: https://img.shields.io/badge/-static-lightgrey "static"
