cc00_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, Configuration **q) const
98  {
99  TT_tangent_circles(c1, c2, q);
100  return c1.cc_turn_length(**q) + c2.cc_turn_length(**q);
101  }
102 
103  // ##### Dubins families: #####################################################
104 
105  // ##### TST ##################################################################
106  bool TiST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
107  {
108  if (c1.left == c2.left)
109  {
110  return false;
111  }
112  if (c1.forward == c2.forward)
113  {
114  return false;
115  }
116  return (distance >= 2 * c1.radius);
117  }
118 
119  bool TeST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
120  {
121  if (c1.left != c2.left)
122  {
123  return false;
124  }
125  if (c1.forward == c2.forward)
126  {
127  return false;
128  }
129  return (distance >= 2 * c1.radius * c1.sin_mu);
130  }
131 
132  bool TST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
133  {
134  return TiST_exists(c1, c2) || TeST_exists(c1, c2);
135  }
136 
138  Configuration **q2) const
139  {
140  double distance = center_distance(c1, c2);
141  double angle = atan2(c2.yc - c1.yc, c2.xc - c1.xc);
142  double alpha = asin(2 * c1.radius * c1.cos_mu / distance);
143  double delta_x = c1.radius * c1.sin_mu;
144  double delta_y = c1.radius * c1.cos_mu;
145  double x, y, theta;
146  if (c1.left && c1.forward)
147  {
148  theta = angle + alpha;
149  global_frame_change(c1.xc, c1.yc, theta, delta_x, -delta_y, &x, &y);
150  *q1 = new Configuration(x, y, theta, 0);
151  global_frame_change(c2.xc, c2.yc, theta, -delta_x, delta_y, &x, &y);
152  *q2 = new Configuration(x, y, theta, 0);
153  }
154  if (c1.left && !c1.forward)
155  {
156  theta = angle - alpha;
157  global_frame_change(c1.xc, c1.yc, theta, delta_x, delta_y, &x, &y);
158  *q1 = new Configuration(x, y, theta + PI, 0);
159  global_frame_change(c2.xc, c2.yc, theta, -delta_x, -delta_y, &x, &y);
160  *q2 = new Configuration(x, y, theta + PI, 0);
161  }
162  if (!c1.left && c1.forward)
163  {
164  theta = angle - alpha;
165  global_frame_change(c1.xc, c1.yc, theta, delta_x, delta_y, &x, &y);
166  *q1 = new Configuration(x, y, theta, 0);
167  global_frame_change(c2.xc, c2.yc, theta, -delta_x, -delta_y, &x, &y);
168  *q2 = new Configuration(x, y, theta, 0);
169  }
170  if (!c1.left && !c1.forward)
171  {
172  theta = angle + alpha;
173  global_frame_change(c1.xc, c1.yc, theta, delta_x, -delta_y, &x, &y);
174  *q1 = new Configuration(x, y, theta + PI, 0);
175  global_frame_change(c2.xc, c2.yc, theta, -delta_x, delta_y, &x, &y);
176  *q2 = new Configuration(x, y, theta + PI, 0);
177  }
178  }
179 
181  Configuration **q2) const
182  {
183  double delta_x = c1.radius * c1.sin_mu;
184  double delta_y = c1.radius * c1.cos_mu;
185  double theta = atan2(c2.yc - c1.yc, c2.xc - c1.xc);
186  double x, y;
187  if (c1.left && c1.forward)
188  {
189  global_frame_change(c1.xc, c1.yc, theta, delta_x, -delta_y, &x, &y);
190  *q1 = new Configuration(x, y, theta, 0);
191  global_frame_change(c2.xc, c2.yc, theta, -delta_x, -delta_y, &x, &y);
192  *q2 = new Configuration(x, y, theta, 0);
193  }
194  if (c1.left && !c1.forward)
195  {
196  global_frame_change(c1.xc, c1.yc, theta, delta_x, delta_y, &x, &y);
197  *q1 = new Configuration(x, y, theta + PI, 0);
198  global_frame_change(c2.xc, c2.yc, theta, -delta_x, delta_y, &x, &y);
199  *q2 = new Configuration(x, y, theta + PI, 0);
200  }
201  if (!c1.left && c1.forward)
202  {
203  global_frame_change(c1.xc, c1.yc, theta, delta_x, delta_y, &x, &y);
204  *q1 = new Configuration(x, y, theta, 0);
205  global_frame_change(c2.xc, c2.yc, theta, -delta_x, delta_y, &x, &y);
206  *q2 = new Configuration(x, y, theta, 0);
207  }
208  if (!c1.left && !c1.forward)
209  {
210  global_frame_change(c1.xc, c1.yc, theta, delta_x, -delta_y, &x, &y);
211  *q1 = new Configuration(x, y, theta + PI, 0);
212  global_frame_change(c2.xc, c2.yc, theta, -delta_x, -delta_y, &x, &y);
213  *q2 = new Configuration(x, y, theta + PI, 0);
214  }
215  }
216 
217  double TiST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
218  {
219  TiST_tangent_circles(c1, c2, q1, q2);
220  return c1.cc_turn_length(**q1) + configuration_distance(**q1, **q2) + c2.cc_turn_length(**q2);
221  }
222 
223  double TeST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
224  {
225  TeST_tangent_circles(c1, c2, q1, q2);
226  return c1.cc_turn_length(**q1) + configuration_distance(**q1, **q2) + c2.cc_turn_length(**q2);
227  }
228 
229  double TST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
230  {
231  if (TiST_exists(c1, c2))
232  {
233  return TiST_path(c1, c2, q1, q2);
234  }
235  if (TeST_exists(c1, c2))
236  {
237  return TeST_path(c1, c2, q1, q2);
238  }
239  return numeric_limits<double>::max();
240  }
241 
242  // ##### TTT ##################################################################
243  bool TTT_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
244  {
245  if (c1.left != c2.left)
246  {
247  return false;
248  }
249  if (c1.forward == c2.forward)
250  {
251  return false;
252  }
253  return distance <= 4 * c1.radius;
254  }
255 
257  Configuration **q3, Configuration **q4) const
258  {
259  double theta = angle;
260  double r = 2 * c1.radius;
261  double delta_x = 0.5 * distance;
262  double delta_y = sqrt(pow(r, 2) - pow(delta_x, 2));
263  double x, y;
264 
265  global_frame_change(c1.xc, c1.yc, theta, delta_x, delta_y, &x, &y);
266  HC_CC_Circle tgt1(x, y, !c1.left, c1.forward, c1.regular, parent_->hc_cc_circle_param_);
267  global_frame_change(c1.xc, c1.yc, theta, delta_x, -delta_y, &x, &y);
268  HC_CC_Circle tgt2(x, y, !c1.left, c1.forward, c1.regular, parent_->hc_cc_circle_param_);
269 
270  TT_tangent_circles(c1, tgt1, q1);
271  TT_tangent_circles(tgt1, c2, q2);
272  TT_tangent_circles(c1, tgt2, q3);
273  TT_tangent_circles(tgt2, c2, q4);
274  }
275 
276  double TTT_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2,
277  HC_CC_Circle **ci) const
278  {
279  Configuration *qa, *qb, *qc, *qd;
280  TTT_tangent_circles(c1, c2, &qa, &qb, &qc, &qd);
281  HC_CC_Circle *middle1, *middle2;
282  middle1 = new HC_CC_Circle(*qa, !c1.left, c1.forward, c1.regular, parent_->hc_cc_circle_param_);
283  middle2 = new HC_CC_Circle(*qc, !c1.left, c1.forward, c1.regular, parent_->hc_cc_circle_param_);
284 
285  // select shortest connection
286  double length1 = c1.cc_turn_length(*qa) + middle1->cc_turn_length(*qb) + c2.cc_turn_length(*qb);
287  double length2 = c1.cc_turn_length(*qc) + middle2->cc_turn_length(*qd) + c2.cc_turn_length(*qd);
288  if (length1 < length2)
289  {
290  *q1 = qa;
291  *q2 = qb;
292  *ci = middle1;
293  delete qc;
294  delete qd;
295  delete middle2;
296  return length1;
297  }
298  else
299  {
300  *q1 = qc;
301  *q2 = qd;
302  *ci = middle2;
303  delete qa;
304  delete qb;
305  delete middle1;
306  return length2;
307  }
308  return numeric_limits<double>::max();
309  }
310 };
311 
312 // ############################################################################
313 
314 CC00_Dubins_State_Space::CC00_Dubins_State_Space(double kappa, double sigma, double discretization, bool forwards)
315  : HC_CC_State_Space(kappa, sigma, discretization)
316  , forwards_(forwards)
317  , cc00_dubins_{ unique_ptr<CC00_Dubins>(new CC00_Dubins(this)) }
318 {
319 }
320 
322 
324 {
325  // table containing the lengths of the paths, the intermediate configurations and circles
326  double length[nb_cc_dubins_paths];
327  double_array_init(length, nb_cc_dubins_paths, numeric_limits<double>::max());
329  pointer_array_init((void **)qi1, nb_cc_dubins_paths);
331  pointer_array_init((void **)qi2, nb_cc_dubins_paths);
333  pointer_array_init((void **)cstart, nb_cc_dubins_paths);
335  pointer_array_init((void **)ci1, nb_cc_dubins_paths);
337  pointer_array_init((void **)cend, nb_cc_dubins_paths);
338 
339  // precomputations
340  cc00_dubins_->distance = center_distance(c1, c2);
341  cc00_dubins_->angle = atan2(c2.yc - c1.yc, c2.xc - c1.xc);
342 
343  // case E
344  if (configuration_equal(c1.start, c2.start))
345  {
346  length[cc_dubins::E] = 0;
347  goto label_end;
348  }
349  // case S forwards
351  {
353  goto label_end;
354  }
355  // case S backwards
356  if (!forwards_ && configuration_aligned(c2.start, c1.start))
357  {
359  goto label_end;
360  }
361  // case T
363  {
364  cstart[cc_dubins::T] = new HC_CC_Circle(c1);
365  length[cc_dubins::T] = cstart[cc_dubins::T]->cc_turn_length(c2.start);
366  goto label_end;
367  }
368  // case TT
369  if (cc00_dubins_->TT_exists(c1, c2))
370  {
371  cstart[cc_dubins::TT] = new HC_CC_Circle(c1);
372  cend[cc_dubins::TT] = new HC_CC_Circle(c2);
373  length[cc_dubins::TT] = cc00_dubins_->TT_path(*cstart[cc_dubins::TT], *cend[cc_dubins::TT], &qi1[cc_dubins::TT]);
374  }
375  // ##### Dubins families: ######################################################
376  // case TST
377  if (cc00_dubins_->TST_exists(c1, c2))
378  {
379  cstart[cc_dubins::TST] = new HC_CC_Circle(c1);
380  cend[cc_dubins::TST] = new HC_CC_Circle(c2);
381  length[cc_dubins::TST] = cc00_dubins_->TST_path(*cstart[cc_dubins::TST], *cend[cc_dubins::TST],
382  &qi1[cc_dubins::TST], &qi2[cc_dubins::TST]);
383  }
384  // case TTT
385  if (cc00_dubins_->TTT_exists(c1, c2))
386  {
387  cstart[cc_dubins::TTT] = new HC_CC_Circle(c1);
388  cend[cc_dubins::TTT] = new HC_CC_Circle(c2);
389  length[cc_dubins::TTT] = cc00_dubins_->TTT_path(*cstart[cc_dubins::TTT], *cend[cc_dubins::TTT],
390  &qi1[cc_dubins::TTT], &qi2[cc_dubins::TTT], &ci1[cc_dubins::TTT]);
391  }
392 label_end:
393  // select shortest path
396  path = new CC_Dubins_Path(c1.start, c2.start, best_path, kappa_, sigma_, qi1[best_path], qi2[best_path], nullptr,
397  nullptr, cstart[best_path], cend[best_path], ci1[best_path], nullptr, length[best_path]);
398 
399  // clean up
400  for (int i = 0; i < nb_cc_dubins_paths; i++)
401  {
402  if (i != best_path)
403  {
404  delete qi1[i];
405  delete qi2[i];
406  delete cstart[i];
407  delete ci1[i];
408  delete cend[i];
409  }
410  }
411  return path;
412 }
413 
415 {
416  // compute the 2 circles at the intial and final configuration
417  Configuration start(state1.x, state1.y, state1.theta, 0.0);
418  Configuration end(state2.x, state2.y, state2.theta, 0.0);
419 
420  HC_CC_Circle *start_circle[2];
421  HC_CC_Circle *end_circle[2];
422  if (forwards_)
423  {
424  start_circle[0] = new HC_CC_Circle(start, true, true, true, hc_cc_circle_param_);
425  start_circle[1] = new HC_CC_Circle(start, false, true, true, hc_cc_circle_param_);
426  end_circle[0] = new HC_CC_Circle(end, true, false, true, hc_cc_circle_param_);
427  end_circle[1] = new HC_CC_Circle(end, false, false, true, hc_cc_circle_param_);
428  }
429  else
430  {
431  start_circle[0] = new HC_CC_Circle(start, true, false, true, hc_cc_circle_param_);
432  start_circle[1] = new HC_CC_Circle(start, false, false, true, hc_cc_circle_param_);
433  end_circle[0] = new HC_CC_Circle(end, true, true, true, hc_cc_circle_param_);
434  end_circle[1] = new HC_CC_Circle(end, false, true, true, hc_cc_circle_param_);
435  }
436 
437  // compute the shortest path for the 4 combinations (2 circles at the beginning and 2 at the end)
438  CC_Dubins_Path *path[] = { nullptr, nullptr, nullptr, nullptr };
439 
440  double lg[] = { numeric_limits<double>::max(), numeric_limits<double>::max(), numeric_limits<double>::max(),
441  numeric_limits<double>::max() };
442 
443  for (int i = 0; i < 2; i++)
444  {
445  for (int j = 0; j < 2; j++)
446  {
447  path[2 * i + j] = cc00_circles_dubins_path(*start_circle[i], *end_circle[j]);
448  if (path[2 * i + j])
449  {
450  lg[2 * i + j] = path[2 * i + j]->length;
451  }
452  }
453  }
454 
455  // select shortest path
456  int best_path = array_index_min(lg, 4);
457 
458  // // display calculations
459  // cout << endl << "CC00_Dubins_State_Space" << endl;
460  // for (int i = 0; i < 4; i++)
461  // {
462  // cout << i << ": ";
463  // if (path[i])
464  // {
465  // path[i]->print(true);
466  // cout << endl;
467  // }
468  // }
469  // cout << "shortest path: " << (int)best_path << endl;
470  // path[best_path]->print(true);
471 
472  // clean up
473  for (int i = 0; i < 2; i++)
474  {
475  delete start_circle[i];
476  delete end_circle[i];
477  }
478  for (int i = 0; i < 4; i++)
479  {
480  if (i != best_path)
481  {
482  delete path[i];
483  }
484  }
485  return path[best_path];
486 }
487 
488 double CC00_Dubins_State_Space::get_distance(const State &state1, const State &state2) const
489 {
490  CC_Dubins_Path *p = this->cc00_dubins(state1, state2);
491  double length = p->length;
492  delete p;
493  return length;
494 }
495 
496 vector<Control> CC00_Dubins_State_Space::get_controls(const State &state1, const State &state2) const
497 {
498  vector<Control> cc_dubins_controls;
499  cc_dubins_controls.reserve(9);
500  CC_Dubins_Path *p = this->cc00_dubins(state1, state2);
501  switch (p->type)
502  {
503  case cc_dubins::E:
504  empty_controls(cc_dubins_controls);
505  break;
506  case cc_dubins::S:
507  straight_controls(p->start, p->end, cc_dubins_controls);
508  break;
509  case cc_dubins::T:
510  cc_turn_controls(*(p->cstart), p->end, true, cc_dubins_controls);
511  break;
512  case cc_dubins::TT:
513  cc_turn_controls(*(p->cstart), *(p->qi1), true, cc_dubins_controls);
514  cc_turn_controls(*(p->cend), *(p->qi1), false, cc_dubins_controls);
515  break;
516  // ##### Dubins families: #####################################################
517  case cc_dubins::TST:
518  cc_turn_controls(*(p->cstart), *(p->qi1), true, cc_dubins_controls);
519  straight_controls(*(p->qi1), *(p->qi2), cc_dubins_controls);
520  cc_turn_controls(*(p->cend), *(p->qi2), false, cc_dubins_controls);
521  break;
522  case cc_dubins::TTT:
523  cc_turn_controls(*(p->cstart), *(p->qi1), true, cc_dubins_controls);
524  cc_turn_controls(*(p->ci1), *(p->qi2), true, cc_dubins_controls);
525  cc_turn_controls(*(p->cend), *(p->qi2), false, cc_dubins_controls);
526  break;
527  default:
528  break;
529  }
530  delete p;
531  return cc_dubins_controls;
532 }
533 
534 } // namespace steering
steering::cc_dubins::TST
@ TST
Definition: paths.hpp:88
steering::CC00_Dubins_State_Space::cc00_circles_dubins_path
CC_Dubins_Path * cc00_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: cc00_dubins_state_space.cpp:323
plot_states.alpha
alpha
Definition: plot_states.py:107
steering::CC00_Dubins_State_Space::CC00_Dubins::TeST_tangent_circles
void TeST_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
Definition: cc00_dubins_state_space.cpp:180
steering::CC00_Dubins_State_Space
An implementation of continuous curvature (CC) steer for a Dubins car with zero curvature at the star...
Definition: cc00_dubins_state_space.hpp:70
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::cc_dubins::TT
@ TT
Definition: paths.hpp:86
steering::State
Description of a kinematic car's state.
Definition: steering_functions.hpp:44
steering::CC00_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: cc00_dubins_state_space.cpp:496
angle
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
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::CC00_Dubins_State_Space::CC00_Dubins::TST_exists
bool TST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: cc00_dubins_state_space.cpp:132
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::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::CC00_Dubins_State_Space::CC00_Dubins::TT_path
double TT_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q) const
Definition: cc00_dubins_state_space.cpp:97
steering::CC00_Dubins_State_Space::cc00_dubins
CC_Dubins_Path * cc00_dubins(const State &state1, const State &state2) const
Returns a sequence of turns and straight lines connecting a start and an end configuration.
Definition: cc00_dubins_state_space.cpp:414
steering::HC_CC_Circle
Definition: hc_cc_circle.hpp:80
steering::CC00_Dubins_State_Space::CC00_Dubins::CC00_Dubins
CC00_Dubins(CC00_Dubins_State_Space *parent)
Definition: cc00_dubins_state_space.cpp:44
steering::CC00_Dubins_State_Space::CC00_Dubins::TiST_tangent_circles
void TiST_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
Definition: cc00_dubins_state_space.cpp:137
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::cc_dubins::S
@ S
Definition: paths.hpp:84
steering::CC00_Dubins_State_Space::CC00_Dubins::TiST_exists
bool TiST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: cc00_dubins_state_space.cpp:106
steering::CC00_Dubins_State_Space::CC00_Dubins::TTT_path
double TTT_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2, HC_CC_Circle **ci) const
Definition: cc00_dubins_state_space.cpp:276
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::CC00_Dubins_State_Space::CC00_Dubins::TT_tangent_circles
void TT_tangent_circles(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q) const
Definition: cc00_dubins_state_space.cpp:66
steering::CC00_Dubins_State_Space::CC00_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: cc00_dubins_state_space.cpp:256
steering::CC00_Dubins_State_Space::CC00_Dubins::parent_
CC00_Dubins_State_Space * parent_
Definition: cc00_dubins_state_space.cpp:41
steering::HC_CC_Circle::yc
double yc
Definition: hc_cc_circle.hpp:132
steering::CC00_Dubins_State_Space::CC00_Dubins::TeST_path
double TeST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
Definition: cc00_dubins_state_space.cpp:223
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::CC00_Dubins_State_Space::forwards_
bool forwards_
Driving direction.
Definition: cc00_dubins_state_space.hpp:116
steering::CC00_Dubins_State_Space::~CC00_Dubins_State_Space
~CC00_Dubins_State_Space()
Destructor.
steering::HC_CC_Circle::forward
bool forward
Driving direction: forwards/backwards.
Definition: hc_cc_circle.hpp:126
steering::CC00_Dubins_State_Space::CC00_Dubins::TiST_path
double TiST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
Definition: cc00_dubins_state_space.cpp:217
steering::CC00_Dubins_State_Space::cc00_dubins_
std::unique_ptr< CC00_Dubins > cc00_dubins_
Pimpl Idiom: unique pointer on class with families
Definition: cc00_dubins_state_space.hpp:119
steering::State::x
double x
Position in x of the robot.
Definition: steering_functions.hpp:64
steering::CC00_Dubins_State_Space::CC00_Dubins::TST_path
double TST_path(const HC_CC_Circle &c1, const HC_CC_Circle &c2, Configuration **q1, Configuration **q2) const
Definition: cc00_dubins_state_space.cpp:229
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::CC00_Dubins_State_Space::CC00_Dubins::TT_exists
bool TT_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: cc00_dubins_state_space.cpp:53
steering::CC00_Dubins_State_Space::CC00_Dubins::TTT_exists
bool TTT_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: cc00_dubins_state_space.cpp:243
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::CC00_Dubins_State_Space::CC00_Dubins
Definition: cc00_dubins_state_space.cpp:38
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::CC00_Dubins_State_Space::CC00_Dubins::TeST_exists
bool TeST_exists(const HC_CC_Circle &c1, const HC_CC_Circle &c2) const
Definition: cc00_dubins_state_space.cpp:119
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::CC00_Dubins_State_Space::get_distance
double get_distance(const State &state1, const State &state2) const
Returns shortest path length from state1 to state2.
Definition: cc00_dubins_state_space.cpp:488
plot_statistics.CC00_Dubins
CC00_Dubins
Definition: plot_statistics.py:92
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
std
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.
cc00_dubins_state_space.hpp
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
steering::configuration_aligned
bool configuration_aligned(const Configuration &q1, const Configuration &q2)
Are two configurations aligned?
Definition: configuration.cpp:59
PI
#define PI
Definition: utilities.hpp:31
steering::configuration_on_hc_cc_circle
bool configuration_on_hc_cc_circle(const HC_CC_Circle &c, const Configuration &q)
Configuration on the circle?
Definition: hc_cc_circle.cpp:312
steering::configuration_equal
bool configuration_equal(const Configuration &q1, const Configuration &q2)
Are two configurations equal?
Definition: configuration.cpp:69
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::Path::end
Configuration end
Definition: paths.hpp:92
steering::HC_CC_Circle::start
Configuration start
Start configuration.
Definition: hc_cc_circle.hpp:120
utilities.hpp


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