Commits

bergsoe committed 31260a9

Constraint construction helper functions.

Comments (0)

Files changed (2)

src/PaplPlannerConstraint.ml

     q_constr interpolate threshold
   in
     (q_constr, edge_constr)
+
+open PaplConstraint
+
+let constrain_edge_and_both (nc, ec) =
+  PaplEdgeConstraint.constrain_both nc <&> ec
+
+let constrain_edge_and_fst (nc, ec) =
+  PaplEdgeConstraint.constrain_fst nc <&> ec
+
+let constrain_edge_and_snd (nc, ec) =
+  PaplEdgeConstraint.constrain_snd nc <&> ec

src/PaplPlannerConstraint.mli

 (** Path planner constraints
 
    A path planner constraint is a tuple [(q_constr, q_edge_constr)] containing a
-   point and edge constraint.
+   point and an edge constraint.
 *)
 
 type 'a t = 'a PaplConstraint.t * 'a PaplEdgeConstraint.t
     The path must have at least 2 element or an exception is raised.
 *)
 
+val constrain_edge_and_both : 'a t -> 'a PaplEdgeConstraint.t
+(** [constrain_edge_and_both (nc, ec)] constrains the start and end point of an
+    edge using [nc] and the edge itself using [ec].
+*)
+
+val constrain_edge_and_fst : 'a t -> 'a PaplEdgeConstraint.t
+(** [constrain_edge_and_both (nc, ec)] constrains the start point of an edge
+    using [nc] and the edge itself using [ec].
+*)
+
+val constrain_edge_and_snd : 'a t -> 'a PaplEdgeConstraint.t
+(** [constrain_edge_and_both (nc, ec)] constrains the end point of an edge using
+    [nc] and the edge itself using [ec].
+*)
+
 val constrain_by_subdivision :
   'a PaplConstraint.t ->
   'a PaplInterpolate.t ->