Directory: | ./ |
---|---|
File: | src/path-validation.cc |
Date: | 2024-12-13 16:14:03 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 9 | 9 | 100.0% |
Branches: | 8 | 14 | 57.1% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // | ||
2 | // Copyright (c) 2022 CNRS Airbus S.A.S. | ||
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 | #include <hpp/core/path-validation.hh> | ||
31 | #include <hpp/core/straight-path.hh> | ||
32 | #include <hpp/pinocchio/liegroup-space.hh> | ||
33 | |||
34 | namespace hpp { | ||
35 | namespace core { | ||
36 | 200 | bool PathValidation::validate(ConfigurationIn_t q, | |
37 | ValidationReportPtr_t& report) { | ||
38 | // Create a straight path of length 0 with the configuration. | ||
39 | // The output space does not matter here since no Liegroup operation | ||
40 | // will be performed. Thus, we use Rn. | ||
41 | StraightPathPtr_t p( | ||
42 |
1/2✓ Branch 2 taken 200 times.
✗ Branch 3 not taken.
|
400 | StraightPath::create(LiegroupSpace::Rn(q.size()), q, q, |
43 |
4/8✓ Branch 2 taken 200 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 200 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 200 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 200 times.
✗ Branch 12 not taken.
|
600 | std::make_pair<value_type, value_type>(0, 0))); |
44 | 200 | PathPtr_t unused; | |
45 | 200 | PathValidationReportPtr_t r; | |
46 |
1/2✓ Branch 2 taken 200 times.
✗ Branch 3 not taken.
|
200 | bool res(this->validate(p, false, unused, r)); |
47 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 2 taken 178 times.
|
200 | if (r) report = r->configurationReport; |
48 | 200 | return res; | |
49 | 200 | } | |
50 | } // namespace core | ||
51 | } // namespace hpp | ||
52 |