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
aad0c5ae
Verified
Commit
aad0c5ae
authored
Oct 17, 2018
by
Gabriele Buondonno
Committed by
Justin Carpentier
Oct 24, 2018
Browse files
[pythontest] Moved python tests in unittest folder
parent
2ddce615
Changes
15
Hide whitespace changes
Inline
Side-by-side
python/display
.py
→
examples/python/gepetto-viewer
.py
View file @
aad0c5ae
# NOTE: this example needs gepetto-gui to be installed
# usage: launch gepetto-gui and then run this test
import
unittest
import
pinocchio
as
se3
import
numpy
as
np
...
...
@@ -5,15 +8,14 @@ import os
from
pinocchio.robot_wrapper
import
RobotWrapper
# TODO: do not use romeo
current_file
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
romeo_model_dir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
current_file
,
'../models/romeo'
))
romeo_model_dir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
current_file
,
'../
../
models/romeo'
))
romeo_model_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
romeo_model_dir
,
'romeo_description/urdf/romeo.urdf'
))
hint_list
=
[
romeo_model_dir
,
"wrong/hint"
]
# hint list
robot
=
RobotWrapper
(
romeo_model_path
,
hint_list
,
se3
.
JointModelFreeFlyer
())
robot
.
initDisplay
()
robot
.
loadDisplayModel
(
"
world/
pinocchio"
)
robot
.
loadDisplayModel
(
"pinocchio"
)
q0
=
np
.
matrix
([
0
,
0
,
0.840252
,
0
,
0
,
0
,
1
,
# Free flyer
...
...
examples/python/load-romeo.py
View file @
aad0c5ae
import
pinocchio
as
pin
from
pinocchio.romeo_wrapper
import
RomeoWrapper
DISPLAY
=
False
## Load Romeo with RomeoWrapper
import
os
current_path
=
os
.
getcwd
()
...
...
@@ -24,17 +22,3 @@ q0 = robot.q0
com
=
robot
.
com
(
q0
)
# This last command is similar to
com2
=
pin
.
centerOfMass
(
model
,
data
,
q0
)
## load model into gepetto-gui
if
DISPLAY
:
import
gepetto.corbaserver
cl
=
gepetto
.
corbaserver
.
Client
()
gui
=
cl
.
gui
if
gui
.
nodeExists
(
"world"
):
gui
.
deleteNode
(
"world"
,
"ON"
)
robot
.
initDisplay
(
loadModel
=
False
)
robot
.
loadDisplayModel
(
"pinocchio"
)
robot
.
display
(
robot
.
q0
)
gui
=
robot
.
viewer
.
gui
python/bindings.py
→
unittest/
python/bindings.py
View file @
aad0c5ae
File moved
python/bindings_SE3.py
→
unittest/
python/bindings_SE3.py
View file @
aad0c5ae
File moved
python/bindings_force.py
→
unittest/
python/bindings_force.py
View file @
aad0c5ae
File moved
python/bindings_frame.py
→
unittest/
python/bindings_frame.py
View file @
aad0c5ae
File moved
python/bindings_geometry_object.py
→
unittest/
python/bindings_geometry_object.py
View file @
aad0c5ae
...
...
@@ -9,7 +9,7 @@ ones = lambda n: np.matrix(np.ones([n, 1] if isinstance(n, int) else n), np.doub
# TODO: remove these lines. Do not use RobotWrapper. Do not use URDF
from
pinocchio.robot_wrapper
import
RobotWrapper
current_file
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
romeo_model_dir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
current_file
,
'../models/romeo'
))
romeo_model_dir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
current_file
,
'../
../
models/romeo'
))
romeo_model_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
romeo_model_dir
,
'romeo_description/urdf/romeo.urdf'
))
hint_list
=
[
romeo_model_dir
,
"wrong/hint"
]
# hint list
robot
=
RobotWrapper
(
romeo_model_path
,
hint_list
,
se3
.
JointModelFreeFlyer
())
...
...
python/bindings_inertia.py
→
unittest/
python/bindings_inertia.py
View file @
aad0c5ae
File moved
python/bindings_motion.py
→
unittest/
python/bindings_motion.py
View file @
aad0c5ae
File moved
python/explog.py
→
unittest/
python/explog.py
View file @
aad0c5ae
File moved
python/model.py
→
unittest/
python/model.py
View file @
aad0c5ae
File moved
python/rpy.py
→
unittest/
python/rpy.py
View file @
aad0c5ae
File moved
python/test_case.py
→
unittest/
python/test_case.py
View file @
aad0c5ae
File moved
python/tests.py
→
unittest/
python/tests.py
View file @
aad0c5ae
File moved
python/utils.py
→
unittest/
python/utils.py
View file @
aad0c5ae
File moved
Write
Preview
Markdown
is supported
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