tf_rosrust/
tf_error.rs

1use std::collections::{HashMap, HashSet};
2
3use rosrust::Time;
4use thiserror::Error;
5
6use crate::transforms::geometry_msgs::TransformStamped;
7
8/// 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)]
14    AttemptedLookupInPast(Time, Box<TransformStamped>),
15    /// Error due to the transform not yet being available.
16    #[error("tf_rosrust: AttemptedLookupInFuture {:?} < {:?}",.0, .1)]
17    AttemptedLookUpInFuture(Box<TransformStamped>, Time),
18    /// There is no path between the from and to frame.
19    #[error("tf_rosrust: CouldNotFindTransform {} -> {} ({:?})", .0, .1, .2)]
20    CouldNotFindTransform(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")]
23    CouldNotAcquireLock,
24    /// Error of rosrust
25    #[error("tf_rosrust: rosrust error {:?}", .0)]
26    Rosrust(String),
27}