1use std::io;
18
19use thiserror::Error;
20
21#[derive(Debug)]
22pub enum UnfeasibleTrajectoryPoint {
23 Start,
24 WayPoint,
25 Goal,
26}
27
28#[derive(Debug, Error)]
30#[non_exhaustive]
31pub enum Error {
32 #[error("{}", error)]
33 Other { error: String },
34 #[error("Node name {} not found", .0)]
35 NotFound(String),
36 #[error("Collision error: {collision_link_names:?} is colliding ({point:?})")]
37 Collision {
38 point: UnfeasibleTrajectoryPoint,
39 collision_link_names: Vec<String>,
40 },
41 #[error("Self Collision error: {collision_link_names:?} is colliding ({point:?})")]
42 SelfCollision {
43 point: UnfeasibleTrajectoryPoint,
44 collision_link_names: Vec<(String, String)>,
45 },
46 #[error("Interpolation error: {:?}", .0)]
47 InterpolationError(String),
48 #[error("IO error {:?}", source)]
49 Io {
50 #[from]
51 source: io::Error,
52 },
53 #[error("DoF mismatch {} != {}", .0, .1)]
54 DofMismatch(usize, usize),
55 #[error("URDF error: {:?}", source)]
56 Urdf {
57 #[from]
58 source: urdf_rs::UrdfError,
59 },
60 #[error("Path not found {}", .0)]
61 PathPlanFail(String),
62 #[error("Kinematics error: {:?}", source)]
63 KinematicsError {
64 #[from]
65 source: k::Error,
66 },
67 #[error("failed to parse {}", .0)]
68 ParseError(String),
69 #[error("Mesh error {}", .0)]
70 MeshError(String),
71 #[error("Reference robot is not set to {}", .0)]
72 ReferenceRobot(String),
73}
74
75pub type Result<T> = ::std::result::Result<T, Error>;