Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
pinocchio
Commits
9c40d2a5
Commit
9c40d2a5
authored
8 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[Unit test] Add unit test of subtree info
parent
4460c5a8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
unittest/CMakeLists.txt
+1
-0
1 addition, 0 deletions
unittest/CMakeLists.txt
unittest/model.cpp
+45
-0
45 additions, 0 deletions
unittest/model.cpp
with
46 additions
and
0 deletions
unittest/CMakeLists.txt
+
1
−
0
View file @
9c40d2a5
...
...
@@ -92,6 +92,7 @@ IF(BUILD_PYTHON_INTERFACE)
ENDIF
(
BUILD_PYTHON_INTERFACE
)
# Work in progress
ADD_UNIT_TEST
(
model eigen3
)
ADD_UNIT_TEST
(
constraint eigen3
)
#ADD_UNIT_TEST(variant eigen3)
ADD_UNIT_TEST
(
joints eigen3
)
...
...
This diff is collapsed.
Click to expand it.
unittest/model.cpp
0 → 100644
+
45
−
0
View file @
9c40d2a5
//
// Copyright (c) 2016 CNRS
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// Pinocchio is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// Pinocchio If not, see
// <http://www.gnu.org/licenses/>.
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE JointTest
#include
<boost/test/unit_test.hpp>
#include
<boost/utility/binary.hpp>
#include
"pinocchio/multibody/model.hpp"
#include
"pinocchio/parsers/sample-models.hpp"
using
namespace
se3
;
BOOST_AUTO_TEST_SUITE
(
Modeltest
)
BOOST_AUTO_TEST_CASE
(
test_model_subtree
)
{
Model
model
;
std
::
cout
<<
"build model"
<<
std
::
endl
;
buildModels
::
humanoidSimple
(
model
);
Model
::
JointIndex
idx_larm1
=
model
.
getJointId
(
"larm1_joint"
);
BOOST_CHECK
(
idx_larm1
<
model
.
njoint
);
Model
::
IndexVector
subtree
=
model
.
subtrees
[
idx_larm1
];
BOOST_CHECK
(
subtree
.
size
()
==
6
);
for
(
size_t
i
=
1
;
i
<
subtree
.
size
();
++
i
)
BOOST_CHECK
(
model
.
parents
[
subtree
[
i
]]
==
subtree
[
i
-
1
]);
}
BOOST_AUTO_TEST_SUITE_END
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment