Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-core
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
sot-core
Commits
7e140b40
Commit
7e140b40
authored
4 years ago
by
Olivier Stasse
Browse files
Options
Downloads
Patches
Plain Diff
[tests] Make flake8 happy in tests python directory.
parent
2ea1fba7
No related branches found
No related tags found
No related merge requests found
Pipeline
#10912
passed with warnings
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/python/initialize-euler.py
+2
-1
2 additions, 1 deletion
tests/python/initialize-euler.py
tests/python/parameter_server_conf.py
+2
-2
2 additions, 2 deletions
tests/python/parameter_server_conf.py
tests/python/test-parameter-server.py
+16
-16
16 additions, 16 deletions
tests/python/test-parameter-server.py
with
20 additions
and
19 deletions
tests/python/initialize-euler.py
+
2
−
1
View file @
7e140b40
...
...
@@ -13,7 +13,8 @@ class OpPointModifierTest(unittest.TestCase):
ent
.
initialize
()
self
.
assertEqual
(
str
(
cm
.
exception
),
'
In SignalPtr: SIN ptr not set. (in signal <sotIntegratorAbstract(ie)::input(vector)::sin>)
'
'
In SignalPtr: SIN ptr not set. (in signal
'
'
<sotIntegratorAbstract(ie)::input(vector)::sin>)
'
)
...
...
This diff is collapsed.
Click to expand it.
tests/python/parameter_server_conf.py
+
2
−
2
View file @
7e140b40
NJ
=
2
model_path
=
[
'
/integration_tests/openrobots/share/
'
]
urdfFileName
=
"
/integration_tests/openrobots/share/
"
+
\
"
simple_humanoid_description/urdf/
"
+
\
urdfFileName
=
"
/integration_tests/openrobots/share/
"
+
\
"
simple_humanoid_description/urdf/
"
+
\
"
simple_humanoid.urdf
"
ImuJointName
=
"
imu_joint
"
...
...
This diff is collapsed.
Click to expand it.
tests/python/test-parameter-server.py
+
16
−
16
View file @
7e140b40
import
unittest
import
numpy
as
np
import
pinocchio
as
pin
from
numpy.testing
import
assert_almost_equal
as
assertApprox
import
parameter_server_conf
as
param_server_conf
from
dynamic_graph.sot.core.parameter_server
import
ParameterServer
import
sys
from
os.path
import
dirname
,
join
,
abspath
# Switch pinocchio to numpy matrix
pin
.
switchToNumpyMatrix
()
import
parameter_server_conf
as
param_server_conf
from
dynamic_graph.sot.core.parameter_server
import
ParameterServer
param_server
=
ParameterServer
(
"
param_server
"
)
param_server
.
init
(
0.001
,
"
talos.urdf
"
,
"
talos
"
)
...
...
@@ -19,10 +19,6 @@ robot_name = 'robot'
urdfPath
=
param_server_conf
.
urdfFileName
urdfDir
=
param_server_conf
.
model_path
import
sys
from
os.path
import
dirname
,
join
,
abspath
class
TestParameterServer
(
unittest
.
TestCase
):
...
...
@@ -34,22 +30,26 @@ class TestParameterServer(unittest.TestCase):
from
example_robot_data.path
import
EXAMPLE_ROBOT_DATA_MODEL_DIR
urdf_file_name
=
EXAMPLE_ROBOT_DATA_MODEL_DIR
+
\
'
/talos_data/robots/talos_reduced.urdf
'
urdf_file_name
=
EXAMPLE_ROBOT_DATA_MODEL_DIR
+
\
'
/talos_data/robots/talos_reduced.urdf
'
fs
=
open
(
urdf_file_name
,
'
r
'
)
urdf_rrbot_model_string
=
fs
.
read
()
fs
.
close
()
param_server
.
setParameter
(
"
/robot_description
"
,
urdf_rrbot_model_string
)
param_server
.
setParameter
(
"
/robot_description
"
,
urdf_rrbot_model_string
)
model2_string
=
param_server
.
getParameter
(
"
/robot_description
"
)
self
.
assertEqual
(
urdf_rrbot_model_string
,
model2_string
)
aValue
=
0.122
param_server
.
setParameterDbl
(
"
/specificities/feet/right/size/height
"
,
aValue
)
a2Value
=
param_server
.
getParameterDbl
(
"
/specificities/feet/right/size/height
"
)
self
.
assertEqual
(
aValue
,
a2Value
)
aValue
=
0.122
param_server
.
setParameterDbl
(
"
/specificities/feet/right/size/height
"
,
aValue
)
a2Value
=
param_server
.
getParameterDbl
(
"
/specificities/feet/right/size/height
"
)
self
.
assertEqual
(
aValue
,
a2Value
)
if
__name__
==
'
__main__
'
:
unittest
.
main
()
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