cheshirekow  v0.1.0
two_theta_y.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of mpblocks.
5  *
6  * mpblocks is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * mpblocks is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with mpblocks. If not, see <http://www.gnu.org/licenses/>.
18  */
26 #ifndef MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_TWO_THETA_Y_H_
27 #define MPBLOCKS_DUBINS_CURVES_EIGEN_HYPER_TWO_THETA_Y_H_
28 
36 
37 namespace mpblocks {
38 namespace dubins {
39 namespace curves_eigen {
40 namespace hyper {
41 namespace two_theta_y {
42 
44 template <int ySpec, int tSpec, typename Format_t>
45 struct HelperWrap {
47  template <int... List>
48  struct SolverIterator {};
49 
50  template <int First, int... List>
51  struct SolverIterator<First, List...> {
52  typedef Eigen::Matrix<Format_t, 3, 1> Vector3d_t;
53  typedef Eigen::Matrix<Format_t, 2, 1> Vector2d_t;
56 
58 
59  static Result_t solve(const Vector3d_t& q0, const Hyper_t& h,
60  const Format_t r) {
61  return bestOf(Solver_t::solve(q0, h, r),
62  SolverIterator<List...>::solve(q0, h, r), r);
63  };
64  };
65 
66  template <int Last>
67  struct SolverIterator<Last> {
68  typedef Eigen::Matrix<Format_t, 3, 1> Vector3d_t;
69  typedef Eigen::Matrix<Format_t, 2, 1> Vector2d_t;
72 
74 
75  static Result_t solve(const Vector3d_t& q0, const Hyper_t& h,
76  const Format_t r) {
77  return Solver_t::solve(q0, h, r);
78  };
79  };
80 
82 };
83 
84 } // namespace two_theta_y
85 
87 template <int ySpec, int tSpec, typename Format_t>
88 struct Solver<OFF, ySpec, tSpec, Format_t> {
89  typedef Eigen::Matrix<Format_t, 3, 1> Vector3d_t;
90  typedef Eigen::Matrix<Format_t, 2, 1> Vector2d_t;
93 
96 
97  static Result_t solve(const Vector3d_t& q0, const Hyper_t& h,
98  const Format_t r) {
99  return Iterator::solve(q0, h, r);
100  };
101 };
102 
103 } // namespace hyper
104 } // namespace curves_eigen
105 } // namespace dubins
106 } // namespace mpblocks
107 
108 #endif // TWO_X_Y_H_
the default solver is instantated when not all three constraints are active and it simply dispatches ...
Definition: Solver.hpp:95
static Result_t solve(const Vector3d_t &q0, const Hyper_t &h, const Format_t r)
Definition: two_theta_y.hpp:75
SolverIterator< LSL, LSR, RSL, RSR, LRLa, RLRa > SolverIterator_t
Definition: two_theta_y.hpp:81
interface for variants of solvers, default template is never instantiated
Definition: Solver.hpp:41
A hyper-rectangle in dubins space: A rectangular prism in R^3.
Definition: hyper_rect.h:44
wraps structures and accessors for the specific ySpec and tSpec
Definition: two_theta_y.hpp:45
static Result_t solve(const Vector3d_t &q0, const Hyper_t &h, const Format_t r)
Definition: two_theta_y.hpp:59
Encodes a dubins path primitive, which is three connected arc segments.
Definition: path.h:42
two_theta_y::HelperWrap< ySpec, tSpec, Format_t > Helper
Definition: two_theta_y.hpp:94
Path< Format_t > bestOf(const Path< Format_t > &r0, const Path< Format_t > &r1, const Format_t r)
Definition: path.h:96
static Result_t solve(const Vector3d_t &q0, const Hyper_t &h, const Format_t r)
Definition: two_theta_y.hpp:97
Path< Format_t > solve(const Eigen::Matrix< Format_t, 3, 1 > &q0, const HyperRect< Format_t > &h, const Format_t r)