ccpm0_dubins_state_space.cpp
Go to the documentation of this file.
1 /*********************************************************************
2 * Copyright (c) 2017 - for information on the respective copyright
3 * owner see the NOTICE file and/or the repository
4 *
5 * https://github.com/hbanzhaf/steering_functions.git
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16 * implied. See the License for the specific language governing
17 * permissions and limitations under the License.
18 
19 * This source code is derived from Continuous Curvature (CC) Steer.
20 * Copyright (c) 2016, Thierry Fraichard and Institut national de
21 * recherche en informatique et en automatique (Inria), licensed under
22 * the BSD license, cf. 3rd-party-licenses.txt file in the root
23 * directory of this source tree.
24 **********************************************************************/
25 
26 #include <cmath>
27 #include <limits>
28 
32 
33 using namespace std;
34 
35 namespace steering
36 {
37 
39 {
40 private:
42 
43 public:
45  {
46  parent_ = parent;
47  }
48 
49  double distance = 0.0;
50  double angle = 0.0;
51 
52  // ##### TT ###################################################################
53  bool TT_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
54  {
55  if (c1.left == c2.left)
56  {
57  return false;
58  }
59  if (c1.forward == c2.forward)
60  {
61  return false;
62  }
63  return fabs(distance - 2 * c2.radius) < get_epsilon();
64  }
65 
66  void TT_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q) const
67  {
68  double x = (c1.xc + c2.xc) / 2;
69  double y = (c1.yc + c2.yc) / 2;
70  double angle = atan2(c2.yc - c1.yc, c2.xc - c1.xc);
71  double theta;
72  if (c1.left)
73  {
74  if (c1.forward)
75  {
76  theta = angle + HALF_PI - c2.mu;
77  }
78  else
79  {
80  theta = angle + HALF_PI + c2.mu;
81  }
82  }
83  else
84  {
85  if (c1.forward)
86  {
87  theta = angle - HALF_PI + c2.mu;
88  }
89  else
90  {
91  theta = angle - HALF_PI - c2.mu;
92  }
93  }
94  *q = new Configuration(x, y, theta, 0);
95  }
96 
97  double TT_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, HC_CC_Circle **cstart, HC_CC_Circle **cend,
98  Configuration **q1, Configuration **q2) const
99  {
100  TT_tangent_circles(c1, c2, q2);
101  *cstart = new HC_CC_Circle(**q2, !c2.left, c2.forward, true, parent_->hc_cc_circle_param_);
102  *cend = new HC_CC_Circle(c2.start, c2.left, c2.forward, true, parent_->hc_cc_circle_param_);
103  *q1 = new Configuration(c1.start.x, c1.start.y, c1.start.theta, c1.kappa);
104  return (*cstart)->hc_turn_length(**q1) + (*cend)->cc_turn_length(**q2);
105  }
106 
107  // ##### Dubins families: #####################################################
108 
109  // ##### TST ##################################################################
110  bool TiST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
111  {
112  if (c1.left == c2.left)
113  {
114  return false;
115  }
116  if (c1.forward == c2.forward)
117  {
118  return false;
119  }
120  return (distance >= 2 * c2.radius);
121  }
122 
123  bool TeST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
124  {
125  if (c1.left != c2.left)
126  {
127  return false;
128  }
129  if (c1.forward == c2.forward)
130  {
131  return false;
132  }
133  return (distance >= 2 * c2.radius * c2.sin_mu);
134  }
135 
136  bool TST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
137  {
138  return TiST_exists(c1, c2) || TeST_exists(c1, c2);
139  }
140 
142  Configuration **q2) const
143  {
144  double distance = center_distance(c1, c2);
145  double angle = atan2(c2.yc - c1.yc, c2.xc - c1.xc);
146  double alpha = asin(2 * c2.radius * c2.cos_mu / distance);
147  double delta_x = c2.radius * c2.sin_mu;
148  double delta_y = c2.radius * c2.cos_mu;
149  double x, y, theta;
150  if (c1.left && c1.forward)
151  {
152  theta = angle + alpha;
153  global_frame_change(c1.xc, c1.yc, theta, delta_x, -delta_y, &x, &y);
154  *q1 = new Configuration(x, y, theta, 0);
155  global_frame_change(c2.xc, c2.yc, theta, -delta_x, delta_y, &x, &y);
156  *q2 = new Configuration(x, y, theta, 0);
157  }
158  if (c1.left && !c1.forward)
159  {
160  theta = angle - alpha;
161  global_frame_change(c1.xc, c1.yc, theta, delta_x, delta_y, &x, &y);
162  *q1 = new Configuration(x, y, theta + PI, 0);
163  global_frame_change(c2.xc, c2.yc, theta, -delta_x, -delta_y, &x, &y);
164  *q2 = new Configuration(x, y, theta + PI, 0);
165  }
166  if (!c1.left && c1.forward)
167  {
168  theta = angle - alpha;
169  global_frame_change(c1.xc, c1.yc, theta, delta_x, delta_y, &x, &y);
170  *q1 = new Configuration(x, y, theta, 0);
171  global_frame_change(c2.xc, c2.yc, theta, -delta_x, -delta_y, &x, &y);
172  *q2 = new Configuration(x, y, theta, 0);
173  }
174  if (!c1.left && !c1.forward)
175  {
176  theta = angle + alpha;
177  global_frame_change(c1.xc, c1.yc, theta, delta_x, -delta_y, &x, &y);
178  *q1 = new Configuration(x, y, theta + PI, 0);
179  global_frame_change(c2.xc, c2.yc, theta, -delta_x, delta_y, &x, &y);
180  *q2 = new Configuration(x, y, theta + PI, 0);
181  }
182  }
183 
185  Configuration **q2) const
186  {
187  double delta_x = c2.radius * c2.sin_mu;
188  double delta_y = c2.radius * c2.cos_mu;
189  double theta = atan2(c2.yc - c1.yc, c2.xc - c1.xc);
190  double x, y;
191  if (c1.left && c1.forward)
192  {
193  global_frame_change(c1.xc, c1.yc, theta, delta_x, -delta_y, &x, &y);
194  *q1 = new Configuration(x, y, theta, 0);
195  global_frame_change(c2.xc, c2.yc, theta, -delta_x, -delta_y, &x, &y);
196  *q2 = new Configuration(x, y, theta, 0);
197  }
198  if (c1.left && !c1.forward)
199  {
200  global_frame_change(c1.xc, c1.yc, theta, delta_x, delta_y, &x, &y);
201  *q1 = new Configuration(x, y, theta + PI, 0);
202  global_frame_change(c2.xc, c2.yc, theta, -delta_x, delta_y, &x, &y);
203  *q2 = new Configuration(x, y, theta + PI, 0);
204  }
205  if (!c1.left && c1.forward)
206  {
207  global_frame_change(c1.xc, c1.yc, theta, delta_x, delta_y, &x, &y);
208  *q1 = new Configuration(x, y, theta, 0);
209  global_frame_change(c2.xc, c2.yc, theta, -delta_x, delta_y, &x, &y);
210  *q2 = new Configuration(x, y, theta, 0);
211  }
212  if (!c1.left && !c1.forward)
213  {
214  global_frame_change(c1.xc, c1.yc, theta, delta_x, -delta_y, &x, &y);
215  *q1 = new Configuration(x, y, theta + PI, 0);
216  global_frame_change(c2.xc, c2.yc, theta, -delta_x, -delta_y, &x, &y);
217  *q2 = new Configuration(x, y, theta + PI, 0);
218  }
219  }
220 
221  double TiST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, HC_CC_Circle **cstart, HC_CC_Circle **cend,
222  Configuration **q1, Configuration **q2, Configuration **q3) const
223  {
224  TiST_tangent_circles(c1, c2, q2, q3);
225  *cstart = new HC_CC_Circle(**q2, c1.left, !c1.forward, true, parent_->hc_cc_circle_param_);
226  *cend = new HC_CC_Circle(c2.start, c2.left, c2.forward, true, parent_->hc_cc_circle_param_);
227  *q1 = new Configuration(c1.start.x, c1.start.y, c1.start.theta, c1.kappa);
228  return (*cstart)->hc_turn_length(**q1) + configuration_distance(**q2, **q3) + (*cend)->cc_turn_length(**q3);
229  }
230 
231  double TeST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, HC_CC_Circle **cstart, HC_CC_Circle **cend,
232  Configuration **q1, Configuration **q2, Configuration **q3) const
233  {
234  TeST_tangent_circles(c1, c2, q2, q3);
235  *cstart = new HC_CC_Circle(**q2, c1.left, !c1.forward, true, parent_->hc_cc_circle_param_);
236  *cend = new HC_CC_Circle(c2.start, c2.left, c2.forward, true, parent_->hc_cc_circle_param_);
237  *q1 = new Configuration(c1.start.x, c1.start.y, c1.start.theta, c1.kappa);
238  return (*cstart)->hc_turn_length(**q1) + configuration_distance(**q2, **q3) + (*cend)->cc_turn_length(**q3);
239  }
240 
241  double TST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, HC_CC_Circle **cstart, HC_CC_Circle **cend,
242  Configuration **q1, Configuration **q2, Configuration **q3) const
243  {
244  if (TiST_exists(c1, c2))
245  {
246  return TiST_path(c1, c2, cstart, cend, q1, q2, q3);
247  }
248  if (TeST_exists(c1, c2))
249  {
250  return TeST_path(c1, c2, cstart, cend, q1, q2, q3);
251  }
252  return numeric_limits<double>::max();
253  }
254 
255  // ##### TTT ##################################################################
256  bool TTT_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
257  {
258  if (c1.left != c2.left)
259  {
260  return false;
261  }
262  if (c1.forward == c2.forward)
263  {
264  return false;
265  }
266  return distance <= 4 * c2.radius;
267  }
268 
270  Configuration **q3, Configuration **q4) const
271  {
272  double theta = angle;
273  double r = 2 * c2.radius;
274  double delta_x = 0.5 * distance;
275  double delta_y = sqrt(pow(r, 2) - pow(delta_x, 2));
276  double x, y;
277 
278  global_frame_change(c1.xc, c1.yc, theta, delta_x, delta_y, &x, &y);
279  HC_CC_Circle tgt1(x, y, !c1.left, c1.forward, c1.regular, parent_->hc_cc_circle_param_);
280  global_frame_change(c1.xc, c1.yc, theta, delta_x, -delta_y, &x, &y);
281  HC_CC_Circle tgt2(x, y, !c1.left, c1.forward, c1.regular, parent_->hc_cc_circle_param_);
282 
283  TT_tangent_circles(c1, tgt1, q1);
284  TT_tangent_circles(tgt1, c2, q2);
285  TT_tangent_circles(c1, tgt2, q3);
286  TT_tangent_circles(tgt2, c2, q4);
287  }
288 
289  double TTT_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, HC_CC_Circle **cstart, HC_CC_Circle **cend,
290  Configuration **q1, Configuration **q2, HC_CC_Circle **ci) const
291  {
292  Configuration *qa, *qb, *qc, *qd;
293  TTT_tangent_circles(c1, c2, &qa, &qb, &qc, &qd);
294  HC_CC_Circle *start1, *start2, *middle1, *middle2;
295  start1 = new HC_CC_Circle(*qa, c1.left, !c1.forward, true, parent_->hc_cc_circle_param_);
296  middle1 = new HC_CC_Circle(*qa, !c1.left, c1.forward, true, parent_->hc_cc_circle_param_);
297  start2 = new HC_CC_Circle(*qc, c1.left, !c1.forward, true, parent_->hc_cc_circle_param_);
298  middle2 = new HC_CC_Circle(*qc, !c1.left, c1.forward, true, parent_->hc_cc_circle_param_);
299 
300  *cend = new HC_CC_Circle(c2.start, c2.left, c2.forward, true, parent_->hc_cc_circle_param_);
301  *q1 = new Configuration(c1.start.x, c1.start.y, c1.start.theta, c1.kappa);
302 
303  // select shortest connection
304  double length1 = start1->hc_turn_length(**q1) + middle1->cc_turn_length(*qb) + (*cend)->cc_turn_length(*qb);
305  double length2 = start2->hc_turn_length(**q1) + middle2->cc_turn_length(*qd) + (*cend)->cc_turn_length(*qd);
306  if (length1 < length2)
307  {
308  *cstart = start1;
309  *q2 = qb;
310  *ci = middle1;
311  delete qa;
312  delete qc;
313  delete qd;
314  delete start2;
315  delete middle2;
316  return length1;
317  }
318  else
319  {
320  *cstart = start2;
321  *q2 = qd;
322  *ci = middle2;
323  delete qa;
324  delete qb;
325  delete qc;
326  delete start1;
327  delete middle1;
328  return length2;
329  }
330  return numeric_limits<double>::max();
331  }
332 };
333 
334 // ############################################################################
335 
336 CCpm0_Dubins_State_Space::CCpm0_Dubins_State_Space(double kappa, double sigma, double discretization, bool forwards)
337  : HC_CC_State_Space(kappa, sigma, discretization)
338  , forwards_(forwards)
339  , ccpm0_dubins_{ unique_ptr<CCpm0_Dubins>(new CCpm0_Dubins(this)) }
340 {
341  rs_circle_param_.set_param(kappa_, numeric_limits<double>::max(), 1 / kappa_, 0.0, 0.0, 1.0, 0.0);
342  radius_ = hc_cc_circle_param_.radius;
343  mu_ = hc_cc_circle_param_.mu;
344 }
345 
347 
349  const HC_CC_Circle &c2) const
350 {
351  // table containing the lengths of the paths, the intermediate configurations and circles
352  double length[nb_cc_dubins_paths];
353  double_array_init(length, nb_cc_dubins_paths, numeric_limits<double>::max());
355  pointer_array_init((void **)qi1, nb_cc_dubins_paths);
357  pointer_array_init((void **)qi2, nb_cc_dubins_paths);
359  pointer_array_init((void **)qi3, nb_cc_dubins_paths);
361  pointer_array_init((void **)cstart, nb_cc_dubins_paths);
363  pointer_array_init((void **)ci1, nb_cc_dubins_paths);
365  pointer_array_init((void **)cend, nb_cc_dubins_paths);
366 
367  // precomputations
368  ccpm0_dubins_->distance = center_distance(c1, c2);
369  ccpm0_dubins_->angle = atan2(c2.yc - c1.yc, c2.xc - c1.xc);
370 
371  // case E
372  if (configuration_equal(c1.start, c2.start))
373  {
374  length[cc_dubins::E] = 0;
375  goto label_end;
376  }
377  // case T
378  if (ccpm0_dubins_->distance < get_epsilon())
379  {
380  cend[cc_dubins::T] = new HC_CC_Circle(c2.start, c2.left, c2.forward, true, hc_cc_circle_param_);
381  length[cc_dubins::T] = cend[cc_dubins::T]->hc_turn_length(c1.start);
382  goto label_end;
383  }
384  // case TT
385  if (ccpm0_dubins_->TT_exists(c1, c2))
386  {
387  length[cc_dubins::TT] = ccpm0_dubins_->TT_path(c1, c2, &cstart[cc_dubins::TT], &cend[cc_dubins::TT],
388  &qi1[cc_dubins::TT], &qi2[cc_dubins::TT]);
389  }
390  // ##### Dubins families: #####################################################
391  // case TST
392  if (ccpm0_dubins_->TST_exists(c1, c2))
393  {
394  length[cc_dubins::TST] = ccpm0_dubins_->TST_path(c1, c2, &cstart[cc_dubins::TST], &cend[cc_dubins::TST],
395  &qi1[cc_dubins::TST], &qi2[cc_dubins::TST], &qi3[cc_dubins::TST]);
396  }
397  // case TTT
398  if (ccpm0_dubins_->TTT_exists(c1, c2))
399  {
400  length[cc_dubins::TTT] = ccpm0_dubins_->TTT_path(c1, c2, &cstart[cc_dubins::TTT], &cend[cc_dubins::TTT],
401  &qi1[cc_dubins::TTT], &qi2[cc_dubins::TTT], &ci1[cc_dubins::TTT]);
402  }
403 label_end:
404  // select shortest path
407  path =
408  new CC_Dubins_Path(c1.start, c2.start, best_path, kappa_, sigma_, qi1[best_path], qi2[best_path], qi3[best_path],
409  nullptr, cstart[best_path], cend[best_path], ci1[best_path], nullptr, length[best_path]);
410 
411  // clean up
412  for (int i = 0; i < nb_cc_dubins_paths; i++)
413  {
414  if (i != best_path)
415  {
416  delete qi1[i];
417  delete qi2[i];
418  delete qi3[i];
419  delete cstart[i];
420  delete ci1[i];
421  delete cend[i];
422  }
423  }
424  return path;
425 }
426 
428 {
429  // compute the 2 circles at the intial and final configuration
430  Configuration start1(state1.x, state1.y, state1.theta, kappa_);
431  Configuration start2(state1.x, state1.y, state1.theta, -kappa_);
432  Configuration end(state2.x, state2.y, state2.theta, 0.0);
433 
434  HC_CC_Circle *start_circle[2];
435  HC_CC_Circle *end_circle[2];
436  if (forwards_)
437  {
438  start_circle[0] = new HC_CC_Circle(start1, true, true, true, rs_circle_param_);
439  start_circle[1] = new HC_CC_Circle(start2, false, true, true, rs_circle_param_);
440  end_circle[0] = new HC_CC_Circle(end, true, false, true, hc_cc_circle_param_);
441  end_circle[1] = new HC_CC_Circle(end, false, false, true, hc_cc_circle_param_);
442  }
443  else
444  {
445  start_circle[0] = new HC_CC_Circle(start1, true, false, true, rs_circle_param_);
446  start_circle[1] = new HC_CC_Circle(start2, false, false, true, rs_circle_param_);
447  end_circle[0] = new HC_CC_Circle(end, true, true, true, hc_cc_circle_param_);
448  end_circle[1] = new HC_CC_Circle(end, false, true, true, hc_cc_circle_param_);
449  }
450 
451  // compute the shortest path for the 4 combinations (2 circles at the beginning and 2 at the end)
452  CC_Dubins_Path *path[] = { nullptr, nullptr, nullptr, nullptr };
453 
454  double lg[] = { numeric_limits<double>::max(), numeric_limits<double>::max(), numeric_limits<double>::max(),
455  numeric_limits<double>::max() };
456 
457  for (int i = 0; i < 2; i++)
458  {
459  // skip circle at the beginning for curvature continuity
460  if (i == 0 && state1.kappa < 0)
461  continue;
462  else if (i == 1 && state1.kappa > 0)
463  continue;
464  for (int j = 0; j < 2; j++)
465  {
466  path[2 * i + j] = ccpm0_circles_dubins_path(*start_circle[i], *end_circle[j]);
467  if (path[2 * i + j])
468  {
469  lg[2 * i + j] = path[2 * i + j]->length;
470  }
471  }
472  }
473 
474  // select shortest path
475  int best_path = array_index_min(lg, 4);
476 
477  // // display calculations
478  // cout << endl << "CCpm0_Dubins_State_Space" << endl;
479  // for (int i = 0; i < 4; i++)
480  // {
481  // cout << i << ": ";
482  // if (path[i])
483  // {
484  // path[i]->print(true);
485  // cout << endl;
486  // }
487  // }
488  // cout << "shortest path: " << (int)best_path << endl;
489  // path[best_path]->print(true);
490 
491  // clean up
492  for (int i = 0; i < 2; i++)
493  {
494  delete start_circle[i];
495  delete end_circle[i];
496  }
497  for (int i = 0; i < 4; i++)
498  {
499  if (i != best_path)
500  {
501  delete path[i];
502  }
503  }
504  return path[best_path];
505 }
506 
507 double CCpm0_Dubins_State_Space::get_distance(const State &state1, const State &state2) const
508 {
509  CC_Dubins_Path *p = this->ccpm0_dubins(state1, state2);
510  double length = p->length;
511  delete p;
512  return length;
513 }
514 
515 vector<Control> CCpm0_Dubins_State_Space::get_controls(const State &state1, const State &state2) const
516 {
517  vector<Control> cc_dubins_controls;
518  cc_dubins_controls.reserve(8);
519  CC_Dubins_Path *p = this->ccpm0_dubins(state1, state2);
520  switch (p->type)
521  {
522  case cc_dubins::E:
523  empty_controls(cc_dubins_controls);
524  break;
525  case cc_dubins::T:
526  hc_turn_controls(*(p->cend), p->start, false, cc_dubins_controls);
527  break;
528  case cc_dubins::TT:
529  hc_turn_controls(*(p->cstart), *(p->qi1), false, cc_dubins_controls);
530  cc_turn_controls(*(p->cend), *(p->qi2), false, cc_dubins_controls);
531  break;
532  // ##### Dubins families: #####################################################
533  case cc_dubins::TST:
534  hc_turn_controls(*(p->cstart), *(p->qi1), false, cc_dubins_controls);
535  straight_controls(*(p->qi2), *(p->qi3), cc_dubins_controls);
536  cc_turn_controls(*(p->cend), *(p->qi3), false, cc_dubins_controls);
537  break;
538  case cc_dubins::TTT:
539  hc_turn_controls(*(p->cstart), *(p->qi1), false, cc_dubins_controls);
540  cc_turn_controls(*(p->ci1), *(p->qi2), true, cc_dubins_controls);
541  cc_turn_controls(*(p->cend), *(p->qi2), false, cc_dubins_controls);
542  break;
543  default:
544  break;
545  }
546  delete p;
547  return cc_dubins_controls;
548 }
549 
550 } // namespace steering
steering::cc_dubins::TST
@ TST
Definition: paths.hpp:88
plot_states.alpha
alpha
Definition: plot_states.py:107
steering::Path::length
double length
Path length.
Definition: paths.hpp:98
steering::HC_CC_State_Space::hc_cc_circle_param_
HC_CC_Circle_Param hc_cc_circle_param_
Parameters of a hc-/cc-circle.
Definition: hc_cc_state_space.hpp:101
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins
Definition: ccpm0_dubins_state_space.cpp:38
steering::cc_dubins::TT
@ TT
Definition: paths.hpp:86
steering::State
Description of a kinematic car's state.
Definition: steering_functions.hpp:44
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TTT_path
double TTT_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, HC_CC_Circle **cstart, HC_CC_Circle **cend, Configuration **q1, Configuration **q2, HC_CC_Circle **ci) const
Definition: ccpm0_dubins_state_space.cpp:289
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TiST_path
double TiST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, HC_CC_Circle **cstart, HC_CC_Circle **cend, Configuration **q1, Configuration **q2, Configuration **q3) const
Definition: ccpm0_dubins_state_space.cpp:221
steering::CCpm0_Dubins_State_Space::ccpm0_circles_dubins_path
CC_Dubins_Path * ccpm0_circles_dubins_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Returns a sequence of turns and straight lines connecting the two circles c1 and c2.
Definition: ccpm0_dubins_state_space.cpp:348
angle
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TST_exists
bool TST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: ccpm0_dubins_state_space.cpp:136
steering::HC_CC_State_Space::sigma_
double sigma_
Definition: hc_cc_state_space.hpp:95
steering::CC_Dubins_Path::cstart
HC_CC_Circle * cstart
Start, end and intermediate circles.
Definition: paths.hpp:117
plot_states.path
path
Definition: plot_states.py:88
steering::HC_CC_Circle_Param::mu
double mu
Angle between the initial orientation and the tangent to the circle at the initial position.
Definition: hc_cc_circle.hpp:94
steering::cc_dubins::path_type
path_type
Definition: paths.hpp:81
steering::State::theta
double theta
Orientation of the robot.
Definition: steering_functions.hpp:70
configuration.hpp
steering::CCpm0_Dubins_State_Space::rs_circle_param_
HC_CC_Circle_Param rs_circle_param_
Parameter of a rs-circle.
Definition: ccpm0_dubins_state_space.hpp:124
steering::HC_CC_Circle::left
bool left
Turning direction: left/right.
Definition: hc_cc_circle.hpp:123
steering::empty_controls
void empty_controls(std::vector< Control > &controls)
Appends controls with 0 input.
steering::nb_cc_dubins_paths
const int nb_cc_dubins_paths
Definition: paths.hpp:94
steering::State::kappa
double kappa
Curvature at position (x,y)
Definition: steering_functions.hpp:73
steering::CCpm0_Dubins_State_Space::get_distance
double get_distance(const State &state1, const State &state2) const
Returns shortest path length from state1 to state2.
Definition: ccpm0_dubins_state_space.cpp:507
plot_statistics.CCpm0_Dubins
CCpm0_Dubins
Definition: plot_statistics.py:94
steering::HC_CC_Circle
Definition: hc_cc_circle.hpp:80
steering::HC_CC_Circle_Param::cos_mu
double cos_mu
Definition: hc_cc_circle.hpp:97
steering::State::y
double y
Position in y of the robot.
Definition: steering_functions.hpp:67
steering::HC_CC_Circle::xc
double xc
Center of the circle.
Definition: hc_cc_circle.hpp:132
steering::CCpm0_Dubins_State_Space::ccpm0_dubins
CC_Dubins_Path * ccpm0_dubins(const State &state1, const State &state2) const
Returns a sequence of turns and straight lines connecting a start and an end configuration.
Definition: ccpm0_dubins_state_space.cpp:427
ccpm0_dubins_state_space.hpp
steering::CC_Dubins_Path::qi3
Configuration * qi3
Definition: paths.hpp:114
steering::cc_dubins::TTT
@ TTT
Definition: paths.hpp:89
steering::configuration_distance
double configuration_distance(const Configuration &q1, const Configuration &q2)
Cartesian distance between two configurations.
Definition: configuration.cpp:54
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::parent_
CCpm0_Dubins_State_Space * parent_
Definition: ccpm0_dubins_state_space.cpp:41
steering::CCpm0_Dubins_State_Space::get_controls
std::vector< Control > get_controls(const State &state1, const State &state2) const
Returns controls of the shortest path from state1 to state2.
Definition: ccpm0_dubins_state_space.cpp:515
steering::HC_CC_Circle::yc
double yc
Definition: hc_cc_circle.hpp:132
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TeST_exists
bool TeST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: ccpm0_dubins_state_space.cpp:123
steering::cc_dubins::E
@ E
Definition: paths.hpp:83
steering::global_frame_change
void global_frame_change(double x, double y, double theta, double local_x, double local_y, double *global_x, double *global_y)
Transformation of (local_x, local_y) from local coordinate system to global one.
Definition: utilities.cpp:223
steering::CCpm0_Dubins_State_Space::~CCpm0_Dubins_State_Space
~CCpm0_Dubins_State_Space()
Destructor.
steering::HC_CC_Circle::forward
bool forward
Driving direction: forwards/backwards.
Definition: hc_cc_circle.hpp:126
steering::hc_turn_controls
void hc_turn_controls(const HC_CC_Circle &c, const Configuration &q, bool order, std::vector< Control > &controls)
Appends controls with a hc-turn.
steering::State::x
double x
Position in x of the robot.
Definition: steering_functions.hpp:64
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::CCpm0_Dubins
CCpm0_Dubins(CCpm0_Dubins_State_Space *parent)
Definition: ccpm0_dubins_state_space.cpp:44
steering::pointer_array_init
void pointer_array_init(void *array[], int size)
Initialize an array with nullptr.
Definition: utilities.cpp:264
steering::HC_CC_State_Space::kappa_
double kappa_
Curvature, sharpness of clothoid.
Definition: hc_cc_state_space.hpp:95
steering::CC_Dubins_Path::ci1
HC_CC_Circle * ci1
Definition: paths.hpp:117
steering::straight_controls
void straight_controls(const Configuration &q1, const Configuration &q2, std::vector< Control > &controls)
Appends controls with a straight line.
distance
double distance(double x0, double y0, double x1, double y1)
steering::CCpm0_Dubins_State_Space
An implementation of continuous curvature (CC) steer for a Dubins car with either positive (p) or neg...
Definition: ccpm0_dubins_state_space.hpp:69
steering::HC_CC_Circle_Param::sin_mu
double sin_mu
Sine and cosine of mu.
Definition: hc_cc_circle.hpp:97
steering::HC_CC_State_Space
Definition: hc_cc_state_space.hpp:45
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TTT_exists
bool TTT_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: ccpm0_dubins_state_space.cpp:256
steering::Configuration
Definition: configuration.hpp:55
steering::array_index_min
int array_index_min(double array[], int size)
Find index with minimal value in double array.
Definition: utilities.cpp:241
steering::HC_CC_Circle::cc_turn_length
double cc_turn_length(const Configuration &q) const
Length of a cc-turn.
Definition: hc_cc_circle.cpp:238
steering::center_distance
double center_distance(const HC_CC_Circle &c1, const HC_CC_Circle &c2)
Cartesian distance between the centers of two circles.
Definition: hc_cc_circle.cpp:307
steering::HC_CC_Circle::regular
bool regular
Type of the circle: regular/irregular.
Definition: hc_cc_circle.hpp:129
steering::get_epsilon
double get_epsilon()
Return value of epsilon.
Definition: utilities.cpp:57
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TiST_exists
bool TiST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: ccpm0_dubins_state_space.cpp:110
steering::CCpm0_Dubins_State_Space::ccpm0_dubins_
std::unique_ptr< CCpm0_Dubins > ccpm0_dubins_
Pimpl Idiom: unique pointer on class with families
Definition: ccpm0_dubins_state_space.hpp:118
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TT_exists
bool TT_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: ccpm0_dubins_state_space.cpp:53
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TiST_tangent_circles
void TiST_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
Definition: ccpm0_dubins_state_space.cpp:141
std
steering::HC_CC_Circle_Param::kappa
double kappa
Max. curvature, inverse of max. curvature, max. sharpness.
Definition: hc_cc_circle.hpp:88
length
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
plot_states.kappa
kappa
Definition: plot_states.py:106
steering::CC_Dubins_Path::qi1
Configuration * qi1
Intermediate configurations.
Definition: paths.hpp:114
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TeST_path
double TeST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, HC_CC_Circle **cstart, HC_CC_Circle **cend, Configuration **q1, Configuration **q2, Configuration **q3) const
Definition: ccpm0_dubins_state_space.cpp:231
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TST_path
double TST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, HC_CC_Circle **cstart, HC_CC_Circle **cend, Configuration **q1, Configuration **q2, Configuration **q3) const
Definition: ccpm0_dubins_state_space.cpp:241
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TT_path
double TT_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, HC_CC_Circle **cstart, HC_CC_Circle **cend, Configuration **q1, Configuration **q2) const
Definition: ccpm0_dubins_state_space.cpp:97
steering::CC_Dubins_Path::qi2
Configuration * qi2
Definition: paths.hpp:114
steering::double_array_init
void double_array_init(double array[], int size, double value)
Initialize an array with a given value.
Definition: utilities.cpp:256
steering
Definition: dubins_state_space.hpp:70
steering::cc_turn_controls
void cc_turn_controls(const HC_CC_Circle &c, const Configuration &q, bool order, std::vector< Control > &controls)
Appends controls with a cc-turn.
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TTT_tangent_circles
void TTT_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2, Configuration **q3, Configuration **q4) const
Definition: ccpm0_dubins_state_space.cpp:269
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TT_tangent_circles
void TT_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q) const
Definition: ccpm0_dubins_state_space.cpp:66
steering::CCpm0_Dubins_State_Space::CCpm0_Dubins::TeST_tangent_circles
void TeST_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
Definition: ccpm0_dubins_state_space.cpp:184
steering::CC_Dubins_Path::type
cc_dubins::path_type type
Path type.
Definition: paths.hpp:111
steering::CC_Dubins_Path::cend
HC_CC_Circle * cend
Definition: paths.hpp:117
PI
#define PI
Definition: utilities.hpp:31
steering::configuration_equal
bool configuration_equal(const Configuration &q1, const Configuration &q2)
Are two configurations equal?
Definition: configuration.cpp:69
steering::Configuration::y
double y
Definition: configuration.hpp:88
steering::CC_Dubins_Path
Definition: paths.hpp:96
HALF_PI
#define HALF_PI
Definition: utilities.hpp:32
steering::HC_CC_Circle_Param::radius
double radius
Radius of the outer circle.
Definition: hc_cc_circle.hpp:91
steering::cc_dubins::T
@ T
Definition: paths.hpp:85
steering::Path::start
Configuration start
Start and end configuration.
Definition: paths.hpp:92
steering::CCpm0_Dubins_State_Space::forwards_
bool forwards_
Driving direction.
Definition: ccpm0_dubins_state_space.hpp:115
steering::HC_CC_Circle::start
Configuration start
Start configuration.
Definition: hc_cc_circle.hpp:120
steering::Configuration::x
double x
Position.
Definition: configuration.hpp:88
utilities.hpp
steering::Configuration::theta
double theta
Orientation in rad between [0, 2*pi[.
Definition: configuration.hpp:91
steering::HC_CC_Circle::hc_turn_length
double hc_turn_length(const Configuration &q) const
Length of a hc-turn.
Definition: hc_cc_circle.cpp:185


steering_functions
Author(s): Holger Banzhaf
autogenerated on Mon Dec 11 2023 03:27:43