GCC Code Coverage Report


Directory: ./
File: include/hpp/core/distance/reeds-shepp.hh
Date: 2024-12-13 16:14:03
Exec Total Coverage
Lines: 0 1 0.0%
Branches: 0 0 -%

Line Branch Exec Source
1 //
2 // Copyright (c) 2016 CNRS
3 // Authors: Florent Lamiraux
4 //
5
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are
8 // met:
9 //
10 // 1. Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 //
13 // 2. Redistributions in binary form must reproduce the above copyright
14 // notice, this list of conditions and the following disclaimer in the
15 // documentation and/or other materials provided with the distribution.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
28 // DAMAGE.
29
30 #ifndef HPP_CORE_DISTANCE_REEDS_SHEPP_HH
31 #define HPP_CORE_DISTANCE_REEDS_SHEPP_HH
32
33 #include <hpp/core/distance.hh>
34 #include <hpp/core/steering-method/fwd.hh>
35
36 namespace hpp {
37 namespace core {
38 namespace distance {
39 /// \addtogroup steering_method
40 /// \{
41
42 /// Reeds and Shepp distance
43 ///
44 /// Compute the distance between two configurations of a nonholonomic
45 /// cart-like mobile robot with bounded curvature.
46 class HPP_CORE_DLLAPI ReedsShepp : public Distance {
47 public:
48 virtual DistancePtr_t clone() const;
49 static ReedsSheppPtr_t create(const ProblemConstPtr_t& problem);
50 static ReedsSheppPtr_t create(const ProblemConstPtr_t& problem,
51 const value_type& turningRadius,
52 JointPtr_t xyJoint, JointPtr_t rzJoint,
53 std::vector<JointPtr_t> wheels);
54
55 static ReedsSheppPtr_t createCopy(const ReedsSheppPtr_t& distance);
56
57 void turningRadius(const value_type& rho);
58
59 inline value_type turningRadius() const { return rho_; }
60
61 protected:
62 ReedsShepp(const ProblemConstPtr_t& problem);
63 ReedsShepp(const ProblemConstPtr_t& problem, const value_type& turningRadius,
64 JointPtr_t xyJoint, JointPtr_t rzJoint,
65 std::vector<JointPtr_t> wheels);
66 ReedsShepp(const ReedsShepp& distance);
67
68 /// Derived class should implement this function
69 virtual value_type impl_distance(ConfigurationIn_t q1,
70 ConfigurationIn_t q2) const;
71 void init(const ReedsSheppWkPtr_t& weak);
72
73 private:
74 WeighedDistancePtr_t weighedDistance_;
75 DeviceWkPtr_t device_;
76 /// Turning radius
77 value_type rho_;
78 JointPtr_t xy_, rz_;
79 size_type xyId_, rzId_;
80 std::vector<JointPtr_t> wheels_;
81 ReedsSheppWkPtr_t weak_;
82
83 ReedsShepp() {};
84 HPP_SERIALIZABLE();
85 }; // class ReedsShepp
86 /// \}
87 } // namespace distance
88 } // namespace core
89 } // namespace hpp
90 #endif // HPP_CORE_DISTANCE_REEDS_SHEPP_HH
91