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
25714c7d
Commit
25714c7d
authored
5 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
[test] Add test for parsing tag collision_checking of URDF.
parent
6d69c854
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
models/simple_humanoid.urdf
+6
-0
6 additions, 0 deletions
models/simple_humanoid.urdf
models/simple_humanoid_description/box.stl
+86
-0
86 additions, 0 deletions
models/simple_humanoid_description/box.stl
unittest/urdf.cpp
+25
-1
25 additions, 1 deletion
unittest/urdf.cpp
with
117 additions
and
1 deletion
models/simple_humanoid.urdf
+
6
−
0
View file @
25714c7d
...
@@ -17,10 +17,16 @@
...
@@ -17,10 +17,16 @@
<cylinder
radius=
"1"
length=
"1"
/>
<cylinder
radius=
"1"
length=
"1"
/>
</geometry>
</geometry>
</collision>
</collision>
<collision
name=
"box"
>
<geometry>
<mesh
filename=
"package://simple_humanoid_description/box.stl"
/>
</geometry>
</collision>
<collision_checking>
<collision_checking>
<!--- This tells to pinocchio to replace the cylinder called "test"
<!--- This tells to pinocchio to replace the cylinder called "test"
by a capsule with the same radius and length -->
by a capsule with the same radius and length -->
<capsule
name=
"test"
/>
<capsule
name=
"test"
/>
<convex
name=
"box"
/>
</collision_checking>
</collision_checking>
</link>
</link>
...
...
This diff is collapsed.
Click to expand it.
models/simple_humanoid_description/box.stl
0 → 100644
+
86
−
0
View file @
25714c7d
solid Exported from Blender-2.78 (sub 0)
facet normal -1.000000 0.000000 0.000000
outer loop
vertex -0.500000 -0.500000 -0.500000
vertex -0.500000 -0.500000 0.500000
vertex -0.500000 0.500000 0.500000
endloop
endfacet
facet normal -1.000000 0.000000 0.000000
outer loop
vertex -0.500000 0.500000 0.500000
vertex -0.500000 0.500000 -0.500000
vertex -0.500000 -0.500000 -0.500000
endloop
endfacet
facet normal 0.000000 1.000000 0.000000
outer loop
vertex -0.500000 0.500000 -0.500000
vertex -0.500000 0.500000 0.500000
vertex 0.500000 0.500000 0.500000
endloop
endfacet
facet normal 0.000000 1.000000 0.000000
outer loop
vertex 0.500000 0.500000 0.500000
vertex 0.500000 0.500000 -0.500000
vertex -0.500000 0.500000 -0.500000
endloop
endfacet
facet normal 1.000000 0.000000 0.000000
outer loop
vertex 0.500000 0.500000 -0.500000
vertex 0.500000 0.500000 0.500000
vertex 0.500000 -0.500000 0.500000
endloop
endfacet
facet normal 1.000000 0.000000 0.000000
outer loop
vertex 0.500000 -0.500000 0.500000
vertex 0.500000 -0.500000 -0.500000
vertex 0.500000 0.500000 -0.500000
endloop
endfacet
facet normal 0.000000 -1.000000 0.000000
outer loop
vertex -0.500000 -0.500000 0.500000
vertex -0.500000 -0.500000 -0.500000
vertex 0.500000 -0.500000 -0.500000
endloop
endfacet
facet normal 0.000000 -1.000000 0.000000
outer loop
vertex 0.500000 -0.500000 -0.500000
vertex 0.500000 -0.500000 0.500000
vertex -0.500000 -0.500000 0.500000
endloop
endfacet
facet normal 0.000000 0.000000 -1.000000
outer loop
vertex 0.500000 -0.500000 -0.500000
vertex -0.500000 -0.500000 -0.500000
vertex -0.500000 0.500000 -0.500000
endloop
endfacet
facet normal 0.000000 0.000000 -1.000000
outer loop
vertex -0.500000 0.500000 -0.500000
vertex 0.500000 0.500000 -0.500000
vertex 0.500000 -0.500000 -0.500000
endloop
endfacet
facet normal 0.000000 0.000000 1.000000
outer loop
vertex 0.500000 0.500000 0.500000
vertex -0.500000 0.500000 0.500000
vertex -0.500000 -0.500000 0.500000
endloop
endfacet
facet normal 0.000000 0.000000 1.000000
outer loop
vertex -0.500000 -0.500000 0.500000
vertex 0.500000 -0.500000 0.500000
vertex 0.500000 0.500000 0.500000
endloop
endfacet
endsolid Exported from Blender-2.78 (sub 0)
This diff is collapsed.
Click to expand it.
unittest/urdf.cpp
+
25
−
1
View file @
25714c7d
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
#include
"pinocchio/multibody/model.hpp"
#include
"pinocchio/multibody/model.hpp"
#include
"pinocchio/parsers/urdf.hpp"
#include
"pinocchio/parsers/urdf.hpp"
#ifdef PINOCCHIO_WITH_HPP_FCL
#include
<hpp/fcl/collision_object.h>
#endif // PINOCCHIO_WITH_HPP_FCL
#include
<boost/test/unit_test.hpp>
#include
<boost/test/unit_test.hpp>
#include
<urdf_parser/urdf_parser.h>
#include
<urdf_parser/urdf_parser.h>
...
@@ -32,11 +36,31 @@ BOOST_AUTO_TEST_CASE ( build_model )
...
@@ -32,11 +36,31 @@ BOOST_AUTO_TEST_CASE ( build_model )
BOOST_AUTO_TEST_CASE
(
build_model_simple_humanoid
)
BOOST_AUTO_TEST_CASE
(
build_model_simple_humanoid
)
{
{
const
std
::
string
filename
=
PINOCCHIO_MODEL_DIR
+
std
::
string
(
"/simple_humanoid.urdf"
);
const
std
::
string
filename
=
PINOCCHIO_MODEL_DIR
+
std
::
string
(
"/simple_humanoid.urdf"
);
const
std
::
string
dir
=
PINOCCHIO_MODEL_DIR
;
pinocchio
::
Model
model
;
pinocchio
::
Model
model
;
pinocchio
::
urdf
::
buildModel
(
filename
,
model
);
pinocchio
::
urdf
::
buildModel
(
filename
,
model
);
BOOST_CHECK
(
model
.
nq
==
29
);
BOOST_CHECK_EQUAL
(
model
.
nq
,
29
);
// Check that parsing collision_checking works.
pinocchio
::
GeometryModel
geomModel
;
pinocchio
::
urdf
::
buildGeom
(
model
,
filename
,
pinocchio
::
COLLISION
,
geomModel
,
dir
);
BOOST_CHECK_EQUAL
(
geomModel
.
ngeoms
,
2
);
#ifdef PINOCCHIO_WITH_HPP_FCL
# if ( HPP_FCL_MAJOR_VERSION>1 || ( HPP_FCL_MAJOR_VERSION==1 && \
( HPP_FCL_MINOR_VERSION>1 || ( HPP_FCL_MINOR_VERSION==1 && \
HPP_FCL_PATCH_VERSION>3))))
# define PINOCCHIO_HPP_FCL_SUPERIOR_TO_1_1_3
#endif
BOOST_CHECK_EQUAL
(
geomModel
.
geometryObjects
[
0
].
fcl
->
getNodeType
(),
hpp
::
fcl
::
GEOM_CAPSULE
);
#ifdef PINOCCHIO_HPP_FCL_SUPERIOR_TO_1_1_3
BOOST_CHECK_EQUAL
(
geomModel
.
geometryObjects
[
1
].
fcl
->
getNodeType
(),
hpp
::
fcl
::
GEOM_CONVEX
);
#undef PINOCCHIO_HPP_FCL_SUPERIOR_TO_1_1_3
#else
BOOST_CHECK_EQUAL
(
geomModel
.
geometryObjects
[
1
].
fcl
->
getObjectType
(),
hpp
::
fcl
::
OT_BVH
);
#endif // PINOCCHIO_HPP_FCL_SUPERIOR_TO_1_1_3
#endif // PINOCCHIO_WITH_HPP_FCL
pinocchio
::
Model
model_ff
;
pinocchio
::
Model
model_ff
;
pinocchio
::
urdf
::
buildModel
(
filename
,
pinocchio
::
JointModelFreeFlyer
(),
model_ff
);
pinocchio
::
urdf
::
buildModel
(
filename
,
pinocchio
::
JointModelFreeFlyer
(),
model_ff
);
...
...
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