1use std::collections::{HashMap, HashSet};
23use r2r::{builtin_interfaces::msg::Time, geometry_msgs::msg::TransformStamped};
4use thiserror::Error;
56/// Enumerates the different types of errors
7#[derive(Clone, Debug, Error)]
8#[non_exhaustive]
9pub enum TfError {
10/// Error due to looking up too far in the past. I.E the information is no longer available in the TF Cache.
11#[error("tf_r2r: AttemptedLookupInPast {:?} < {:?}",.0, .1)]
12AttemptedLookupInPast(Time, Box<TransformStamped>),
13/// Error due to the transform not yet being available.
14#[error("tf_r2r: AttemptedLookupInFuture {:?} < {:?}",.0, .1)]
15AttemptedLookUpInFuture(Box<TransformStamped>, Time),
16/// There is no path between the from and to frame.
17#[error("tf_r2r: CouldNotFindTransform {} -> {} ({:?})", .0, .1, .2)]
18CouldNotFindTransform(String, String, HashMap<String, HashSet<String>>),
19/// In the event that a write is simultaneously happening with a read of the same tf buffer
20#[error("tf_r2r: CouldNotAcquireLock")]
21CouldNotAcquireLock,
22/// Error of r2r
23#[error("tf_r2r: r2r error {:?}", .0)]
24R2r(String),
25}