/Users/enrico/Ricerca/develop/PINS/pins-mechatronix/LibSources/submodules/Clothoids/src/Clothoids/Clothoid.hxx Source File

Clothoids: /Users/enrico/Ricerca/develop/PINS/pins-mechatronix/LibSources/submodules/Clothoids/src/Clothoids/Clothoid.hxx Source File
Clothoids
Clothoid.hxx
1/*--------------------------------------------------------------------------*\
2 | |
3 | Copyright (C) 2017 |
4 | |
5 | , __ , __ |
6 | /|/ \ /|/ \ |
7 | | __/ _ ,_ | __/ _ ,_ |
8 | | \|/ / | | | | \|/ / | | | |
9 | |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ |
10 | /| /| |
11 | \| \| |
12 | |
13 | Enrico Bertolazzi |
14 | Dipartimento di Ingegneria Industriale |
15 | Universita` degli Studi di Trento |
16 | email: enrico.bertolazzi@unitn.it |
17 | |
18\*--------------------------------------------------------------------------*/
19
23
24namespace G2lib {
25
26 using std::vector;
27
28 /*\
29 | ____ _ _ _ _ _ ____
30 | / ___| | ___ | |_| |__ ___ (_) __| |/ ___| _ _ ____ _____
31 | | | | |/ _ \| __| '_ \ / _ \| |/ _` | | | | | | '__\ \ / / _ \
32 | | |___| | (_) | |_| | | | (_) | | (_| | |__| |_| | | \ V / __/
33 | \____|_|\___/ \__|_| |_|\___/|_|\__,_|\____\__,_|_| \_/ \___|
34 \*/
48 class ClothoidCurve : public BaseCurve {
49 friend class ClothoidList;
50 private:
51
52 ClothoidData m_CD;
53 real_type m_L;
54
55 void
56 optimized_sample_internal_ISO(
57 real_type s_begin,
58 real_type s_end,
59 real_type offs,
60 real_type ds,
61 real_type max_angle,
62 vector<real_type> & s
63 ) const;
64
65 void
66 bb_triangles_internal_ISO(
67 real_type offs,
68 vector<Triangle2D> & tvec,
69 real_type s0,
70 real_type s1,
71 real_type max_angle,
72 real_type max_size,
73 integer icurve
74 ) const;
75
76 void
77 closest_point_internal(
78 real_type s_begin,
79 real_type s_end,
80 real_type qx,
81 real_type qy,
82 real_type offs,
83 real_type & x,
84 real_type & y,
85 real_type & s,
86 real_type & dst
87 ) const;
88
89 void
90 closest_point_internal(
91 real_type qx,
92 real_type qy,
93 real_type offs,
94 real_type & x,
95 real_type & y,
96 real_type & s,
97 real_type & dst
98 ) const;
99
100 static integer m_max_iter;
101 static real_type m_tolerance;
102
103 mutable bool m_aabb_done{false};
104 mutable AABB_TREE m_aabb_tree;
105 mutable real_type m_aabb_offs{real_type(0)};
106 mutable real_type m_aabb_max_angle{real_type(0)};
107 mutable real_type m_aabb_max_size{real_type(0)};
108 mutable vector<Triangle2D> m_aabb_triangles;
109
110 #ifdef CLOTHOIDS_USE_THREADS
111 mutable std::mutex m_aabb_mutex;
112 #endif
113
114 bool
115 aabb_intersect_ISO(
116 Triangle2D const & T1,
117 real_type offs,
118 ClothoidCurve const * pC,
119 Triangle2D const & T2,
120 real_type C_offs,
121 real_type & ss1,
122 real_type & ss2
123 ) const;
124
125 public:
126
127 #include "BaseCurve_using.hxx"
128
132 ClothoidCurve( string const & name );
133
137 ClothoidCurve( ClothoidCurve const & s );
138
139 void setup( GenericContainer const & gc ) override;
140
152 explicit
154 real_type x0,
155 real_type y0,
156 real_type theta0,
157 real_type k,
158 real_type dk,
159 real_type L,
160 string const & name
161 );
162
181 explicit
183 real_type const P0[],
184 real_type theta0,
185 real_type const P1[],
186 real_type theta1,
187 string const & name
188 );
189
193 void copy( ClothoidCurve const & c );
194
198 explicit
199 ClothoidCurve( LineSegment const & LS );
200
204 explicit
205 ClothoidCurve( CircleArc const & C );
206
210 explicit
211 ClothoidCurve( BaseCurve const * pC );
212
217 { this->copy(s); return *this; }
218
219 CurveType type() const override { return CurveType::CLOTHOID; }
220
221 /*\
222 | _ _ _ _
223 | | |__ _ _(_) |__| |
224 | | '_ \ || | | / _` |
225 | |_.__/\_,_|_|_\__,_|
226 \*/
237 void
238 build(
239 real_type x0,
240 real_type y0,
241 real_type theta0,
242 real_type k,
243 real_type dk,
244 real_type L
245 );
246
259 int
260 build_G1(
261 real_type x0,
262 real_type y0,
263 real_type theta0,
264 real_type x1,
265 real_type y1,
266 real_type theta1,
267 real_type tol = 1e-12
268 );
269
285 int
287 real_type x0,
288 real_type y0,
289 real_type theta0,
290 real_type x1,
291 real_type y1,
292 real_type theta1,
293 real_type L_D[2],
294 real_type k_D[2],
295 real_type dk_D[2],
296 real_type tol = 1e-12
297 );
298
310 bool
312 real_type x0,
313 real_type y0,
314 real_type theta0,
315 real_type kappa0,
316 real_type x1,
317 real_type y1,
318 real_type tol = 1e-12
319 );
320
324 void build( LineSegment const & LS );
325
329 void build( CircleArc const & );
330 void build( ClothoidCurve const & );
331 void build( Biarc const & );
332 void build( PolyLine const & );
333 void build( BiarcList const & );
334 void build( ClothoidList const & );
335 void build( Dubins const & );
336 void build( Dubins3p const & );
337
348 void
349 Pinfinity( real_type & x, real_type & y, bool plus = true ) const
350 { m_CD.Pinfinity( x, y, plus ); }
351
355 real_type dkappa() const { return m_CD.m_dk; }
356
361
365 real_type theta_min_max( real_type & thMin, real_type & thMax ) const;
366
372 { real_type thMin, thMax; return theta_min_max( thMin, thMax ); }
373
377 real_type curvature_min_max( real_type & kMin, real_type & kMax ) const;
378
383
392
401
410
419 void
421 real_type offs,
422 integer npts,
423 real_type max_angle,
424 vector<real_type> & s
425 ) const;
426
435 void
437 real_type offs,
438 integer npts,
439 real_type max_angle,
440 vector<real_type> & s
441 ) const {
442 optimized_sample_ISO( -offs, npts, max_angle, s );
443 }
444
445 /*\
446 | _ _ _
447 | __| (_)__| |_ __ _ _ _ __ ___
448 | / _` | (_-< _/ _` | ' \/ _/ -_)
449 | \__,_|_/__/\__\__,_|_||_\__\___|
450 \*/
464 real_type ds,
465 real_type qx,
466 real_type qy,
467 real_type & X,
468 real_type & Y,
469 real_type & S
470 ) const;
471
484 real_type ds,
485 real_type qx,
486 real_type qy,
487 real_type & S
488 ) const {
489 real_type X, Y;
490 return closest_point_by_sample( ds, qx, qy, X, Y, S );
491 }
492
504 real_type ds,
505 real_type qx,
506 real_type qy
507 ) const {
508 real_type X, Y, S;
509 return closest_point_by_sample( ds, qx, qy, X, Y, S );
510 }
511
512 /*\
513 | _ _ _____ _ _
514 | | |__| |_|_ _| _(_)__ _ _ _ __ _| |___
515 | | '_ \ '_ \| || '_| / _` | ' \/ _` | / -_)
516 | |_.__/_.__/|_||_| |_\__,_|_||_\__, |_\___|
517 | |___/
518 \*/
519
524 bool
526 real_type & xx0, real_type & yy0,
527 real_type & xx1, real_type & yy1,
528 real_type & xx2, real_type & yy2
529 ) const {
530 return m_CD.bbTriangle( m_L, xx0, yy0, xx1, yy1, xx2, yy2 );
531 }
532
537 bool
539 real_type offs,
540 real_type & xx0, real_type & yy0,
541 real_type & xx1, real_type & yy1,
542 real_type & xx2, real_type & yy2
543 ) const {
544 return m_CD.bbTriangle_ISO( m_L, offs, xx0, yy0, xx1, yy1, xx2, yy2 );
545 }
546
551 bool
553 real_type offs,
554 real_type & xx0, real_type & yy0,
555 real_type & xx1, real_type & yy1,
556 real_type & xx2, real_type & yy2
557 ) const {
558 return m_CD.bbTriangle_SAE( m_L, offs, xx0, yy0, xx1, yy1, xx2, yy2 );
559 }
560
561 bool
562 bbTriangle( Triangle2D & t, integer icurve = 0 ) const {
563 real_type x0, y0, x1, y1, x2, y2;
564 bool ok = m_CD.bbTriangle( m_L, x0, y0, x1, y1, x2, y2 );
565 if ( ok ) t.build( x0, y0, x1, y1, x2, y2, 0, 0, icurve );
566 return ok;
567 }
568
569 bool
570 bbTriangle_ISO( real_type offs, Triangle2D & t, integer icurve = 0 ) const {
571 real_type x0, y0, x1, y1, x2, y2;
572 bool ok = m_CD.bbTriangle_ISO( m_L, offs, x0, y0, x1, y1, x2, y2 );
573 if ( ok ) t.build( x0, y0, x1, y1, x2, y2, 0, 0, icurve );
574 return ok;
575 }
576
577 bool
578 bbTriangle_SAE( real_type offs, Triangle2D & t, integer icurve = 0 ) const {
579 real_type x0, y0, x1, y1, x2, y2;
580 bool ok = m_CD.bbTriangle_SAE( m_L, offs, x0, y0, x1, y1, x2, y2 );
581 if ( ok ) t.build( x0, y0, x1, y1, x2, y2, 0, 0, icurve );
582 return ok;
583 }
584
585 void
587 real_type offs,
588 vector<Triangle2D> & tvec,
589 real_type max_angle = Utils::m_pi/6, // 30 degree
590 real_type max_size = 1e100,
591 integer icurve = 0
592 ) const override;
593
594 void
596 real_type offs,
597 vector<Triangle2D> & tvec,
598 real_type max_angle = Utils::m_pi/6, // 30 degree
599 real_type max_size = 1e100,
600 integer icurve = 0
601 ) const override {
602 this->bb_triangles_ISO( -offs, tvec, max_angle, max_size, icurve );
603 }
604
605 void
607 vector<Triangle2D> & tvec,
608 real_type max_angle = Utils::m_pi/6, // 30 degree
609 real_type max_size = 1e100,
610 integer icurve = 0
611 ) const override {
612 this->bb_triangles_ISO( 0, tvec, max_angle, max_size, icurve );
613 }
614
615 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
616
617 void
619 real_type & xmin,
620 real_type & ymin,
621 real_type & xmax,
622 real_type & ymax
623 ) const override {
624 bbox_ISO( 0, xmin, ymin, xmax, ymax );
625 }
626
627 void
628 bbox_ISO(
629 real_type offs,
630 real_type & xmin,
631 real_type & ymin,
632 real_type & xmax,
633 real_type & ymax
634 ) const override;
635
636 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
637
638 real_type length() const override { return m_L; }
639
640 real_type length_ISO( real_type ) const override;
641
642 real_type theta_begin() const override { return m_CD.m_theta0; }
643 real_type kappa_begin() const override { return m_CD.m_kappa0; }
644 real_type x_begin() const override { return m_CD.m_x0; }
645 real_type x_end() const override { return m_CD.X(m_L); }
646 real_type y_begin() const override { return m_CD.m_y0; }
647 real_type y_end() const override { return m_CD.Y(m_L); }
648 real_type tx_begin() const override { return m_CD.tg0_x(); }
649 real_type ty_begin() const override { return m_CD.tg0_y(); }
650 real_type nx_begin_ISO() const override { return m_CD.nor0_x_ISO(); }
651 real_type ny_begin_ISO() const override { return m_CD.nor0_y_ISO(); }
652
653 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
654
655 /*\
656 | _____ _ _ _
657 | |_ _| __ _ _ __ __| | | \ | |
658 | | | / _` | '_ \ / _` | | \| |
659 | | | | (_| | | | | (_| | | |\ |
660 | |_| \__,_|_| |_|\__,_| |_| \_|
661 \*/
662
663 real_type tx ( real_type s ) const override { return m_CD.tg_x( s ); }
664 real_type ty ( real_type s ) const override { return m_CD.tg_y( s ); }
665 real_type tx_D ( real_type s ) const override { return m_CD.tg_x_D( s ); }
666 real_type ty_D ( real_type s ) const override { return m_CD.tg_y_D( s ); }
667 real_type tx_DD ( real_type s ) const override { return m_CD.tg_x_DD( s ); }
668 real_type ty_DD ( real_type s ) const override { return m_CD.tg_y_DD( s ); }
669 real_type tx_DDD( real_type s ) const override { return m_CD.tg_x_DDD( s ); }
670 real_type ty_DDD( real_type s ) const override { return m_CD.tg_y_DDD( s ); }
671
672 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
673
674 void
676 real_type s,
677 real_type & tx,
678 real_type & ty
679 ) const override
680 { m_CD.tg( s, tx, ty ); }
681
682 void
684 real_type s,
685 real_type & tx_D,
687 ) const override
688 { m_CD.tg_D( s, tx_D, ty_D ); }
689
690 void
692 real_type s,
695 ) const override
696 { m_CD.tg_DD( s, tx_DD, ty_DD ); }
697
698 void
700 real_type s,
703 ) const override
704 { m_CD.tg_DDD( s, tx_DDD, ty_DDD ); }
705
706 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
707
715 theta( real_type s ) const override
716 { return m_CD.theta(s); }
717
726 theta_D( real_type s ) const override
727 { return m_CD.kappa(s); }
728
736 theta_DD( real_type ) const override
737 { return m_CD.m_dk; }
738
746 theta_DDD( real_type ) const override
747 { return 0; }
748
749 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
750
757 real_type X ( real_type s ) const override { return m_CD.X(s); }
758 real_type X_D ( real_type s ) const override { return m_CD.X_D(s); }
759 real_type X_DD ( real_type s ) const override { return m_CD.X_DD(s); }
760 real_type X_DDD( real_type s ) const override { return m_CD.X_DDD(s); }
761
768 real_type Y ( real_type s ) const override { return m_CD.Y(s); }
769 real_type Y_D ( real_type s ) const override { return m_CD.Y_D(s); }
770 real_type Y_DD ( real_type s ) const override { return m_CD.Y_DD(s); }
771 real_type Y_DDD( real_type s ) const override { return m_CD.Y_DDD(s); }
772
781 X_ISO( real_type s, real_type offs ) const override
782 { return m_CD.X_ISO(s,offs); }
783
785 X_ISO_D( real_type s, real_type offs ) const override
786 { return m_CD.X_ISO_D(s,offs); }
787
789 X_ISO_DD( real_type s, real_type offs ) const override
790 { return m_CD.X_ISO_DD(s,offs); }
791
793 X_ISO_DDD( real_type s, real_type offs ) const override
794 { return m_CD.X_ISO_DDD(s,offs); }
795
804 Y_ISO( real_type s, real_type offs ) const override
805 { return m_CD.Y_ISO(s,offs); }
806
808 Y_ISO_D( real_type s, real_type offs ) const override
809 { return m_CD.Y_ISO_D(s,offs); }
810
812 Y_ISO_DD( real_type s, real_type offs ) const override
813 { return m_CD.Y_ISO_DD(s,offs); }
814
816 Y_ISO_DDD( real_type s, real_type offs ) const override
817 { return m_CD.Y_ISO_DDD(s,offs); }
818
819 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
820
821 void
823 real_type s,
824 real_type & x,
825 real_type & y
826 ) const override
827 { m_CD.eval( s, x, y ); }
828
829 void
831 real_type s,
832 real_type & x_D,
833 real_type & y_D
834 ) const override
835 { m_CD.eval_D( s, x_D, y_D ); }
836
837 void
839 real_type s,
840 real_type & x_DD,
841 real_type & y_DD
842 ) const override
843 { m_CD.eval_DD( s, x_DD, y_DD ); }
844
845 void
847 real_type s,
848 real_type & x_DDD,
849 real_type & y_DDD
850 ) const override
851 { m_CD.eval_DDD( s, x_DDD, y_DDD ); }
852
853 void
855 real_type s,
856 real_type offs,
857 real_type & x,
858 real_type & y
859 ) const override
860 { m_CD.eval_ISO( s, offs, x, y ); }
861
862 void
864 real_type s,
865 real_type offs,
866 real_type & x_D,
867 real_type & y_D
868 ) const override
869 { m_CD.eval_ISO_D( s, offs, x_D, y_D ); }
870
871 void
873 real_type s,
874 real_type offs,
875 real_type & x_DD,
876 real_type & y_DD
877 ) const override
878 { m_CD.eval_ISO_DD( s, offs, x_DD, y_DD ); }
879
880 void
882 real_type s,
883 real_type offs,
884 real_type & x_DDD,
885 real_type & y_DDD
886 ) const override
887 { m_CD.eval_ISO_DDD( s, offs, x_DDD, y_DDD ); }
888
889 /*\
890 | _ __
891 | | |_ _ __ __ _ _ __ ___ / _| ___ _ __ _ __ ___
892 | | __| '__/ _` | '_ \/ __| |_ / _ \| '__| '_ ` _ \
893 | | |_| | | (_| | | | \__ \ _| (_) | | | | | | | |
894 | \__|_| \__,_|_| |_|___/_| \___/|_| |_| |_| |_|
895 \*/
896
897 void
899 { m_CD.m_x0 += tx; m_CD.m_y0 += ty; }
900
901 void
902 rotate( real_type angle, real_type cx, real_type cy ) override
903 { m_CD.rotate( angle, cx, cy ); }
904
905 void
906 scale( real_type s ) override {
907 m_CD.m_kappa0 /= s;
908 m_CD.m_dk /= s*s;
909 m_L *= s;
910 }
911
912 void
913 reverse() override
914 { m_CD.reverse(m_L); }
915
916 void
917 change_origin( real_type newx0, real_type newy0 ) override
918 { m_CD.m_x0 = newx0; m_CD.m_y0 = newy0; }
919
920 void
921 trim( real_type s_begin, real_type s_end ) override {
922 m_CD.origin_at( s_begin );
923 m_L = s_end - s_begin;
924 }
925
933 void
935 m_CD.origin_at( s0 );
936 m_L = newL;
937 }
938
939 /*\
940 | _ _ ____ _ _
941 | ___| | ___ ___ ___ ___| |_| _ \ ___ (_)_ __ | |_
942 | / __| |/ _ \/ __|/ _ \/ __| __| |_) / _ \| | '_ \| __|
943 | | (__| | (_) \__ \ __/\__ \ |_| __/ (_) | | | | | |_
944 | \___|_|\___/|___/\___||___/\__|_| \___/|_|_| |_|\__|
945 \*/
964 integer
966 real_type qx,
967 real_type qy,
968 real_type & x,
969 real_type & y,
970 real_type & s,
971 real_type & t,
972 real_type & dst
973 ) const override;
974
975 integer
977 real_type qx,
978 real_type qy,
979 real_type offs,
980 real_type & x,
981 real_type & y,
982 real_type & s,
983 real_type & t,
984 real_type & dst
985 ) const override;
986
987 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
988 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
989
990 /*\
991 | _ _ _ _
992 | ___ ___ | | (_)___(_) ___ _ __
993 | / __/ _ \| | | / __| |/ _ \| '_ \
994 | | (_| (_) | | | \__ \ | (_) | | | |
995 | \___\___/|_|_|_|___/_|\___/|_| |_|
996 \*/
997
998 #ifndef DOXYGEN_SHOULD_SKIP_THIS
999 void
1000 build_AABBtree_ISO(
1001 real_type offs,
1002 real_type max_angle = Utils::m_pi/18, // 10 degree
1003 real_type max_size = 1e100
1004 ) const;
1005 #endif
1006
1007 // collision detection
1008 bool
1010 real_type offs,
1011 ClothoidCurve const & c,
1012 real_type c_offs,
1013 real_type max_angle,
1014 real_type max_size
1015 ) const;
1016
1017 bool
1018 collision( ClothoidCurve const & C ) const {
1019 return collision_ISO( 0, C, 0 );
1020 }
1021
1022 bool
1023 collision_ISO(
1024 real_type offs,
1025 ClothoidCurve const & C,
1026 real_type offs_C
1027 ) const;
1028
1029 bool
1030 collision( BaseCurve const * pC ) const override;
1031
1032 bool
1033 collision_ISO(
1034 real_type offs,
1035 BaseCurve const * pC,
1036 real_type offs_C
1037 ) const override;
1038
1039 /*\
1040 | _ _ _
1041 | (_)_ __ | |_ ___ _ __ ___ ___ ___| |_
1042 | | | '_ \| __/ _ \ '__/ __|/ _ \/ __| __|
1043 | | | | | | || __/ | \__ \ __/ (__| |_
1044 | |_|_| |_|\__\___|_| |___/\___|\___|\__|
1045 \*/
1046
1047 void
1048 intersect_ISO(
1049 real_type offs,
1050 ClothoidCurve const & C,
1051 real_type offs_C,
1052 IntersectList & ilist
1053 ) const;
1054
1055 void
1056 intersect(
1057 ClothoidCurve const & C,
1058 IntersectList & ilist
1059 ) const {
1060 this->intersect_ISO( 0, C, 0, ilist );
1061 }
1062
1063 void
1064 intersect(
1065 BaseCurve const * pC,
1066 IntersectList & ilist
1067 ) const override;
1068
1069 void
1070 intersect_ISO(
1071 real_type offs,
1072 BaseCurve const * pC,
1073 real_type offs_LS,
1074 IntersectList & ilist
1075 ) const override;
1076
1077 string info() const;
1078
1079 void
1080 info( ostream_type & stream ) const override
1081 { stream << this->info(); }
1082
1083 friend
1084 ostream_type &
1085 operator << ( ostream_type & stream, ClothoidCurve const & c );
1086
1087#ifdef CLOTHOIDS_BACK_COMPATIBILITY
1088#include "Clothoid_compatibility.hxx"
1089#endif
1090
1091 };
1092
1093}
1094
Definition BaseCurve.hxx:192
Definition Biarc.hxx:39
Definition BiarcList.hxx:42
Definition Circle.hxx:37
Definition Clothoid.hxx:48
real_type tx_DDD(real_type s) const override
Definition Clothoid.hxx:669
real_type X_ISO_DD(real_type s, real_type offs) const override
Definition Clothoid.hxx:789
int build_G1_D(real_type x0, real_type y0, real_type theta0, real_type x1, real_type y1, real_type theta1, real_type L_D[2], real_type k_D[2], real_type dk_D[2], real_type tol=1e-12)
Definition Clothoid.cc:225
void optimized_sample_SAE(real_type offs, integer npts, real_type max_angle, vector< real_type > &s) const
Definition Clothoid.hxx:436
real_type X(real_type s) const override
Definition Clothoid.hxx:757
void bb_triangles(vector< Triangle2D > &tvec, real_type max_angle=Utils::m_pi/6, real_type max_size=1e100, integer icurve=0) const override
Definition Clothoid.hxx:606
real_type integral_snap2() const
Definition Clothoid.cc:1209
real_type X_ISO_D(real_type s, real_type offs) const override
Definition Clothoid.hxx:785
real_type kappa_begin() const override
Definition Clothoid.hxx:643
real_type y_end() const override
Definition Clothoid.hxx:647
real_type ty_D(real_type s) const override
Definition Clothoid.hxx:666
void translate(real_type tx, real_type ty) override
translate curve by
Definition Clothoid.hxx:898
void eval_ISO_D(real_type s, real_type offs, real_type &x_D, real_type &y_D) const override
Definition Clothoid.hxx:863
void bb_triangles_ISO(real_type offs, vector< Triangle2D > &tvec, real_type max_angle=Utils::m_pi/6, real_type max_size=1e100, integer icurve=0) const override
Definition Clothoid.cc:477
void build(real_type x0, real_type y0, real_type theta0, real_type k, real_type dk, real_type L)
Definition Clothoid.cc:181
bool bbTriangle_ISO(real_type offs, real_type &xx0, real_type &yy0, real_type &xx1, real_type &yy1, real_type &xx2, real_type &yy2) const
Definition Clothoid.hxx:538
real_type theta_begin() const override
Definition Clothoid.hxx:642
real_type theta(real_type s) const override
Definition Clothoid.hxx:715
real_type x_begin() const override
Definition Clothoid.hxx:644
real_type Y_DD(real_type s) const override
Definition Clothoid.hxx:770
ClothoidCurve const & operator=(ClothoidCurve const &s)
Definition Clothoid.hxx:216
bool build_forward(real_type x0, real_type y0, real_type theta0, real_type kappa0, real_type x1, real_type y1, real_type tol=1e-12)
Definition Clothoid.cc:245
friend ostream_type & operator<<(ostream_type &stream, ClothoidCurve const &c)
Definition Clothoid.cc:1251
void tg(real_type s, real_type &tx, real_type &ty) const override
Definition Clothoid.hxx:675
real_type delta_theta() const
Definition Clothoid.hxx:371
real_type tx_D(real_type s) const override
Definition Clothoid.hxx:665
void eval_ISO_DDD(real_type s, real_type offs, real_type &x_DDD, real_type &y_DDD) const override
Definition Clothoid.hxx:881
real_type integral_curvature2() const
Definition Clothoid.cc:1187
real_type closest_point_by_sample(real_type ds, real_type qx, real_type qy, real_type &X, real_type &Y, real_type &S) const
Definition ClothoidDistance.cc:44
bool bbTriangle(real_type &xx0, real_type &yy0, real_type &xx1, real_type &yy1, real_type &xx2, real_type &yy2) const
Definition Clothoid.hxx:525
real_type y_begin() const override
Definition Clothoid.hxx:646
real_type curvature_total_variation() const
Definition Clothoid.cc:1176
void optimized_sample_ISO(real_type offs, integer npts, real_type max_angle, vector< real_type > &s) const
Definition Clothoid.cc:369
real_type X_DDD(real_type s) const override
Definition Clothoid.hxx:760
real_type theta_DD(real_type) const override
Definition Clothoid.hxx:736
void change_origin(real_type newx0, real_type newy0) override
Definition Clothoid.hxx:917
real_type Y_D(real_type s) const override
Definition Clothoid.hxx:769
void eval_ISO_DD(real_type s, real_type offs, real_type &x_DD, real_type &y_DD) const override
Definition Clothoid.hxx:872
void tg_DDD(real_type s, real_type &tx_DDD, real_type &ty_DDD) const override
Definition Clothoid.hxx:699
real_type tx_begin() const override
Definition Clothoid.hxx:648
real_type Y(real_type s) const override
Definition Clothoid.hxx:768
real_type Y_ISO_D(real_type s, real_type offs) const override
Definition Clothoid.hxx:808
integer closest_point_ISO(real_type qx, real_type qy, real_type &x, real_type &y, real_type &s, real_type &t, real_type &dst) const override
Definition ClothoidDistance.cc:499
real_type nx_begin_ISO() const override
Definition Clothoid.hxx:650
real_type X_ISO(real_type s, real_type offs) const override
Definition Clothoid.hxx:781
real_type tx(real_type s) const override
Definition Clothoid.hxx:663
real_type distance_by_sample(real_type ds, real_type qx, real_type qy) const
Definition Clothoid.hxx:503
void eval_DDD(real_type s, real_type &x_DDD, real_type &y_DDD) const override
Definition Clothoid.hxx:846
void eval(real_type s, real_type &x, real_type &y) const override
Definition Clothoid.hxx:822
void bbox(real_type &xmin, real_type &ymin, real_type &xmax, real_type &ymax) const override
Definition Clothoid.hxx:618
void eval_ISO(real_type s, real_type offs, real_type &x, real_type &y) const override
Definition Clothoid.hxx:854
void bb_triangles_SAE(real_type offs, vector< Triangle2D > &tvec, real_type max_angle=Utils::m_pi/6, real_type max_size=1e100, integer icurve=0) const override
Definition Clothoid.hxx:595
void tg_DD(real_type s, real_type &tx_DD, real_type &ty_DD) const override
Definition Clothoid.hxx:691
bool approximate_collision_ISO(real_type offs, ClothoidCurve const &c, real_type c_offs, real_type max_angle, real_type max_size) const
Definition Clothoid.cc:669
real_type Y_ISO(real_type s, real_type offs) const override
Definition Clothoid.hxx:804
void change_curvilinear_origin(real_type s0, real_type newL)
Definition Clothoid.hxx:934
real_type theta_DDD(real_type) const override
Definition Clothoid.hxx:746
real_type length() const override
Definition Clothoid.hxx:638
real_type ty_DDD(real_type s) const override
Definition Clothoid.hxx:670
real_type ty_DD(real_type s) const override
Definition Clothoid.hxx:668
int build_G1(real_type x0, real_type y0, real_type theta0, real_type x1, real_type y1, real_type theta1, real_type tol=1e-12)
Definition Clothoid.cc:208
void copy(ClothoidCurve const &c)
Definition Clothoid.cc:128
void scale(real_type s) override
Definition Clothoid.hxx:906
void info(ostream_type &stream) const override
Definition Clothoid.hxx:1080
real_type tx_DD(real_type s) const override
Definition Clothoid.hxx:667
bool bbTriangle_SAE(real_type offs, real_type &xx0, real_type &yy0, real_type &xx1, real_type &yy1, real_type &xx2, real_type &yy2) const
Definition Clothoid.hxx:552
void trim(real_type s_begin, real_type s_end) override
Definition Clothoid.hxx:921
real_type theta_D(real_type s) const override
Definition Clothoid.hxx:726
real_type ty_begin() const override
Definition Clothoid.hxx:649
CurveType type() const override
Definition Clothoid.hxx:219
real_type Y_ISO_DD(real_type s, real_type offs) const override
Definition Clothoid.hxx:812
void eval_DD(real_type s, real_type &x_DD, real_type &y_DD) const override
Definition Clothoid.hxx:838
void Pinfinity(real_type &x, real_type &y, bool plus=true) const
Definition Clothoid.hxx:349
real_type integral_jerk2() const
Definition Clothoid.cc:1195
real_type distance_by_sample(real_type ds, real_type qx, real_type qy, real_type &S) const
Definition Clothoid.hxx:483
void rotate(real_type angle, real_type cx, real_type cy) override
Definition Clothoid.hxx:902
ClothoidCurve(string const &name)
Definition Clothoid.cc:77
void reverse() override
Definition Clothoid.hxx:913
real_type ny_begin_ISO() const override
Definition Clothoid.hxx:651
real_type ty(real_type s) const override
Definition Clothoid.hxx:664
real_type Y_ISO_DDD(real_type s, real_type offs) const override
Definition Clothoid.hxx:816
real_type length_ISO(real_type) const override
Definition Clothoid.cc:314
real_type X_ISO_DDD(real_type s, real_type offs) const override
Definition Clothoid.hxx:793
void eval_D(real_type s, real_type &x_D, real_type &y_D) const override
Definition Clothoid.hxx:830
real_type X_D(real_type s) const override
Definition Clothoid.hxx:758
real_type Y_DDD(real_type s) const override
Definition Clothoid.hxx:771
void bbox_ISO(real_type offs, real_type &xmin, real_type &ymin, real_type &xmax, real_type &ymax) const override
Definition Clothoid.cc:503
real_type X_DD(real_type s) const override
Definition Clothoid.hxx:759
real_type curvature_min_max(real_type &kMin, real_type &kMax) const
Definition Clothoid.cc:1164
real_type theta_total_variation() const
Definition Clothoid.cc:1121
void tg_D(real_type s, real_type &tx_D, real_type &ty_D) const override
Definition Clothoid.hxx:683
real_type theta_min_max(real_type &thMin, real_type &thMax) const
Definition Clothoid.cc:1141
real_type x_end() const override
Definition Clothoid.hxx:645
real_type dkappa() const
Definition Clothoid.hxx:355
Definition ClothoidList.hxx:861
Definition Dubins3p.hxx:78
Definition Dubins.hxx:74
Definition Line.hxx:37
Class to manage a collection of straight segment.
Definition PolyLine.hxx:42
Definition Triangle2D.hxx:37
Definition BBox.cc:42
Utils::AABBtree< real_type > AABB_TREE
AABB tree type
Definition Clothoids.hh:81
GC_namespace::GenericContainer GenericContainer
Generic container object.
Definition Clothoids.hh:84
std::basic_ostream< char > ostream_type
output streaming
Definition Clothoids.hh:78
std::vector< Ipair > IntersectList
Vector of pair of two real number.
Definition BaseCurve.hxx:36
enum class CurveType :integer { LINE, POLYLINE, CIRCLE, BIARC, BIARC_LIST, CLOTHOID, CLOTHOID_LIST, DUBINS, DUBINS3P } CurveType
Definition Clothoids.hh:89
double real_type
real type number
Definition Clothoids.hh:79
int integer
integer type number
Definition Clothoids.hh:80