pub mod environment;
pub use environment::*;
pub mod timed;
pub use timed::*;
pub mod r2;
pub mod se2;
pub mod waypoint;
pub use waypoint::*;
pub mod trajectory;
pub use trajectory::{FindWaypoint, Trajectory};
pub mod travel_effort_cost;
pub use travel_effort_cost::*;
pub mod travel_time_cost;
pub use travel_time_cost::*;
pub mod safe_interval;
pub use safe_interval::*;
pub mod speed_limit;
pub use speed_limit::*;
pub mod conflict;
pub use conflict::*;
pub use time_point::{Duration, TimePoint};
use crate::error::ThisError;
pub const DEFAULT_TRANSLATIONAL_THRESHOLD: f64 = 0.001;
pub const DEFAULT_ROTATIONAL_THRESHOLD: f64 = 1.0f64 * std::f64::consts::PI / 180.0;
#[derive(Clone, Copy, Debug, PartialEq, Eq, ThisError)]
pub enum InterpError {
#[error("The requested time [{request:?}] is outside the time range of the motion {range:?}")]
OutOfBounds {
range: [TimePoint; 2],
request: TimePoint,
},
#[error("The requested interpolation does not have a unique solution")]
Indeterminate,
}
pub trait Motion<Position, Velocity> {
fn compute_position(&self, time: &TimePoint) -> Result<Position, InterpError>;
fn compute_velocity(&self, time: &TimePoint) -> Result<Velocity, InterpError>;
}
pub trait Interpolation<Position, Velocity> {
type Motion: Motion<Position, Velocity>;
fn interpolate(&self, up_to: &Self) -> Self::Motion;
}