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 
46  Configuration start, end;
47 
49  double kappa, sigma;
50 
52  double length;
53 };
54 
56 namespace cc_dubins
57 {
58 enum path_type
59 {
60  E,
61  S,
62  T,
63  TT,
64  // Dubins families:
65  TST,
66  TTT,
67  // #####################
68  TTTT
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 
83 
85  void print(bool eol) const;
86 
89 
92 
95 };
96 
98 namespace hc_cc_rs
99 {
100 enum path_type
101 {
102  E,
103  S,
104  T,
105  TT,
106  TcT,
107  // Reeds-Shepp families:
108  TcTcT,
109  TcTT,
110  TTcT,
112  TSTcT,
113  TcTST,
115  TTcTT,
116  TcTTcT,
117  // #####################
118  TTT,
119  TcST,
120  TScT,
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 
136 
138  void print(bool eol) const;
139 
142 
145 
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
steering::cc_dubins::TST
@ TST
Definition: paths.hpp:88
steering::hc_cc_rs::TTcT
@ TTcT
Definition: paths.hpp:133
steering::rs_turn_controls
void rs_turn_controls(const HC_CC_Circle &c, const Configuration &q, bool order, std::vector< Control > &controls)
Appends controls with a rs-turn.
steering::Path::length
double length
Path length.
Definition: paths.hpp:98
steering::hc_cc_rs::TcScT
@ TcScT
Definition: paths.hpp:144
steering::cc_dubins::TT
@ TT
Definition: paths.hpp:86
steering::State
Description of a kinematic car's state.
Definition: steering_functions.hpp:44
steering::HC_CC_RS_Path::type
hc_cc_rs::path_type type
Path type.
Definition: paths.hpp:164
steering::CC_Dubins_Path::cstart
HC_CC_Circle * cstart
Start, end and intermediate circles.
Definition: paths.hpp:117
steering::hc_cc_rs::TcTT
@ TcTT
Definition: paths.hpp:132
steering::hc_cc_rs::S
@ S
Definition: paths.hpp:126
steering::cc_dubins::path_type
path_type
Definition: paths.hpp:81
configuration.hpp
steering::HC_CC_RS_Path::cend
HC_CC_Circle * cend
Definition: paths.hpp:170
steering::empty_controls
void empty_controls(std::vector< Control > &controls)
Appends controls with 0 input.
steering::Path::sigma
double sigma
Definition: paths.hpp:95
steering::nb_cc_dubins_paths
const int nb_cc_dubins_paths
Definition: paths.hpp:94
steering::Path::kappa
double kappa
Max. curvature (unsigned), max. sharpness (unsigned)
Definition: paths.hpp:95
steering::CC_Dubins_Path::~CC_Dubins_Path
~CC_Dubins_Path()
Destructor.
Definition: paths.cpp:65
steering::hc_cc_rs::TcTTcT
@ TcTTcT
Definition: paths.hpp:139
steering::hc_cc_rs::TT
@ TT
Definition: paths.hpp:128
steering::HC_CC_Circle
Definition: hc_cc_circle.hpp:80
steering::hc_cc_rs::TScT
@ TScT
Definition: paths.hpp:143
steering::CC_Dubins_Path::print
void print(bool eol) const
Alphanumeric display.
Definition: paths.cpp:77
steering::cc_dubins::S
@ S
Definition: paths.hpp:84
steering::Control
Description of a path segment with its corresponding control inputs.
Definition: steering_functions.hpp:82
steering::CC_Dubins_Path::qi3
Configuration * qi3
Definition: paths.hpp:114
steering::hc_cc_rs::TST
@ TST
Definition: paths.hpp:134
steering::cc_dubins::TTT
@ TTT
Definition: paths.hpp:89
steering::state_equal
bool state_equal(const State &state1, const State &state2)
Checks whether two states are equal.
Definition: paths.cpp:263
steering::HC_CC_RS_Path::HC_CC_RS_Path
HC_CC_RS_Path(const Configuration &_start, const Configuration &_end, hc_cc_rs::path_type _type, double _kappa, double _sigma, Configuration *_qi1, Configuration *_qi2, Configuration *_qi3, Configuration *_qi4, HC_CC_Circle *_cstart, HC_CC_Circle *_cend, HC_CC_Circle *_ci1, HC_CC_Circle *_ci2, double _length)
Constructor.
Definition: paths.cpp:139
steering::HC_CC_RS_Path
Definition: paths.hpp:149
steering::hc_cc_rs::TcTcT
@ TcTcT
Definition: paths.hpp:131
steering::Path::Path
Path(const Configuration &_start, const Configuration &_end, double _kappa, double _sigma, double _length)
Constructor.
Definition: paths.cpp:39
steering::cc_dubins::E
@ E
Definition: paths.hpp:83
steering::CC_Dubins_Path::CC_Dubins_Path
CC_Dubins_Path(const Configuration &_start, const Configuration &_end, cc_dubins::path_type _type, double _kappa, double _sigma, Configuration *_qi1, Configuration *_qi2, Configuration *_qi3, Configuration *_qi4, HC_CC_Circle *_cstart, HC_CC_Circle *_cend, HC_CC_Circle *_ci1, HC_CC_Circle *_ci2, double _length)
Constructor.
Definition: paths.cpp:48
hc_cc_circle.hpp
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::reverse_control
void reverse_control(Control &control)
Reverses a control.
Definition: paths.cpp:274
steering::HC_CC_RS_Path::qi1
Configuration * qi1
Intermediate configurations.
Definition: paths.hpp:167
steering::hc_cc_rs::TTcTT
@ TTcTT
Definition: paths.hpp:138
steering::Path
Definition: paths.hpp:62
steering::HC_CC_RS_Path::ci1
HC_CC_Circle * ci1
Definition: paths.hpp:170
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.
steering::hc_cc_rs::TcTSTcT
@ TcTSTcT
Definition: paths.hpp:137
steering::cc_default_controls
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.
steering::cc_elementary_controls
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.
steering::Configuration
Definition: configuration.hpp:55
steering::HC_CC_RS_Path::qi3
Configuration * qi3
Definition: paths.hpp:167
steering::HC_CC_RS_Path::ci2
HC_CC_Circle * ci2
Definition: paths.hpp:170
steering::nb_hc_cc_rs_paths
const int nb_hc_cc_rs_paths
Definition: paths.hpp:147
steering::HC_CC_RS_Path::~HC_CC_RS_Path
~HC_CC_RS_Path()
Destructor.
Definition: paths.cpp:156
steering_functions.hpp
steering::CC_Dubins_Path::qi1
Configuration * qi1
Intermediate configurations.
Definition: paths.hpp:114
steering::hc_cc_rs::TcT
@ TcT
Definition: paths.hpp:129
steering::hc_cc_rs::TcTST
@ TcTST
Definition: paths.hpp:136
steering::hc_cc_rs::TTT
@ TTT
Definition: paths.hpp:141
steering::hc_cc_rs::E
@ E
Definition: paths.hpp:125
steering::CC_Dubins_Path::qi2
Configuration * qi2
Definition: paths.hpp:114
steering
Definition: dubins_state_space.hpp:70
steering::HC_CC_RS_Path::cstart
HC_CC_Circle * cstart
Start, end and intermediate circles.
Definition: paths.hpp:170
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::HC_CC_RS_Path::qi4
Configuration * qi4
Definition: paths.hpp:167
steering::cc_dubins::TTTT
@ TTTT
Definition: paths.hpp:91
steering::hc_cc_rs::path_type
path_type
Definition: paths.hpp:123
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::HC_CC_RS_Path::print
void print(bool eol) const
Alphanumeric display.
Definition: paths.cpp:168
steering::CC_Dubins_Path::ci2
HC_CC_Circle * ci2
Definition: paths.hpp:117
steering::subtract_control
Control subtract_control(const Control &control1, const Control &control2)
Subtracts control2 from control1.
Definition: paths.cpp:281
steering::hc_cc_rs::TcST
@ TcST
Definition: paths.hpp:142
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::CC_Dubins_Path::qi4
Configuration * qi4
Definition: paths.hpp:114
steering::hc_cc_rs::T
@ T
Definition: paths.hpp:127
steering::HC_CC_RS_Path::qi2
Configuration * qi2
Definition: paths.hpp:167
steering::hc_cc_rs::TSTcT
@ TSTcT
Definition: paths.hpp:135


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