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