Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
8435aefe
Verified
Commit
8435aefe
authored
Nov 23, 2019
by
Justin Carpentier
Browse files
test/all: remove compilation warnings
parent
da27ec6c
Changes
3
Hide whitespace changes
Inline
Side-by-side
unittest/centroidal.cpp
View file @
8435aefe
//
// Copyright (c) 2015-201
8
CNRS INRIA
// Copyright (c) 2015-201
9
CNRS INRIA
//
#include
"pinocchio/multibody/model.hpp"
#include
"pinocchio/multibody/data.hpp"
#include
"pinocchio/algorithm/crba.hpp"
#include
"pinocchio/algorithm/centroidal.hpp"
#include
"pinocchio/algorithm/rnea.hpp"
#include
"pinocchio/algorithm/jacobian.hpp"
#include
"pinocchio/algorithm/center-of-mass.hpp"
#include
"pinocchio/algorithm/joint-configuration.hpp"
#include
"pinocchio/parsers/sample-models.hpp"
#include
"pinocchio/utils/timer.hpp"
#include
<iostream>
...
...
@@ -32,7 +32,7 @@ static void addJointAndBody(pinocchio::Model & model,
Model
::
JointIndex
idx
;
if
(
setRandomLimits
)
if
(
setRandomLimits
)
idx
=
model
.
addJoint
(
model
.
getJointId
(
parent_name
),
joint
,
SE3
::
Random
(),
name
+
"_joint"
,
...
...
@@ -41,15 +41,15 @@ static void addJointAndBody(pinocchio::Model & model,
CV
::
Random
()
-
CV
::
Constant
(
1
),
CV
::
Random
()
+
CV
::
Constant
(
1
)
);
else
idx
=
model
.
addJoint
(
model
.
getJointId
(
parent_name
),
joint
,
placement
,
name
+
"_joint"
);
model
.
addJointFrame
(
idx
);
model
.
appendBodyToJoint
(
idx
,
Inertia
::
Random
(),
SE3
::
Identity
());
model
.
addBodyFrame
(
name
+
"_body"
,
idx
);
}
else
idx
=
model
.
addJoint
(
model
.
getJointId
(
parent_name
),
joint
,
placement
,
name
+
"_joint"
);
model
.
addJointFrame
(
idx
);
model
.
appendBodyToJoint
(
idx
,
Inertia
::
Random
(),
SE3
::
Identity
());
model
.
addBodyFrame
(
name
+
"_body"
,
idx
);
}
BOOST_AUTO_TEST_SUITE
(
BOOST_TEST_MODULE
)
...
...
@@ -104,7 +104,6 @@ BOOST_AUTO_TEST_CASE (test_dccrb)
crba
(
model
,
data_ref
,
q
);
data_ref
.
M
.
triangularView
<
Eigen
::
StrictlyLower
>
()
=
data_ref
.
M
.
transpose
().
triangularView
<
Eigen
::
StrictlyLower
>
();
SE3
::
Vector3
com
=
data_ref
.
Ycrb
[
1
].
lever
();
SE3
cMo
(
SE3
::
Identity
());
cMo
.
translation
()
=
-
getComFromCrba
(
model
,
data_ref
);
...
...
unittest/crba.cpp
View file @
8435aefe
//
// Copyright (c) 2015-201
8
CNRS
// Copyright (c) 2015-201
9
CNRS
INRIA
//
/*
...
...
@@ -49,15 +49,15 @@ static void addJointAndBody(pinocchio::Model & model,
CV
::
Random
()
-
CV
::
Constant
(
1
),
CV
::
Random
()
+
CV
::
Constant
(
1
)
);
else
idx
=
model
.
addJoint
(
model
.
getJointId
(
parent_name
),
joint
,
placement
,
name
+
"_joint"
);
model
.
addJointFrame
(
idx
);
model
.
appendBodyToJoint
(
idx
,
Inertia
::
Random
(),
SE3
::
Identity
());
model
.
addBodyFrame
(
name
+
"_body"
,
idx
);
}
else
idx
=
model
.
addJoint
(
model
.
getJointId
(
parent_name
),
joint
,
placement
,
name
+
"_joint"
);
model
.
addJointFrame
(
idx
);
model
.
appendBodyToJoint
(
idx
,
Inertia
::
Random
(),
SE3
::
Identity
());
model
.
addBodyFrame
(
name
+
"_body"
,
idx
);
}
BOOST_AUTO_TEST_SUITE
(
BOOST_TEST_MODULE
)
...
...
unittest/eigen-tensor.cpp
View file @
8435aefe
...
...
@@ -14,7 +14,8 @@ BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
BOOST_AUTO_TEST_CASE
(
test_emulate_tensors
)
{
typedef
pinocchio
::
Tensor
<
double
,
3
>
Tensor
;
typedef
double
Scalar
;
typedef
pinocchio
::
Tensor
<
Scalar
,
3
>
Tensor
;
const
Eigen
::
DenseIndex
x_dim
=
6
,
y_dim
=
20
,
z_dim
=
20
;
Tensor
tensor1
(
x_dim
,
y_dim
,
z_dim
);
...
...
@@ -24,9 +25,9 @@ BOOST_AUTO_TEST_CASE(test_emulate_tensors)
BOOST_CHECK
(
tensor1
.
dimension
(
1
)
==
y_dim
);
BOOST_CHECK
(
tensor1
.
dimension
(
2
)
==
z_dim
);
double
*
data
=
tensor1
.
data
();
Scalar
*
data
=
tensor1
.
data
();
for
(
Eigen
::
DenseIndex
k
=
0
;
k
<
tensor1
.
size
();
++
k
)
data
[
k
]
=
k
;
data
[
k
]
=
(
Scalar
)
k
;
for
(
Eigen
::
DenseIndex
k
=
0
;
k
<
z_dim
;
++
k
)
{
...
...
@@ -34,7 +35,7 @@ BOOST_AUTO_TEST_CASE(test_emulate_tensors)
{
for
(
Eigen
::
DenseIndex
i
=
0
;
i
<
x_dim
;
++
i
)
{
BOOST_CHECK
(
tensor1
(
i
,
j
,
k
)
==
i
+
j
*
x_dim
+
k
*
(
x_dim
*
y_dim
));
BOOST_CHECK
(
tensor1
(
i
,
j
,
k
)
==
(
Scalar
)(
i
+
j
*
x_dim
+
k
*
(
x_dim
*
y_dim
))
)
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment