atlasrrt.h
Go to the documentation of this file.
1 #ifndef ATLASRRTH
2 #define ATLASRRTH
3 
4 #include "atlas.h"
5 #include "rrt.h"
6 
30 #define ATLASRRT_VERBOSE 0
31 
38 #define GET_ATLASRRT_STATISTICS 1
39 
57 #define ADJUST_SA 0
58 
70 #define ATLASRRT_GLOBAL_NN 1
71 
78 # define GET_ATLASRRT_GLOBAL_CURV_CHECK 0
79 
96 typedef struct {
97  unsigned int n;
100  unsigned int nBranch;
101  unsigned int nNoEmptyBranch;
103  unsigned int nTreeConnection;
104  unsigned int nNoEmptyTreeConnection;
106  unsigned int nStep;
107  double dQrand;
109  /* Reasons to stop a branch extension */
110  unsigned int nQrandReached;
111  unsigned int nNotInDomain;
112  unsigned int nCollision;
113  unsigned int nTooLong;
114  unsigned int nTooFar;
115  unsigned int nOverlap;
117  /* Some of the reasons to create a new chart */
118  unsigned int nErrorNewChart;
119  unsigned int nNoConvergent;
120  unsigned int nOutOfChart;
121  unsigned int nLargeCurvature;
122  unsigned int nDirLargeCurvature ;
125  /* Refinements necessary in branch creation */
126  unsigned int nStepReduction;
129  unsigned int nSample;
130  unsigned int nChart;
131  unsigned int nNoConnect;
133  unsigned int nSingular;
136  /* Information about sampling */
137  unsigned int nRandom;
139  unsigned int nRejections;
141  /* Information aobut collison checking */
142  unsigned int nCollisionChecks;
144 
156 typedef struct {
157  unsigned int id;
158  double *s;
160  double *t;
161  unsigned int pc;
162  unsigned int c;
163  unsigned int generateChart;
164  unsigned int lsc;
166 } TSampleInfo;
167 
175 typedef struct {
176  unsigned int lc;
177  unsigned int tree;
178  unsigned int it;
179 } TChartInfo;
180 
190 typedef struct {
193  unsigned int m;
194  unsigned int k;
195  double e;
196  double ce;
197  double r;
200  boolean birrt;
204  boolean parallel;
210  unsigned int *tp;
217  unsigned int ms;
218  unsigned int ns;
221  unsigned int mc;
222  unsigned int nc;
225  unsigned int mct1;
226  unsigned int nct1;
227  unsigned int* chartsAtTree1;
229  unsigned int mct2;
230  unsigned int nct2;
231  unsigned int* chartsAtTree2;
232 } Tatlasrrt;
233 
234 /*******************************************************************************/
235 
244 
256 
266 
275 
276 /*******************************************************************************/
277 
278 
299 void InitAtlasRRT(Tparameters *pr,boolean parallel,double *ps,unsigned int mode,boolean graph,
300  double *pg,TAtlasBase *w,Tatlasrrt *ar);
301 
339 boolean AtlasRRTSample(Tparameters *pr,unsigned int samplingMode,
340  unsigned int it,unsigned int tree,
341  double *goal,double scale,boolean *exploration,
342  unsigned int *c_rand,double *t_rand,double *q_rand,
343  TAtlasRRTStatistics *arst,Tatlasrrt *ar);
344 
369 boolean AtlasRRTValidateSample(Tparameters *pr,double *q_rand,unsigned int tree,boolean expand2goal,
370  unsigned int lastNN2Goal,double *goal,double l,double *h,unsigned int *i_near,
371  TAtlasRRTStatistics *arst,Tatlasrrt *ar);
372 
393 boolean AtlasRRT(Tparameters *pr,double *pg,
394  double *time,
395  double *pl,unsigned int *ns,double ***path,
396  TAtlasRRTStatistics *str,Tatlasrrt *ar);
397 
398 
431 boolean AtlasTRRT(Tparameters *pr,double *pg,double *time,
432  double *pl,double *pc,unsigned int *ns,double ***path,
433  double (*costF)(Tparameters*,boolean,double*,void*),
434  void *costData,TAtlasRRTStatistics *str,Tatlasrrt *ar);
435 
478 boolean AtlasRRTstar(Tparameters *pr,double *pg,
479  unsigned int *it,double *times,double *costs,
480  double *planningTime,double *pl,unsigned int *ns,double ***path,
481  TAtlasRRTStatistics *str,Tatlasrrt *ar);
482 
507 boolean AtlasBiRRTstar(Tparameters *pr,double *pg,
508  unsigned int *it,double *times,double *costs,
509  double *planningTime,double *pl,unsigned int *ns,double ***path,
510  TAtlasRRTStatistics *str,Tatlasrrt *ar);
511 
535 void PlotAtlasRRT(char *prefix,int argc, char **arg,Tparameters *pr,
536  unsigned int xID,unsigned int yID,unsigned int zID,Tatlasrrt *ar);
537 
547 unsigned int GetAtlasRRTNumNodes(Tatlasrrt *ar);
548 
558 unsigned int GetAtlasRRTNumCharts(Tatlasrrt *ar);
559 
560 
577  double scale,unsigned int tree,
578  unsigned int *nm,
579  double *t,double *p,
580  Tatlasrrt* ar);
581 
596 unsigned int GetRRTNNInNeighbourChart(unsigned int tree,
597  unsigned int c_rand,double *t_rand,double *q_rand,
598  Tatlasrrt* ar);
599 
600 
619 unsigned int GetRRTNNInChart(unsigned int tree,unsigned int chartId,double *q_rand,
620  double t,double*d, Tatlasrrt* ar );
621 
653 void PlotAtlasRRT(char *prefix,int argc, char **arg,Tparameters *pr,
654  unsigned int xID,unsigned int yID,unsigned int zID,Tatlasrrt *ar);
655 
665 unsigned int AtlasRRTMemSize(Tatlasrrt *ar);
666 
682 void SaveAtlasRRT(Tparameters *pr,char *prefix,Tatlasrrt *ar);
683 
698 void LoadAtlasRRT(Tparameters *pr,char *prefix,TAtlasBase *w,Tatlasrrt *ar);
699 
708 void DeleteAtlasRRT(Tatlasrrt *ar);
709 
710 
711 #endif
unsigned int nStepReduction
Definition: atlasrrt.h:126
boolean RandomPointInAtlasTree(Tparameters *pr, double scale, unsigned int tree, unsigned int *nm, double *t, double *p, Tatlasrrt *ar)
Selects a random point in the set of charts of the tree.
Definition: atlasrrt.c:2562
unsigned int k
Definition: atlasrrt.h:194
unsigned int nct2
Definition: atlasrrt.h:230
unsigned int nc
Definition: atlasrrt.h:222
unsigned int * tp
Definition: atlasrrt.h:210
unsigned int nCollisionChecks
Definition: atlasrrt.h:142
unsigned int nSample
Definition: atlasrrt.h:129
unsigned int n
Definition: atlasrrt.h:97
unsigned int ms
Definition: atlasrrt.h:217
unsigned int nCollision
Definition: atlasrrt.h:112
unsigned int ns
Definition: atlasrrt.h:218
unsigned int nTooLong
Definition: atlasrrt.h:113
TChartInfo ** ci
Definition: atlasrrt.h:223
unsigned int nOutOfChart
Definition: atlasrrt.h:120
void InitAtlasRRT(Tparameters *pr, boolean parallel, double *ps, unsigned int mode, boolean graph, double *pg, TAtlasBase *w, Tatlasrrt *ar)
Defines a Atlas-RRT from a given point.
Definition: atlasrrt.c:2855
Information for each sample in an AtlasRRT.
Definition: atlasrrt.h:156
unsigned int mct2
Definition: atlasrrt.h:229
unsigned int nStep
Definition: atlasrrt.h:106
unsigned int tree
Definition: atlasrrt.h:177
TJacobian J
Definition: atlasrrt.h:212
void InitAtlasRRTStatistics(TAtlasRRTStatistics *arst)
Init the Atlas RRT statistics.
Definition: atlasrrt.c:325
unsigned int GetRRTNNInChart(unsigned int tree, unsigned int chartId, double *q_rand, double t, double *d, Tatlasrrt *ar)
Selects the nearest neighbour from the random point in the chart of Id ChartId.
Definition: atlasrrt.c:4443
boolean AtlasTRRT(Tparameters *pr, double *pg, double *time, double *pl, double *pc, unsigned int *ns, double ***path, double(*costF)(Tparameters *, boolean, double *, void *), void *costData, TAtlasRRTStatistics *str, Tatlasrrt *ar)
Extends a Atlas-TRRT until we reach a targed point.
Definition: atlasrrt.c:3399
A RRT on a manifold.
Definition: rrt.h:329
unsigned int nNoEmptyBranch
Definition: atlasrrt.h:101
unsigned int nErrorNewChart
Definition: atlasrrt.h:118
unsigned int AtlasRRTMemSize(Tatlasrrt *ar)
Memory used by a given atlasRRT.
Definition: atlasrrt.c:4677
double * t
Definition: atlasrrt.h:160
double r
Definition: atlasrrt.h:197
unsigned int lc
Definition: atlasrrt.h:176
Tbox ambient
Definition: atlasrrt.h:209
Definition of a rrt on a manifold.
Tatlas atlas
Definition: atlasrrt.h:215
unsigned int id
Definition: atlasrrt.h:157
unsigned int nChart
Definition: atlasrrt.h:130
boolean AtlasRRTValidateSample(Tparameters *pr, double *q_rand, unsigned int tree, boolean expand2goal, unsigned int lastNN2Goal, double *goal, double l, double *h, unsigned int *i_near, TAtlasRRTStatistics *arst, Tatlasrrt *ar)
Validates a sample generate with AtlasRRTSample.
Definition: atlasrrt.c:3081
unsigned int nTooFar
Definition: atlasrrt.h:114
boolean AtlasRRT(Tparameters *pr, double *pg, double *time, double *pl, unsigned int *ns, double ***path, TAtlasRRTStatistics *str, Tatlasrrt *ar)
Extends a Atlas-RRT until we reach a targed point.
Definition: atlasrrt.c:3133
unsigned int c
Definition: atlasrrt.h:162
unsigned int nNotInDomain
Definition: atlasrrt.h:111
unsigned int pc
Definition: atlasrrt.h:161
void DeleteAtlasRRTStatistics(TAtlasRRTStatistics *arst)
Destructor.
Definition: atlasrrt.c:745
double * s
Definition: atlasrrt.h:158
unsigned int nNoEmptyTreeConnection
Definition: atlasrrt.h:104
A table of parameters.
unsigned int mc
Definition: atlasrrt.h:221
unsigned int m
Definition: atlasrrt.h:193
unsigned int nNoConvergent
Definition: atlasrrt.h:119
void AccumulateAtlasRRTStatistics(TAtlasRRTStatistics *arst1, TAtlasRRTStatistics *arst2)
Accumulates two sets of Atlas RRT statistics.
Definition: atlasrrt.c:492
TSampleInfo ** si
Definition: atlasrrt.h:219
unsigned int GetAtlasRRTNumNodes(Tatlasrrt *ar)
Number of nodes in the AtlasRRT.
Definition: atlasrrt.c:4400
boolean AtlasRRTstar(Tparameters *pr, double *pg, unsigned int *it, double *times, double *costs, double *planningTime, double *pl, unsigned int *ns, double ***path, TAtlasRRTStatistics *str, Tatlasrrt *ar)
Optimal AtlasRRT on manifolds.
Definition: atlasrrt.c:3908
boolean birrt
Definition: atlasrrt.h:200
Type defining the equations on which the atlas is defined.
Definition: wcs.h:30
Definition of an atlas on a manifold.
unsigned int nNoConnect
Definition: atlasrrt.h:131
boolean AtlasBiRRTstar(Tparameters *pr, double *pg, unsigned int *it, double *times, double *costs, double *planningTime, double *pl, unsigned int *ns, double ***path, TAtlasRRTStatistics *str, Tatlasrrt *ar)
Bidirectional version of AtlasRRTstar.
Definition: atlasrrt.c:4148
Trrt rrt
Definition: atlasrrt.h:214
A atlas on a manifold.
Definition: atlas.h:289
A box.
Definition: box.h:83
unsigned int lsc
Definition: atlasrrt.h:164
double ce
Definition: atlasrrt.h:196
void PrintAtlasRRTStatistics(Tatlasrrt *ar, TAtlasRRTStatistics *arst)
Prints the summary of atlasRRT statistics.
Definition: atlasrrt.c:538
void LoadAtlasRRT(Tparameters *pr, char *prefix, TAtlasBase *w, Tatlasrrt *ar)
Defines an atlasRRT from the information on a file.
Definition: atlasrrt.c:4744
unsigned int generateChart
Definition: atlasrrt.h:163
Statistics on the AtlasRRT constrution.
Definition: atlasrrt.h:96
unsigned int nLargeCurvature
Definition: atlasrrt.h:121
double e
Definition: atlasrrt.h:195
unsigned int nBranch
Definition: atlasrrt.h:100
void PlotAtlasRRT(char *prefix, int argc, char **arg, Tparameters *pr, unsigned int xID, unsigned int yID, unsigned int zID, Tatlasrrt *ar)
Pots a projection of a Atlas-RRT.
Definition: atlasrrt.c:4470
The Jacobian of a set of equations.
Definition: jacobian.h:23
void DeleteAtlasRRT(Tatlasrrt *ar)
Destructor.
Definition: atlasrrt.c:4817
unsigned int nRandom
Definition: atlasrrt.h:137
RRT with an atlas for sampling.
Definition: atlasrrt.h:190
unsigned int GetRRTNNInNeighbourChart(unsigned int tree, unsigned int c_rand, double *t_rand, double *q_rand, Tatlasrrt *ar)
Selects the nearest point in the chart of Id ChartId, or in a neighbour.
Definition: atlasrrt.c:4411
unsigned int mct1
Definition: atlasrrt.h:225
unsigned int * chartsAtTree2
Definition: atlasrrt.h:231
unsigned int nQrandReached
Definition: atlasrrt.h:110
boolean parallel
Definition: atlasrrt.h:204
unsigned int it
Definition: atlasrrt.h:178
void SaveAtlasRRT(Tparameters *pr, char *prefix, Tatlasrrt *ar)
Stores the Atlas-RRT information on a file.
Definition: atlasrrt.c:4687
unsigned int nOverlap
Definition: atlasrrt.h:115
unsigned int nTreeConnection
Definition: atlasrrt.h:103
unsigned int nRejections
Definition: atlasrrt.h:139
boolean AtlasRRTSample(Tparameters *pr, unsigned int samplingMode, unsigned int it, unsigned int tree, double *goal, double scale, boolean *exploration, unsigned int *c_rand, double *t_rand, double *q_rand, TAtlasRRTStatistics *arst, Tatlasrrt *ar)
Generates a random sample to expand the AtlasRRT.
Definition: atlasrrt.c:2993
TAtlasBase * w
Definition: atlasrrt.h:191
unsigned int nDirLargeCurvature
Definition: atlasrrt.h:122
unsigned int nct1
Definition: atlasrrt.h:226
Information for each chart in an AtlasRRT.
Definition: atlasrrt.h:175
unsigned int nSingular
Definition: atlasrrt.h:133
unsigned int * chartsAtTree1
Definition: atlasrrt.h:227
unsigned int GetAtlasRRTNumCharts(Tatlasrrt *ar)
Number of charts in the AtlasRRT.
Definition: atlasrrt.c:4405