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 
29 #define NEW_BRANCH_EXTENSION 1
30 
41 #define ATLASRRT_VERBOSE 0
42 
49 #define GET_ATLASRRT_STATISTICS 1
50 
70 #define ADJUST_SA 0
71 
83 #define ATLASRRT_GLOBAL_NN 1
84 
91 # define GET_ATLASRRT_GLOBAL_CURV_CHECK 0
92 
109 typedef struct {
110  unsigned int n;
113  unsigned int nBranch;
114  unsigned int nNoEmptyBranch;
116  unsigned int nTreeConnection;
117  unsigned int nNoEmptyTreeConnection;
119  unsigned int nStep;
120  double dQrand;
122  /* Reasons to stop a branch extension */
123  unsigned int nQrandReached;
124  unsigned int nNotInDomain;
125  unsigned int nCollision;
126  unsigned int nTooLong;
127  unsigned int nTooFar;
128  unsigned int nOverlap;
130  /* Some of the reasons to create a new chart */
131  unsigned int nErrorNewChart;
132  unsigned int nNoConvergent;
133  unsigned int nOutOfChart;
134  unsigned int nLargeCurvature;
135  unsigned int nDirLargeCurvature ;
138  /* Refinements necessary in branch creation */
139  unsigned int nStepReduction;
142  unsigned int nSample;
143  unsigned int nChart;
144  unsigned int nNoConnect;
146  unsigned int nSingular;
149  /* Information about sampling */
150  unsigned int nRandom;
152  unsigned int nRejections;
154  /* Information aobut collison checking */
155  unsigned int nCollisionChecks;
157 
169 typedef struct {
170  unsigned int id;
171  double *s;
173  double *t;
174  unsigned int pc;
175  unsigned int c;
176  unsigned int generateChart;
177  unsigned int lsc;
179 } TSampleInfo;
180 
188 typedef struct {
189  unsigned int lc;
190  unsigned int tree;
191  unsigned int it;
192 } TChartInfo;
193 
203 typedef struct {
206  unsigned int m;
207  unsigned int k;
208  double e;
209  double ce;
210  double r;
213  boolean birrt;
217  boolean parallel;
223  unsigned int *tp;
230  unsigned int ms;
231  unsigned int ns;
234  unsigned int mc;
235  unsigned int nc;
238  unsigned int mct1;
239  unsigned int nct1;
240  unsigned int* chartsAtTree1;
242  unsigned int mct2;
243  unsigned int nct2;
244  unsigned int* chartsAtTree2;
245 } Tatlasrrt;
246 
247 /*******************************************************************************/
248 
257 
269 
279 
288 
289 /*******************************************************************************/
290 
291 
312 void InitAtlasRRT(Tparameters *pr,boolean parallel,double *ps,unsigned int mode,boolean graph,
313  double *pg,TAtlasBase *w,Tatlasrrt *ar);
314 
352 boolean AtlasRRTSample(Tparameters *pr,unsigned int samplingMode,
353  unsigned int it,unsigned int tree,
354  double *goal,double scale,boolean *exploration,
355  unsigned int *c_rand,double *t_rand,double *q_rand,
356  TAtlasRRTStatistics *arst,Tatlasrrt *ar);
357 
382 boolean AtlasRRTValidateSample(Tparameters *pr,double *q_rand,unsigned int tree,boolean expand2goal,
383  unsigned int lastNN2Goal,double *goal,double l,double *h,unsigned int *i_near,
384  TAtlasRRTStatistics *arst,Tatlasrrt *ar);
385 
406 boolean AtlasRRT(Tparameters *pr,double *pg,
407  double *time,
408  double *pl,unsigned int *ns,double ***path,
409  TAtlasRRTStatistics *str,Tatlasrrt *ar);
410 
411 
444 boolean AtlasTRRT(Tparameters *pr,double *pg,double *time,
445  double *pl,double *pc,unsigned int *ns,double ***path,
446  double (*costF)(Tparameters*,boolean,double*,void*),
447  void *costData,TAtlasRRTStatistics *str,Tatlasrrt *ar);
448 
491 boolean AtlasRRTstar(Tparameters *pr,double *pg,
492  unsigned int *it,double *times,double *costs,
493  double *planningTime,double *pl,unsigned int *ns,double ***path,
494  TAtlasRRTStatistics *str,Tatlasrrt *ar);
495 
520 boolean AtlasBiRRTstar(Tparameters *pr,double *pg,
521  unsigned int *it,double *times,double *costs,
522  double *planningTime,double *pl,unsigned int *ns,double ***path,
523  TAtlasRRTStatistics *str,Tatlasrrt *ar);
524 
548 void PlotAtlasRRT(char *prefix,int argc, char **arg,Tparameters *pr,
549  unsigned int xID,unsigned int yID,unsigned int zID,Tatlasrrt *ar);
550 
560 unsigned int GetAtlasRRTNumNodes(Tatlasrrt *ar);
561 
571 unsigned int GetAtlasRRTNumCharts(Tatlasrrt *ar);
572 
573 
590  double scale,unsigned int tree,
591  unsigned int *nm,
592  double *t,double *p,
593  Tatlasrrt* ar);
594 
609 unsigned int GetRRTNNInNeighbourChart(unsigned int tree,
610  unsigned int c_rand,double *t_rand,double *q_rand,
611  Tatlasrrt* ar);
612 
613 
632 unsigned int GetRRTNNInChart(unsigned int tree,unsigned int chartId,double *q_rand,
633  double t,double*d, Tatlasrrt* ar );
634 
666 void PlotAtlasRRT(char *prefix,int argc, char **arg,Tparameters *pr,
667  unsigned int xID,unsigned int yID,unsigned int zID,Tatlasrrt *ar);
668 
678 unsigned int AtlasRRTMemSize(Tatlasrrt *ar);
679 
695 void SaveAtlasRRT(Tparameters *pr,char *prefix,Tatlasrrt *ar);
696 
711 void LoadAtlasRRT(Tparameters *pr,char *prefix,TAtlasBase *w,Tatlasrrt *ar);
712 
721 void DeleteAtlasRRT(Tatlasrrt *ar);
722 
723 
724 #endif
unsigned int nStepReduction
Definition: atlasrrt.h:139
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:3821
unsigned int k
Definition: atlasrrt.h:207
unsigned int nct2
Definition: atlasrrt.h:243
unsigned int nc
Definition: atlasrrt.h:235
unsigned int * tp
Definition: atlasrrt.h:223
unsigned int nCollisionChecks
Definition: atlasrrt.h:155
unsigned int nSample
Definition: atlasrrt.h:142
unsigned int n
Definition: atlasrrt.h:110
unsigned int ms
Definition: atlasrrt.h:230
unsigned int nCollision
Definition: atlasrrt.h:125
unsigned int ns
Definition: atlasrrt.h:231
unsigned int nTooLong
Definition: atlasrrt.h:126
TChartInfo ** ci
Definition: atlasrrt.h:236
unsigned int nOutOfChart
Definition: atlasrrt.h:133
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:4114
Information for each sample in an AtlasRRT.
Definition: atlasrrt.h:169
unsigned int mct2
Definition: atlasrrt.h:242
unsigned int nStep
Definition: atlasrrt.h:119
unsigned int tree
Definition: atlasrrt.h:190
TJacobian J
Definition: atlasrrt.h:225
void InitAtlasRRTStatistics(TAtlasRRTStatistics *arst)
Init the Atlas RRT statistics.
Definition: atlasrrt.c:553
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:5832
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:4688
A RRT on a manifold.
Definition: rrt.h:322
unsigned int nNoEmptyBranch
Definition: atlasrrt.h:114
unsigned int nErrorNewChart
Definition: atlasrrt.h:131
unsigned int AtlasRRTMemSize(Tatlasrrt *ar)
Memory used by a given atlasRRT.
Definition: atlasrrt.c:6066
double * t
Definition: atlasrrt.h:173
double r
Definition: atlasrrt.h:210
unsigned int lc
Definition: atlasrrt.h:189
Tbox ambient
Definition: atlasrrt.h:222
Definition of a rrt on a manifold.
Tatlas atlas
Definition: atlasrrt.h:228
unsigned int id
Definition: atlasrrt.h:170
unsigned int nChart
Definition: atlasrrt.h:143
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:4340
unsigned int nTooFar
Definition: atlasrrt.h:127
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:4392
unsigned int c
Definition: atlasrrt.h:175
unsigned int nNotInDomain
Definition: atlasrrt.h:124
unsigned int pc
Definition: atlasrrt.h:174
void DeleteAtlasRRTStatistics(TAtlasRRTStatistics *arst)
Destructor.
Definition: atlasrrt.c:973
double * s
Definition: atlasrrt.h:171
unsigned int nNoEmptyTreeConnection
Definition: atlasrrt.h:117
A table of parameters.
unsigned int mc
Definition: atlasrrt.h:234
unsigned int m
Definition: atlasrrt.h:206
unsigned int nNoConvergent
Definition: atlasrrt.h:132
void AccumulateAtlasRRTStatistics(TAtlasRRTStatistics *arst1, TAtlasRRTStatistics *arst2)
Accumulates two sets of Atlas RRT statistics.
Definition: atlasrrt.c:720
TSampleInfo ** si
Definition: atlasrrt.h:232
unsigned int GetAtlasRRTNumNodes(Tatlasrrt *ar)
Number of nodes in the AtlasRRT.
Definition: atlasrrt.c:5789
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:5285
boolean birrt
Definition: atlasrrt.h:213
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:144
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:5523
Trrt rrt
Definition: atlasrrt.h:227
A atlas on a manifold.
Definition: atlas.h:289
A box.
Definition: box.h:83
unsigned int lsc
Definition: atlasrrt.h:177
double ce
Definition: atlasrrt.h:209
void PrintAtlasRRTStatistics(Tatlasrrt *ar, TAtlasRRTStatistics *arst)
Prints the summary of atlasRRT statistics.
Definition: atlasrrt.c:766
void LoadAtlasRRT(Tparameters *pr, char *prefix, TAtlasBase *w, Tatlasrrt *ar)
Defines an atlasRRT from the information on a file.
Definition: atlasrrt.c:6133
unsigned int generateChart
Definition: atlasrrt.h:176
Statistics on the AtlasRRT constrution.
Definition: atlasrrt.h:109
unsigned int nLargeCurvature
Definition: atlasrrt.h:134
double e
Definition: atlasrrt.h:208
unsigned int nBranch
Definition: atlasrrt.h:113
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:5859
The Jacobian of a set of equations.
Definition: jacobian.h:23
void DeleteAtlasRRT(Tatlasrrt *ar)
Destructor.
Definition: atlasrrt.c:6206
unsigned int nRandom
Definition: atlasrrt.h:150
RRT with an atlas for sampling.
Definition: atlasrrt.h:203
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:5800
unsigned int mct1
Definition: atlasrrt.h:238
unsigned int * chartsAtTree2
Definition: atlasrrt.h:244
unsigned int nQrandReached
Definition: atlasrrt.h:123
boolean parallel
Definition: atlasrrt.h:217
unsigned int it
Definition: atlasrrt.h:191
void SaveAtlasRRT(Tparameters *pr, char *prefix, Tatlasrrt *ar)
Stores the Atlas-RRT information on a file.
Definition: atlasrrt.c:6076
unsigned int nOverlap
Definition: atlasrrt.h:128
unsigned int nTreeConnection
Definition: atlasrrt.h:116
unsigned int nRejections
Definition: atlasrrt.h:152
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:4252
TAtlasBase * w
Definition: atlasrrt.h:204
unsigned int nDirLargeCurvature
Definition: atlasrrt.h:135
unsigned int nct1
Definition: atlasrrt.h:239
Information for each chart in an AtlasRRT.
Definition: atlasrrt.h:188
unsigned int nSingular
Definition: atlasrrt.h:146
unsigned int * chartsAtTree1
Definition: atlasrrt.h:240
unsigned int GetAtlasRRTNumCharts(Tatlasrrt *ar)
Number of charts in the AtlasRRT.
Definition: atlasrrt.c:5794