paths.hpp
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 #ifndef PATHS_HPP
27 #define PATHS_HPP
28 
29 #include <numeric>
30 #include <vector>
31 
35 
36 namespace steering
37 {
38 
39 class Path
40 {
41 public:
43  Path(const Configuration &_start, const Configuration &_end, double _kappa, double _sigma, double _length);
44 
47 
49  double kappa, sigma;
50 
52  double length;
53 };
54 
56 namespace cc_dubins
57 {
59 {
60  E,
61  S,
62  T,
63  TT,
64  // Dubins families:
65  TST,
66  TTT,
67  // #####################
69 };
70 }
71 const int nb_cc_dubins_paths = 7;
72 
73 class CC_Dubins_Path : public Path
74 {
75 public:
77  CC_Dubins_Path(const Configuration &_start, const Configuration &_end, cc_dubins::path_type _type, double _kappa,
78  double _sigma, Configuration *_qi1, Configuration *_qi2, Configuration *_qi3, Configuration *_qi4,
79  HC_CC_Circle *_cstart, HC_CC_Circle *_cend, HC_CC_Circle *_ci1, HC_CC_Circle *_ci2, double _length);
80 
82  ~CC_Dubins_Path();
83 
85  void print(bool eol) const;
86 
89 
91  Configuration *qi1, *qi2, *qi3, *qi4;
92 
94  HC_CC_Circle *cstart, *cend, *ci1, *ci2;
95 };
96 
98 namespace hc_cc_rs
99 {
101 {
102  E,
103  S,
104  T,
105  TT,
107  // Reeds-Shepp families:
117  // #####################
122 };
123 }
124 const int nb_hc_cc_rs_paths = 18;
125 
126 class HC_CC_RS_Path : public Path
127 {
128 public:
130  HC_CC_RS_Path(const Configuration &_start, const Configuration &_end, hc_cc_rs::path_type _type, double _kappa,
131  double _sigma, Configuration *_qi1, Configuration *_qi2, Configuration *_qi3, Configuration *_qi4,
132  HC_CC_Circle *_cstart, HC_CC_Circle *_cend, HC_CC_Circle *_ci1, HC_CC_Circle *_ci2, double _length);
133 
135  ~HC_CC_RS_Path();
136 
138  void print(bool eol) const;
139 
142 
144  Configuration *qi1, *qi2, *qi3, *qi4;
145 
147  HC_CC_Circle *cstart, *cend, *ci1, *ci2;
148 };
149 
151 bool state_equal(const State &state1, const State &state2);
152 
154 void reverse_control(Control &control);
155 
157 Control subtract_control(const Control &control1, const Control &control2);
158 
160 void empty_controls(std::vector<Control> &controls);
161 
163 void straight_controls(const Configuration &q1, const Configuration &q2, std::vector<Control> &controls);
164 
166 void rs_turn_controls(const HC_CC_Circle &c, const Configuration &q, bool order, std::vector<Control> &controls);
167 
169 void hc_turn_controls(const HC_CC_Circle &c, const Configuration &q, bool order, std::vector<Control> &controls);
170 
172 bool cc_elementary_controls(const HC_CC_Circle &c, const Configuration &q, double delta, bool order,
173  std::vector<Control> &controls);
174 
176 void cc_default_controls(const HC_CC_Circle &c, const Configuration &q, double delta, bool order,
177  std::vector<Control> &controls);
178 
180 void cc_turn_controls(const HC_CC_Circle &c, const Configuration &q, bool order, std::vector<Control> &controls);
181 
182 } // namespace steering
183 
184 #endif
const int nb_hc_cc_rs_paths
Definition: paths.hpp:124
const int nb_cc_dubins_paths
Definition: paths.hpp:71
void cc_default_controls(const HC_CC_Circle &c, const Configuration &q, double delta, bool order, std::vector< Control > &controls)
Appends controls with a default cc-turn consisting of two clothoids and a circular arc...
void hc_turn_controls(const HC_CC_Circle &c, const Configuration &q, bool order, std::vector< Control > &controls)
Appends controls with a hc-turn.
void reverse_control(Control &control)
Reverses a control.
Definition: paths.cpp:274
void cc_turn_controls(const HC_CC_Circle &c, const Configuration &q, bool order, std::vector< Control > &controls)
Appends controls with a cc-turn.
Configuration start
Start and end configuration.
Definition: paths.hpp:46
ROSCONSOLE_DECL void print(FilterBase *filter, void *logger, Level level, const char *file, int line, const char *function, const char *fmt,...) ROSCONSOLE_PRINTF_ATTRIBUTE(7
HC_CC_Circle * cstart
Start, end and intermediate circles.
Definition: paths.hpp:94
Configuration * qi4
Definition: paths.hpp:144
HC_CC_Circle * cstart
Start, end and intermediate circles.
Definition: paths.hpp:147
void straight_controls(const Configuration &q1, const Configuration &q2, std::vector< Control > &controls)
Appends controls with a straight line.
Description of a path segment with its corresponding control inputs.
Control subtract_control(const Control &control1, const Control &control2)
Subtracts control2 from control1.
Definition: paths.cpp:281
bool state_equal(const State &state1, const State &state2)
Checks whether two states are equal.
Definition: paths.cpp:263
Configuration end
Definition: paths.hpp:46
double length
Path length.
Definition: paths.hpp:52
double kappa
Max. curvature (unsigned), max. sharpness (unsigned)
Definition: paths.hpp:49
cc_dubins::path_type type
Path type.
Definition: paths.hpp:88
hc_cc_rs::path_type type
Path type.
Definition: paths.hpp:141
Description of a kinematic car&#39;s state.
void rs_turn_controls(const HC_CC_Circle &c, const Configuration &q, bool order, std::vector< Control > &controls)
Appends controls with a rs-turn.
double sigma
Definition: paths.hpp:49
bool cc_elementary_controls(const HC_CC_Circle &c, const Configuration &q, double delta, bool order, std::vector< Control > &controls)
Appends controls with an elementary path if one exists.
Configuration * qi4
Definition: paths.hpp:91
void empty_controls(std::vector< Control > &controls)
Appends controls with 0 input.
Path(const Configuration &_start, const Configuration &_end, double _kappa, double _sigma, double _length)
Constructor.
Definition: paths.cpp:39


steering_functions
Author(s): Holger Banzhaf
autogenerated on Thu Aug 18 2022 02:09:46