GCC Code Coverage Report | |||||||||||||||||||||
|
|||||||||||||||||||||
Line | Branch | Exec | Source |
1 |
// |
||
2 |
// Copyright (c) 2015-2020 CNRS INRIA |
||
3 |
// |
||
4 |
|||
5 |
#include "pinocchio/multibody/model.hpp" |
||
6 |
|||
7 |
namespace pinocchio |
||
8 |
{ |
||
9 |
|||
10 |
template<typename D> |
||
11 |
234 |
void addJointAndBody(Model & model, |
|
12 |
const JointModelBase<D> & jmodel, |
||
13 |
const Model::JointIndex parent_id, |
||
14 |
const SE3 & joint_placement, |
||
15 |
const std::string & name, |
||
16 |
const Inertia & Y) |
||
17 |
{ |
||
18 |
Model::JointIndex idx; |
||
19 |
typedef typename D::TangentVector_t TV; |
||
20 |
typedef typename D::ConfigVector_t CV; |
||
21 |
|||
22 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗ |
936 |
idx = model.addJoint(parent_id,jmodel,joint_placement, |
23 |
name + "_joint", |
||
24 |
TV::Zero(), |
||
25 |
✓✗ | 468 |
1e3 * (TV::Random() + TV::Constant(1)), |
26 |
✓✗ | 468 |
1e3 * (CV::Random() - CV::Constant(1)), |
27 |
✓✗ | 234 |
1e3 * (CV::Random() + CV::Constant(1)) |
28 |
); |
||
29 |
|||
30 |
✓✗ | 234 |
model.appendBodyToJoint(idx,Y,SE3::Identity()); |
31 |
234 |
} |
|
32 |
|||
33 |
13 |
void buildAllJointsModel(Model & model) |
|
34 |
{ |
||
35 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
13 |
addJointAndBody(model,JointModelFreeFlyer(),model.getJointId("universe"),SE3::Identity(),"freeflyer",Inertia::Random()); |
36 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
13 |
addJointAndBody(model,JointModelSpherical(),model.getJointId("freeflyer_joint"),SE3::Identity(),"spherical",Inertia::Random()); |
37 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
13 |
addJointAndBody(model,JointModelPlanar(),model.getJointId("spherical_joint"),SE3::Identity(),"planar",Inertia::Random()); |
38 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
13 |
addJointAndBody(model,JointModelRX(),model.getJointId("planar_joint"),SE3::Identity(),"rx",Inertia::Random()); |
39 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
13 |
addJointAndBody(model,JointModelPX(),model.getJointId("rx_joint"),SE3::Identity(),"px",Inertia::Random()); |
40 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗ |
13 |
addJointAndBody(model,JointModelPrismaticUnaligned(SE3::Vector3(1,0,0)),model.getJointId("px_joint"),SE3::Identity(),"pu",Inertia::Random()); |
41 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ ✓✗ |
13 |
addJointAndBody(model,JointModelRevoluteUnaligned(SE3::Vector3(0,0,1)),model.getJointId("pu_joint"),SE3::Identity(),"ru",Inertia::Random()); |
42 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
13 |
addJointAndBody(model,JointModelSphericalZYX(),model.getJointId("ru_joint"),SE3::Identity(),"sphericalZYX",Inertia::Random()); |
43 |
✓✗✓✗ ✓✗✓✗ ✓✗✓✗ |
13 |
addJointAndBody(model,JointModelTranslation(),model.getJointId("sphericalZYX_joint"),SE3::Identity(),"translation",Inertia::Random()); |
44 |
13 |
} |
|
45 |
|||
46 |
} |
Generated by: GCOVR (Version 4.2) |