tf_r2r/
tf_error.rs

1use std::collections::{HashMap, HashSet};
2
3use r2r::{builtin_interfaces::msg::Time, geometry_msgs::msg::TransformStamped};
4use thiserror::Error;
5
6/// 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)]
12    AttemptedLookupInPast(Time, Box<TransformStamped>),
13    /// Error due to the transform not yet being available.
14    #[error("tf_r2r: AttemptedLookupInFuture {:?} < {:?}",.0, .1)]
15    AttemptedLookUpInFuture(Box<TransformStamped>, Time),
16    /// There is no path between the from and to frame.
17    #[error("tf_r2r: CouldNotFindTransform {} -> {} ({:?})", .0, .1, .2)]
18    CouldNotFindTransform(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")]
21    CouldNotAcquireLock,
22    /// Error of r2r
23    #[error("tf_r2r: r2r error {:?}", .0)]
24    R2r(String),
25}