use std::time::Duration;
use deke_types::SRobotQ;
#[derive(Clone, Debug)]
pub struct JointLimits<const N: usize> {
pub v_max: SRobotQ<N, f64>,
pub a_max: SRobotQ<N, f64>,
pub j_max: SRobotQ<N, f64>,
}
impl<const N: usize> JointLimits<N> {
pub fn symmetric(v: f64, a: f64, j: f64) -> Self {
Self {
v_max: SRobotQ::splat(v),
a_max: SRobotQ::splat(a),
j_max: SRobotQ::splat(j),
}
}
}
#[derive(Clone, Debug)]
pub struct PathConditioning {
pub sharp_corner_angle: f64,
}
impl Default for PathConditioning {
fn default() -> Self {
Self {
sharp_corner_angle: 30.0_f64.to_radians(),
}
}
}
#[derive(Clone, Debug)]
pub struct PlannerOptions<const N: usize> {
pub sample_ds: f64,
pub manip_weight: f64,
pub max_branch_jump: f64,
pub max_velocity: f64,
pub joint_v_max: SRobotQ<N, f64>,
pub reconfig_vel_fraction: f64,
}
impl<const N: usize> Default for PlannerOptions<N> {
fn default() -> Self {
Self {
sample_ds: 2e-3,
manip_weight: 1.0,
max_branch_jump: 0.6,
max_velocity: 0.0,
joint_v_max: SRobotQ::splat(f64::INFINITY),
reconfig_vel_fraction: 0.9,
}
}
}
#[derive(Clone, Debug)]
pub struct LinearConstraints<const N: usize> {
pub joint: JointLimits<N>,
pub tcp_speed: f64,
pub output_dt: Duration,
pub forbid_interior_dips: bool,
}