GCC Code Coverage Report


Directory: ./
File: src/steering-method/straight.cc
Date: 2024-08-10 11:29:48
Exec Total Coverage
Lines: 11 11 100.0%
Branches: 20 34 58.8%

Line Branch Exec Source
1 // Copyright (c) 2019 CNRS
2 // Authors: Joseph Mirabel
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/config-projector.hh>
30 #include <hpp/core/distance.hh>
31 #include <hpp/core/problem.hh>
32 #include <hpp/core/steering-method/straight.hh>
33 #include <hpp/core/straight-path.hh>
34
35 namespace hpp {
36 namespace core {
37 namespace steeringMethod {
38 4102 PathPtr_t Straight::impl_compute(ConfigurationIn_t q1,
39 ConfigurationIn_t q2) const {
40
3/6
✓ Branch 5 taken 4102 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 4102 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 4102 times.
✗ Branch 12 not taken.
4102 value_type length = (*problem()->distance())(q1, q2);
41 4102 ConstraintSetPtr_t c;
42
9/12
✓ Branch 2 taken 158 times.
✓ Branch 3 taken 3944 times.
✓ Branch 7 taken 158 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 64 times.
✓ Branch 11 taken 94 times.
✓ Branch 12 taken 158 times.
✓ Branch 13 taken 3944 times.
✓ Branch 15 taken 64 times.
✓ Branch 16 taken 4038 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
4102 if (constraints() && constraints()->configProjector()) {
43
1/2
✓ Branch 3 taken 64 times.
✗ Branch 4 not taken.
64 c = HPP_STATIC_PTR_CAST(ConstraintSet, constraints()->copy());
44
3/6
✓ Branch 2 taken 64 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 64 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 64 times.
✗ Branch 10 not taken.
64 c->configProjector()->rightHandSideFromConfig(q1);
45
1/2
✓ Branch 2 taken 64 times.
✗ Branch 3 not taken.
64 c->configProjector()->lineSearchType(ConfigProjector::Backtracking);
46 } else {
47 4038 c = constraints();
48 }
49
3/6
✓ Branch 2 taken 4102 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 4102 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 4102 times.
✗ Branch 12 not taken.
8204 PathPtr_t path = StraightPath::create(problem()->robot(), q1, q2, length, c);
50 8204 return path;
51 4102 }
52 } // namespace steeringMethod
53 } // namespace core
54 } // namespace hpp
55