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
4cfdfa9e
Verified
Commit
4cfdfa9e
authored
Feb 15, 2020
by
Justin Carpentier
Browse files
test/packaging: test cmake export
parent
9ee7f999
Changes
3
Hide whitespace changes
Inline
Side-by-side
unittest/packaging/CMakeLists.txt
0 → 100644
View file @
4cfdfa9e
cmake_minimum_required
(
VERSION 2.6
)
project
(
ExtraLib CXX
)
find_package
(
pinocchio REQUIRED
)
find_package
(
PythonInterp REQUIRED
)
find_package
(
PythonLibs REQUIRED
)
set
(
PINOCCHIO_MODEL_DIR
"
${
PROJECT_SOURCE_DIR
}
/../../models"
)
add_definitions
(
'-DPINOCCHIO_MODEL_DIR=\"
${
PINOCCHIO_MODEL_DIR
}
\"'
)
add_executable
(
run_rnea run_rnea.cpp
)
target_link_libraries
(
run_rnea PUBLIC pinocchio::pinocchio
)
if
(
DEFINED PINOCCHIO_WITH_URDF_SUPPORT
)
add_executable
(
load_urdf load_urdf.cpp
)
target_link_libraries
(
load_urdf PUBLIC pinocchio::pinocchio
)
endif
(
DEFINED PINOCCHIO_WITH_URDF_SUPPORT
)
unittest/packaging/load_urdf.cpp
0 → 100644
View file @
4cfdfa9e
#include
<pinocchio/parsers/urdf.hpp>
#include
<iostream>
#include
<string>
int
main
(
int
/*argc*/
,
char
**
/*argv*/
)
{
using
namespace
pinocchio
;
const
std
::
string
filename
=
PINOCCHIO_MODEL_DIR
+
std
::
string
(
"/simple_humanoid.urdf"
);
Model
model
;
pinocchio
::
urdf
::
buildModel
(
filename
,
JointModelFreeFlyer
(),
model
);
std
::
cout
<<
"model.nq: "
<<
model
.
nq
<<
std
::
endl
;
std
::
cout
<<
"model.nv: "
<<
model
.
nv
<<
std
::
endl
;
return
0
;
}
unittest/packaging/run_rnea.cpp
0 → 100644
View file @
4cfdfa9e
#include
<pinocchio/parsers/sample-models.hpp>
#include
<pinocchio/algorithm/rnea.hpp>
#include
<pinocchio/algorithm/joint-configuration.hpp>
#include
<iostream>
int
main
(
int
/*argc*/
,
char
**
/*argv*/
)
{
using
namespace
pinocchio
;
Model
model
;
pinocchio
::
buildModels
::
humanoid
(
model
);
Model
::
VectorXs
q
=
randomConfiguration
(
model
);
Model
::
VectorXs
v
=
Model
::
VectorXs
::
Random
(
model
.
nv
);
Model
::
VectorXs
a
=
Model
::
VectorXs
::
Random
(
model
.
nv
);
Data
data
(
model
);
rnea
(
model
,
data
,
q
,
v
,
a
);
return
0
;
}
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