Commit a35da6de authored by Olivier Stasse's avatar Olivier Stasse Committed by olivier stasse
Browse files

[cmake] Make test_dcmZmpControl_file.py running through rosrun

Needed for unit test.
parent 12c40c56
......@@ -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)
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment