cc0pm_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 * c1.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 - c1.mu;
77  }
78  else
79  {
80  theta = angle + HALF_PI + c1.mu;
81  }
82  }
83  else
84  {
85  if (c1.forward)
86  {
87  theta = angle - HALF_PI + c1.mu;
88  }
89  else
90  {
91  theta = angle - HALF_PI - c1.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, q1);
101  *cstart = new HC_CC_Circle(c1.start, c1.left, c1.forward, true, parent_->hc_cc_circle_param_);
102  *cend = new HC_CC_Circle(**q1, c2.left, !c2.forward, true, parent_->hc_cc_circle_param_);
103  *q2 = new Configuration(c2.start.x, c2.start.y, c2.start.theta, c2.kappa);
104  return (*cstart)->cc_turn_length(**q1) + (*cend)->hc_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 * c1.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 * c1.radius * c1.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 * c1.radius * c1.cos_mu / distance);
147  double delta_x = c1.radius * c1.sin_mu;
148  double delta_y = c1.radius * c1.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 = c1.radius * c1.sin_mu;
188  double delta_y = c1.radius * c1.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, q1, q2);
225  *cstart = new HC_CC_Circle(c1.start, c1.left, c1.forward, true, parent_->hc_cc_circle_param_);
226  *cend = new HC_CC_Circle(**q2, c2.left, !c2.forward, true, parent_->hc_cc_circle_param_);
227  *q3 = new Configuration(c2.start.x, c2.start.y, c2.start.theta, c2.kappa);
228  return (*cstart)->cc_turn_length(**q1) + configuration_distance(**q1, **q2) + (*cend)->hc_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, q1, q2);
235  *cstart = new HC_CC_Circle(c1.start, c1.left, c1.forward, true, parent_->hc_cc_circle_param_);
236  *cend = new HC_CC_Circle(**q2, c2.left, !c2.forward, true, parent_->hc_cc_circle_param_);
237  *q3 = new Configuration(c2.start.x, c2.start.y, c2.start.theta, c2.kappa);
238  return (*cstart)->cc_turn_length(**q1) + configuration_distance(**q1, **q2) + (*cend)->hc_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 * c1.radius;
267  }
268 
270  Configuration **q3, Configuration **q4) const
271  {
272  double theta = angle;
273  double r = 2 * c1.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, Configuration **q3, 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 *end1, *end2, *middle1, *middle2;
295  middle1 = new HC_CC_Circle(*qa, !c1.left, c1.forward, true, parent_->hc_cc_circle_param_);
296  end1 = new HC_CC_Circle(*qb, c2.left, !c2.forward, true, parent_->hc_cc_circle_param_);
297  middle2 = new HC_CC_Circle(*qc, !c1.left, c1.forward, true, parent_->hc_cc_circle_param_);
298  end2 = new HC_CC_Circle(*qd, c2.left, !c2.forward, true, parent_->hc_cc_circle_param_);
299 
300  *cstart = new HC_CC_Circle(c1.start, c1.left, c1.forward, true, parent_->hc_cc_circle_param_);
301  *q3 = new Configuration(c2.start.x, c2.start.y, c2.start.theta, c2.kappa);
302 
303  // select shortest connection
304  double length1 = (*cstart)->cc_turn_length(*qa) + middle1->cc_turn_length(*qb) + end1->hc_turn_length(**q3);
305  double length2 = (*cstart)->cc_turn_length(*qc) + middle2->cc_turn_length(*qd) + end2->hc_turn_length(**q3);
306  if (length1 < length2)
307  {
308  *cend = end1;
309  *q1 = qa;
310  *q2 = qb;
311  *ci = middle1;
312  delete qc;
313  delete qd;
314  delete middle2;
315  delete end2;
316  return length1;
317  }
318  else
319  {
320  *cend = end2;
321  *q1 = qc;
322  *q2 = qd;
323  *ci = middle2;
324  delete qa;
325  delete qb;
326  delete middle1;
327  delete end1;
328  return length2;
329  }
330  return numeric_limits<double>::max();
331  }
332 };
333 
334 // ############################################################################
335 
336 CC0pm_Dubins_State_Space::CC0pm_Dubins_State_Space(double kappa, double sigma, double discretization, bool forwards)
337  : HC_CC_State_Space(kappa, sigma, discretization)
338  , forwards_(forwards)
339  , cc0pm_dubins_{ unique_ptr<CC0pm_Dubins>(new CC0pm_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  cc0pm_dubins_->distance = center_distance(c1, c2);
369  cc0pm_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 (cc0pm_dubins_->distance < get_epsilon())
379  {
380  cstart[cc_dubins::T] = new HC_CC_Circle(c1.start, c1.left, c1.forward, true, hc_cc_circle_param_);
381  length[cc_dubins::T] = cstart[cc_dubins::T]->hc_turn_length(c2.start);
382  goto label_end;
383  }
384  // case TT
385  if (cc0pm_dubins_->TT_exists(c1, c2))
386  {
387  length[cc_dubins::TT] = cc0pm_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 (cc0pm_dubins_->TST_exists(c1, c2))
393  {
394  length[cc_dubins::TST] = cc0pm_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 (cc0pm_dubins_->TTT_exists(c1, c2))
399  {
401  cc0pm_dubins_->TTT_path(c1, c2, &cstart[cc_dubins::TTT], &cend[cc_dubins::TTT], &qi1[cc_dubins::TTT],
402  &qi2[cc_dubins::TTT], &qi3[cc_dubins::TTT], &ci1[cc_dubins::TTT]);
403  }
404 label_end:
405  // select shortest path
408  path =
409  new CC_Dubins_Path(c1.start, c2.start, best_path, kappa_, sigma_, qi1[best_path], qi2[best_path], qi3[best_path],
410  nullptr, cstart[best_path], cend[best_path], ci1[best_path], nullptr, length[best_path]);
411 
412  // clean up
413  for (int i = 0; i < nb_cc_dubins_paths; i++)
414  {
415  if (i != best_path)
416  {
417  delete qi1[i];
418  delete qi2[i];
419  delete qi3[i];
420  delete cstart[i];
421  delete ci1[i];
422  delete cend[i];
423  }
424  }
425  return path;
426 }
427 
429 {
430  // compute the 2 circles at the intial and final configuration
431  Configuration start(state1.x, state1.y, state1.theta, 0.0);
432  Configuration end1(state2.x, state2.y, state2.theta, kappa_);
433  Configuration end2(state2.x, state2.y, state2.theta, -kappa_);
434 
435  HC_CC_Circle *start_circle[2];
436  HC_CC_Circle *end_circle[2];
437  if (forwards_)
438  {
439  start_circle[0] = new HC_CC_Circle(start, true, true, true, hc_cc_circle_param_);
440  start_circle[1] = new HC_CC_Circle(start, false, true, true, hc_cc_circle_param_);
441  end_circle[0] = new HC_CC_Circle(end1, true, false, true, rs_circle_param_);
442  end_circle[1] = new HC_CC_Circle(end2, false, false, true, rs_circle_param_);
443  }
444  else
445  {
446  start_circle[0] = new HC_CC_Circle(start, true, false, true, hc_cc_circle_param_);
447  start_circle[1] = new HC_CC_Circle(start, false, false, true, hc_cc_circle_param_);
448  end_circle[0] = new HC_CC_Circle(end1, true, true, true, rs_circle_param_);
449  end_circle[1] = new HC_CC_Circle(end2, false, true, true, rs_circle_param_);
450  }
451 
452  // compute the shortest path for the 4 combinations (2 circles at the beginning and 2 at the end)
453  CC_Dubins_Path *path[] = { nullptr, nullptr, nullptr, nullptr };
454 
455  double lg[] = { numeric_limits<double>::max(), numeric_limits<double>::max(), numeric_limits<double>::max(),
456  numeric_limits<double>::max() };
457 
458  for (int i = 0; i < 2; i++)
459  {
460  for (int j = 0; j < 2; j++)
461  {
462  // skip circle at the end for curvature continuity
463  if (j == 0 && state2.kappa < 0)
464  continue;
465  else if (j == 1 && state2.kappa > 0)
466  continue;
467  path[2 * i + j] = cc0pm_circles_dubins_path(*start_circle[i], *end_circle[j]);
468  if (path[2 * i + j])
469  {
470  lg[2 * i + j] = path[2 * i + j]->length;
471  }
472  }
473  }
474 
475  // select shortest path
476  int best_path = array_index_min(lg, 4);
477 
478  // // display calculations
479  // cout << endl << "CC0pm_Dubins_State_Space" << endl;
480  // for (int i = 0; i < 4; i++)
481  // {
482  // cout << i << ": ";
483  // if (path[i])
484  // {
485  // path[i]->print(true);
486  // cout << endl;
487  // }
488  // }
489  // cout << "shortest path: " << (int)best_path << endl;
490  // path[best_path]->print(true);
491 
492  // clean up
493  for (int i = 0; i < 2; i++)
494  {
495  delete start_circle[i];
496  delete end_circle[i];
497  }
498  for (int i = 0; i < 4; i++)
499  {
500  if (i != best_path)
501  {
502  delete path[i];
503  }
504  }
505  return path[best_path];
506 }
507 
508 double CC0pm_Dubins_State_Space::get_distance(const State &state1, const State &state2) const
509 {
510  CC_Dubins_Path *p = this->cc0pm_dubins(state1, state2);
511  double length = p->length;
512  delete p;
513  return length;
514 }
515 
516 vector<Control> CC0pm_Dubins_State_Space::get_controls(const State &state1, const State &state2) const
517 {
518  vector<Control> cc_dubins_controls;
519  cc_dubins_controls.reserve(8);
520  CC_Dubins_Path *p = this->cc0pm_dubins(state1, state2);
521  switch (p->type)
522  {
523  case cc_dubins::E:
524  empty_controls(cc_dubins_controls);
525  break;
526  case cc_dubins::T:
527  hc_turn_controls(*(p->cstart), p->end, true, cc_dubins_controls);
528  break;
529  case cc_dubins::TT:
530  cc_turn_controls(*(p->cstart), *(p->qi1), true, cc_dubins_controls);
531  hc_turn_controls(*(p->cend), *(p->qi2), true, cc_dubins_controls);
532  break;
533  // ##### Dubins families: #####################################################
534  case cc_dubins::TST:
535  cc_turn_controls(*(p->cstart), *(p->qi1), true, cc_dubins_controls);
536  straight_controls(*(p->qi1), *(p->qi2), cc_dubins_controls);
537  hc_turn_controls(*(p->cend), *(p->qi3), true, cc_dubins_controls);
538  break;
539  case cc_dubins::TTT:
540  cc_turn_controls(*(p->cstart), *(p->qi1), true, cc_dubins_controls);
541  cc_turn_controls(*(p->ci1), *(p->qi2), true, cc_dubins_controls);
542  hc_turn_controls(*(p->cend), *(p->qi3), true, cc_dubins_controls);
543  break;
544  default:
545  break;
546  }
547  delete p;
548  return cc_dubins_controls;
549 }
550 
551 } // 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::CC0pm_Dubins_State_Space
An implementation of continuous curvature (CC) steer for a Dubins car with zero curvature at the star...
Definition: cc0pm_dubins_state_space.hpp:69
steering::cc_dubins::TT
@ TT
Definition: paths.hpp:86
steering::State
Description of a kinematic car's state.
Definition: steering_functions.hpp:44
angle
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
steering::CC0pm_Dubins_State_Space::get_distance
double get_distance(const State &state1, const State &state2) const
Returns shortest path length from state1 to state2.
Definition: cc0pm_dubins_state_space.cpp:508
steering::CC0pm_Dubins_State_Space::CC0pm_Dubins::CC0pm_Dubins
CC0pm_Dubins(CC0pm_Dubins_State_Space *parent)
Definition: cc0pm_dubins_state_space.cpp:44
steering::HC_CC_State_Space::sigma_
double sigma_
Definition: hc_cc_state_space.hpp:95
steering::CC0pm_Dubins_State_Space::CC0pm_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: cc0pm_dubins_state_space.cpp:97
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::CC0pm_Dubins_State_Space::rs_circle_param_
HC_CC_Circle_Param rs_circle_param_
Parameter of a rs-circle.
Definition: cc0pm_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::CC0pm_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: cc0pm_dubins_state_space.cpp:516
steering::CC0pm_Dubins_State_Space::cc0pm_dubins
CC_Dubins_Path * cc0pm_dubins(const State &state1, const State &state2) const
Returns a sequence of turns and straight lines connecting a start and an end configuration.
Definition: cc0pm_dubins_state_space.cpp:428
steering::HC_CC_Circle
Definition: hc_cc_circle.hpp:80
steering::CC0pm_Dubins_State_Space::forwards_
bool forwards_
Driving direction.
Definition: cc0pm_dubins_state_space.hpp:115
steering::HC_CC_Circle_Param::cos_mu
double cos_mu
Definition: hc_cc_circle.hpp:97
steering::CC0pm_Dubins_State_Space::CC0pm_Dubins
Definition: cc0pm_dubins_state_space.cpp:38
steering::CC0pm_Dubins_State_Space::CC0pm_Dubins::TST_exists
bool TST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: cc0pm_dubins_state_space.cpp:136
steering::CC0pm_Dubins_State_Space::CC0pm_Dubins::TTT_exists
bool TTT_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: cc0pm_dubins_state_space.cpp:256
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::CC0pm_Dubins_State_Space::CC0pm_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, Configuration **q3, HC_CC_Circle **ci) const
Definition: cc0pm_dubins_state_space.cpp:289
steering::CC_Dubins_Path::qi3
Configuration * qi3
Definition: paths.hpp:114
steering::CC0pm_Dubins_State_Space::CC0pm_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: cc0pm_dubins_state_space.cpp:241
steering::CC0pm_Dubins_State_Space::CC0pm_Dubins::TeST_tangent_circles
void TeST_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
Definition: cc0pm_dubins_state_space.cpp:184
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
plot_statistics.CC0pm_Dubins
CC0pm_Dubins
Definition: plot_statistics.py:93
steering::CC0pm_Dubins_State_Space::CC0pm_Dubins::TiST_tangent_circles
void TiST_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
Definition: cc0pm_dubins_state_space.cpp:141
steering::HC_CC_Circle::yc
double yc
Definition: hc_cc_circle.hpp:132
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::CC0pm_Dubins_State_Space::cc0pm_circles_dubins_path
CC_Dubins_Path * cc0pm_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: cc0pm_dubins_state_space.cpp:348
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::CC0pm_Dubins_State_Space::CC0pm_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: cc0pm_dubins_state_space.cpp:231
steering::CC0pm_Dubins_State_Space::CC0pm_Dubins::TeST_exists
bool TeST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: cc0pm_dubins_state_space.cpp:123
steering::State::x
double x
Position in x of the robot.
Definition: steering_functions.hpp:64
steering::CC0pm_Dubins_State_Space::CC0pm_Dubins::TT_tangent_circles
void TT_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q) const
Definition: cc0pm_dubins_state_space.cpp:66
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::HC_CC_Circle_Param::sin_mu
double sin_mu
Sine and cosine of mu.
Definition: hc_cc_circle.hpp:97
steering::CC0pm_Dubins_State_Space::CC0pm_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: cc0pm_dubins_state_space.cpp:221
steering::HC_CC_State_Space
Definition: hc_cc_state_space.hpp:45
steering::CC0pm_Dubins_State_Space::cc0pm_dubins_
std::unique_ptr< CC0pm_Dubins > cc0pm_dubins_
Pimpl Idiom: unique pointer on class with families
Definition: cc0pm_dubins_state_space.hpp:118
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
start
ROSCPP_DECL void start()
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::CC0pm_Dubins_State_Space::CC0pm_Dubins::TiST_exists
bool TiST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: cc0pm_dubins_state_space.cpp:110
steering::get_epsilon
double get_epsilon()
Return value of epsilon.
Definition: utilities.cpp:57
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::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::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::CC0pm_Dubins_State_Space::CC0pm_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: cc0pm_dubins_state_space.cpp:269
steering::Configuration::y
double y
Definition: configuration.hpp:88
steering::CC0pm_Dubins_State_Space::CC0pm_Dubins::parent_
CC0pm_Dubins_State_Space * parent_
Definition: cc0pm_dubins_state_space.cpp:41
steering::CC_Dubins_Path
Definition: paths.hpp:96
HALF_PI
#define HALF_PI
Definition: utilities.hpp:32
steering::CC0pm_Dubins_State_Space::~CC0pm_Dubins_State_Space
~CC0pm_Dubins_State_Space()
Destructor.
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::end
Configuration end
Definition: paths.hpp:92
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
steering::CC0pm_Dubins_State_Space::CC0pm_Dubins::TT_exists
bool TT_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: cc0pm_dubins_state_space.cpp:53
utilities.hpp
steering::Configuration::theta
double theta
Orientation in rad between [0, 2*pi[.
Definition: configuration.hpp:91
cc0pm_dubins_state_space.hpp
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