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
loco-3d
sot-talos-balance
Commits
a35da6de
Commit
a35da6de
authored
Apr 07, 2020
by
Olivier Stasse
Committed by
olivier stasse
May 07, 2020
Browse files
[cmake] Make test_dcmZmpControl_file.py running through rosrun
Needed for unit test.
parent
12c40c56
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/CMakeLists.txt
View file @
a35da6de
...
...
@@ -164,6 +164,12 @@ SET(${PROJECT_NAME}_SIMULATION_FILES
appli_hip_flexibility_compensation.py
)
# simulation files
SET
(
${
PROJECT_NAME
}
_ROS_EXEC_FILES
test_dcmZmpControl_file.py
appli_dcmZmpControl_file.py
)
IF
(
BUILD_PYTHON_INTERFACE
)
FOREACH
(
python
${${
PROJECT_NAME
}
_PYTHON_FILES
}
)
PYTHON_INSTALL_ON_SITE
(
${
PY_NAME
}
${
python
}
)
...
...
@@ -180,4 +186,10 @@ IF(BUILD_PYTHON_INTERFACE)
FOREACH
(
python
${${
PROJECT_NAME
}
_SIMULATION_FILES
}
)
PYTHON_INSTALL_ON_SITE
(
${
PY_NAME
}
/test
${
python
}
)
ENDFOREACH
(
python
${${
PROJECT_NAME
}
_SIMULATION_FILES
}
)
FOREACH
(
python
${${
PROJECT_NAME
}
_ROS_EXEC_FILES
}
)
INSTALL
(
PROGRAMS
${
PY_NAME
}
/test/
${
python
}
DESTINATION
${
CMAKE_BINARY_DIR
}
/lib/
${
PROJECT_NAME
}
)
ENDFOREACH
(
python
${${
PROJECT_NAME
}
_ROS_EXEC_FILES
}
)
ENDIF
(
BUILD_PYTHON_INTERFACE
)
src/sot_talos_balance/utils/run_test_utils.py
View file @
a35da6de
...
...
@@ -54,8 +54,9 @@ def evalCommandClient(code):
return
eval
(
runCommandClient
(
code
).
result
)
def
launch_script
(
code
,
title
,
description
=
""
,
verbosity
=
1
):
input
(
title
+
': '
+
description
)
def
launch_script
(
code
,
title
,
description
=
""
,
verbosity
=
1
,
interactive
=
True
):
if
interactive
:
input
(
title
+
': '
+
description
)
rospy
.
loginfo
(
title
)
rospy
.
loginfo
(
code
)
indent
=
' '
...
...
@@ -79,7 +80,7 @@ def launch_script(code, title, description="", verbosity=1):
rospy
.
loginfo
(
"...done with "
+
title
)
def
run_test
(
appli
,
verbosity
=
1
):
def
run_test
(
appli
,
verbosity
=
1
,
interactive
=
True
):
try
:
rospy
.
loginfo
(
"Waiting for run_command"
)
rospy
.
wait_for_service
(
'/run_command'
)
...
...
@@ -95,8 +96,11 @@ def run_test(appli, verbosity=1):
rospy
.
loginfo
(
"Stack of Tasks launched"
)
launch_script
(
initCode
,
'initialize SoT'
,
verbosity
=
verbosity
)
input
(
"Wait before starting the dynamic graph"
)
launch_script
(
initCode
,
'initialize SoT'
,
verbosity
=
verbosity
,
interactive
=
interactive
)
if
interactive
:
input
(
"Wait before starting the dynamic graph"
)
runCommandStartDynamicGraph
()
print
()
except
rospy
.
ServiceException
as
e
:
...
...
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