Directory: | ./ |
---|---|
File: | include/pinocchio/parsers/mjcf/geometry.hxx |
Date: | 2025-02-12 21:03:38 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 7 | 7 | 100.0% |
Branches: | 4 | 8 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | // | ||
2 | // Copyright (c) 2016-2024 CNRS INRIA | ||
3 | // | ||
4 | |||
5 | #ifndef __pinocchio_parsers_mjcf_geometry_hxx__ | ||
6 | #define __pinocchio_parsers_mjcf_geometry_hxx__ | ||
7 | |||
8 | #include "pinocchio/parsers/mjcf.hpp" | ||
9 | #include "pinocchio/parsers/mjcf/mjcf-graph.hpp" | ||
10 | |||
11 | namespace pinocchio | ||
12 | { | ||
13 | namespace mjcf | ||
14 | { | ||
15 | template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl> | ||
16 | 7 | GeometryModel & buildGeom( | |
17 | ModelTpl<Scalar, Options, JointCollectionTpl> & model, | ||
18 | const std::string & filename, | ||
19 | const GeometryType type, | ||
20 | GeometryModel & geomModel, | ||
21 | ::hpp::fcl::MeshLoaderPtr meshLoader) | ||
22 | { | ||
23 |
1/2✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
|
7 | ::pinocchio::urdf::details::UrdfVisitor<Scalar, Options, JointCollectionTpl> visitor(model); |
24 | |||
25 | typedef ::pinocchio::mjcf::details::MjcfGraph MjcfGraph; | ||
26 | |||
27 |
1/2✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
|
7 | MjcfGraph graph(visitor, filename); |
28 | |||
29 |
1/2✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
|
7 | graph.parseGraphFromXML(filename); |
30 | |||
31 | // Use the Mjcf graph to create the geometry model | ||
32 |
1/2✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
|
7 | graph.parseGeomTree(type, geomModel, meshLoader); |
33 | |||
34 | 7 | return geomModel; | |
35 | 7 | } | |
36 | } // namespace mjcf | ||
37 | } // namespace pinocchio | ||
38 | |||
39 | #endif | ||
40 |