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
1bf9b726
Commit
1bf9b726
authored
9 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[Unittest] Add Lua parser Unittest
parent
78512b43
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
models/simple_model.lua
+85
-0
85 additions, 0 deletions
models/simple_model.lua
src/multibody/parser/lua.cpp
+1
-1
1 addition, 1 deletion
src/multibody/parser/lua.cpp
unittest/CMakeLists.txt
+6
-0
6 additions, 0 deletions
unittest/CMakeLists.txt
unittest/lua.cpp
+23
-0
23 additions, 0 deletions
unittest/lua.cpp
with
115 additions
and
1 deletion
models/simple_model.lua
0 → 100644
+
85
−
0
View file @
1bf9b726
inertia
=
{
{
1
.
1
,
0
.
1
,
0
.
2
},
{
0
.
1
,
1
.
2
,
0
.
4
},
{
0
.
2
,
0
.
4
,
1
.
3
}
}
pelvis
=
{
mass
=
9
.
3
,
com
=
{
1
.
1
,
1
.
2
,
1
.
3
},
inertia
=
inertia
}
thigh
=
{
mass
=
4
.
2
,
com
=
{
1
.
1
,
1
.
2
,
1
.
3
},
inertia
=
inertia
}
shank
=
{
mass
=
4
.
1
,
com
=
{
1
.
1
,
1
.
2
,
1
.
3
},
inertia
=
inertia
}
foot
=
{
mass
=
1
.
1
,
com
=
{
1
.
1
,
1
.
2
,
1
.
3
},
inertia
=
inertia
}
bodies
=
{
pelvis
=
pelvis
,
thigh_right
=
thigh
,
shank_right
=
shank
,
thigh_left
=
thigh
,
shank_left
=
shank
}
joints
=
{
freeflyer
=
{
'jointFreeFlyer'
},
spherical_zyx
=
{
'jointSphericalZYX'
},
rotational_y
=
{
'jointRY'
},
fixed
=
{
'jointFixed'
},
}
model
=
{
frames
=
{
{
name
=
"pelvis"
,
--parent = "ROOT",
body
=
bodies
.
pelvis
,
--joint = joints.freeflyer,
},
{
name
=
"thigh_right"
,
parent
=
"pelvis"
,
body
=
bodies
.
thigh_right
,
joint
=
joints
.
spherical_zyx
,
joint_name
=
"hip_right"
,
},
{
name
=
"shank_right"
,
parent
=
"thigh_right"
,
body
=
bodies
.
thigh_right
,
joint
=
joints
.
rotational_y
},
{
name
=
"foot_right"
,
parent
=
"shank_right"
,
body
=
bodies
.
thigh_right
,
joint
=
joints
.
fixed
},
{
name
=
"thigh_left"
,
parent
=
"pelvis"
,
body
=
bodies
.
thigh_left
,
joint
=
joints
.
spherical_zyx
,
joint_name
=
"hip_left"
,
},
{
name
=
"shank_left"
,
parent
=
"thigh_left"
,
body
=
bodies
.
thigh_left
,
joint
=
joints
.
rotational_y
},
{
name
=
"foot_left"
,
parent
=
"shank_left"
,
body
=
bodies
.
thigh_left
,
joint
=
joints
.
fixed
},
}
}
return
model
This diff is collapsed.
Click to expand it.
src/multibody/parser/lua.cpp
+
1
−
1
View file @
1bf9b726
...
@@ -213,7 +213,7 @@ namespace se3
...
@@ -213,7 +213,7 @@ namespace se3
joint_type
=
"jointFreeFlyer"
;
joint_type
=
"jointFreeFlyer"
;
else
else
{
{
std
::
cerr
<<
"The first segment is defined without any definition of joint type relatily to the
environment
."
<<
std
::
endl
;
std
::
cerr
<<
"The first segment is defined without any definition of joint type relatily to the
world
."
<<
std
::
endl
;
abort
();
abort
();
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
unittest/CMakeLists.txt
+
6
−
0
View file @
1bf9b726
...
@@ -45,6 +45,12 @@ IF(URDFDOM_FOUND)
...
@@ -45,6 +45,12 @@ IF(URDFDOM_FOUND)
ADD_TEST_CFLAGS
(
value '-DPINOCCHIO_SOURCE_DIR=\\\"
${${
PROJECT_NAME
}
_SOURCE_DIR
}
\\\"'
)
ADD_TEST_CFLAGS
(
value '-DPINOCCHIO_SOURCE_DIR=\\\"
${${
PROJECT_NAME
}
_SOURCE_DIR
}
\\\"'
)
ENDIF
(
URDFDOM_FOUND
)
ENDIF
(
URDFDOM_FOUND
)
IF
(
LUA5_1_FOUND
)
ADD_UNIT_TEST
(
lua
"eigen3;lua5.1"
)
TARGET_LINK_LIBRARIES
(
lua
${
PROJECT_NAME
}
)
ADD_TEST_CFLAGS
(
lua '-DPINOCCHIO_SOURCE_DIR=\\\"
${${
PROJECT_NAME
}
_SOURCE_DIR
}
\\\"'
)
ENDIF
(
LUA5_1_FOUND
)
# Work in progress
# Work in progress
#ADD_UNIT_TEST(constraint eigen3)
#ADD_UNIT_TEST(constraint eigen3)
#ADD_UNIT_TEST(variant eigen3)
#ADD_UNIT_TEST(variant eigen3)
...
...
This diff is collapsed.
Click to expand it.
unittest/lua.cpp
0 → 100644
+
23
−
0
View file @
1bf9b726
#include
<iostream>
#include
"pinocchio/multibody/model.hpp"
#include
"pinocchio/multibody/parser/lua.hpp"
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE UrdfTest
#include
<boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE
(
ParsingLuaFile
)
BOOST_AUTO_TEST_CASE
(
buildModel
)
{
std
::
string
filename
=
PINOCCHIO_SOURCE_DIR
"/models/simple_model.lua"
;
#ifndef NDEBUG
std
::
cout
<<
"Parse filename
\"
"
<<
filename
<<
"
\"
"
<<
std
::
endl
;
#endif
se3
::
Model
model
=
se3
::
lua
::
buildModel
(
filename
,
true
,
true
);
}
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