    

 ## On this page

  

 

 # File distance\_calculator.h

 Last update: 22.04.2026 

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

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

## Classes

- [simulation\_framework::evaluator::DistanceDrivenCalculator](classsimulation__framework_1_1evaluator_1_1DistanceDrivenCalculator.md#classsimulation__framework_1_1evaluator_1_1DistanceDrivenCalculator)

## Namespaces

- [simulation\_framework](namespacesimulation__framework.md#namespacesimulation__framework)
- [evaluator](namespaceevaluator.md#namespaceevaluator)
- [simulation\_framework::evaluator](namespacesimulation__framework_1_1evaluator.md#namespacesimulation__framework_1_1evaluator)

## Includes

- &lt;osi\_groundtruth.pb.h&gt;
- 

## Included by

- [distance\_calculator.cpp](distance__calculator_8cpp.md#distance__calculator_8cpp)
- [distance\_driven\_evaluator.h](distance__driven__evaluator_8h.md#distance__driven__evaluator_8h)

## Source

```cpp


#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

```