1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use nalgebra::Isometry3;

use crate::{Error, TransformResolver};

/// Dummy TransformResolver for debug or tests.
#[derive(Debug)]
pub struct DummyTransformResolver {
    pub transformation: Isometry3<f64>,
}

impl DummyTransformResolver {
    /// Creates a new `DummyTransformResolver`.
    pub fn new() -> Self {
        Self {
            transformation: Isometry3::identity(),
        }
    }
}

impl Default for DummyTransformResolver {
    fn default() -> Self {
        Self::new()
    }
}

impl TransformResolver for DummyTransformResolver {
    fn resolve_transformation(
        &self,
        _from: &str,
        _to: &str,
        _time: std::time::SystemTime,
    ) -> Result<Isometry3<f64>, Error> {
        Ok(self.transformation)
    }
}