GCC Code Coverage Report


Directory: ./
File: src/steering-method/dubins.cc
Date: 2024-08-10 11:29:48
Exec Total Coverage
Lines: 0 18 0.0%
Branches: 0 38 0.0%

Line Branch Exec Source
1 // Copyright (c) 2017, CNRS
2 // Authors: Florent Lamiraux
3 //
4
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // 1. Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27 // DAMAGE.
28
29 #include <hpp/core/distance.hh>
30 #include <hpp/core/dubins-path.hh>
31 #include <hpp/core/problem.hh>
32 #include <hpp/core/steering-method/dubins.hh>
33 #include <hpp/pinocchio/device.hh>
34 #include <hpp/pinocchio/joint.hh>
35
36 namespace hpp {
37 namespace core {
38 namespace steeringMethod {
39 PathPtr_t Dubins::impl_compute(ConfigurationIn_t q1,
40 ConfigurationIn_t q2) const {
41 Configuration_t qEnd(q2);
42 qEnd.segment<2>(xyId_) = q1.segment<2>(xyId_);
43 qEnd.segment<2>(rzId_) = q1.segment<2>(rzId_);
44 // Do not take into account wheel joints in additional distance.
45 for (std::vector<JointPtr_t>::const_iterator it = wheels_.begin();
46 it != wheels_.end(); ++it) {
47 size_type i = (*it)->rankInConfiguration();
48 qEnd[i] = q1[i];
49 }
50 // The length corresponding to the non RS DoF
51 DistancePtr_t d(problem()->distance());
52 value_type extraL = (*d)(q1, qEnd);
53 DubinsPathPtr_t path =
54 DubinsPath::create(device_.lock(), q1, q2, extraL, rho_, xyId_, rzId_,
55 wheels_, constraints());
56 return path;
57 }
58
59 Dubins::Dubins(const ProblemConstPtr_t& problem) : CarLike(problem), weak_() {}
60
61 Dubins::Dubins(const ProblemConstPtr_t& problem, const value_type turningRadius,
62 JointPtr_t xyJoint, JointPtr_t rzJoint,
63 std::vector<JointPtr_t> wheels)
64 : CarLike(problem, turningRadius, xyJoint, rzJoint, wheels) {}
65
66 /// Copy constructor
67 Dubins::Dubins(const Dubins& other) : CarLike(other) {}
68
69 } // namespace steeringMethod
70 } // namespace core
71 } // namespace hpp
72