diff --git a/hironx_ros_bridge/CMakeLists.txt b/hironx_ros_bridge/CMakeLists.txt index 260dbb29..c08dccbf 100644 --- a/hironx_ros_bridge/CMakeLists.txt +++ b/hironx_ros_bridge/CMakeLists.txt @@ -44,7 +44,8 @@ configure_file(conf/xml.in ${PROJECT_SOURCE_DIR}/conf/${ROB configure_file(conf/nosim.xml.in ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}_nosim.xml) configure_file(conf/conf.in ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}.conf) configure_file(conf/nosim.conf.in ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}_nosim.conf) -add_custom_target(${PROJECT_NAME}_model_files ALL DEPENDS ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}.RobotHardware.conf ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}_nosim.RobotHardware.conf ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}.xml ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}_nosim.xml ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}.conf ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}_nosim.conf) +configure_file(conf/rtc_on_off_test.conf.in ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}_rtc_on_off_test.conf) +add_custom_target(${PROJECT_NAME}_model_files ALL DEPENDS ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}.RobotHardware.conf ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}_nosim.RobotHardware.conf ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}.xml ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}_nosim.xml ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}.conf ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}_nosim.conf ${PROJECT_SOURCE_DIR}/conf/${ROBOT_NAME}_rtc_on_off_test.conf) include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) @@ -104,6 +105,7 @@ add_rostest(test/test-hironx-ros-bridge.test) add_rostest(test/test-hironx-ros-bridge-send.test) add_rostest(test/test-hironx-ros-bridge-pose.test) add_rostest(test/test-hironx-ros-bridge-controller.test) +add_rostest(test/test-hironx-rtc-on-off.test) if (CATKIN_ENABLE_TESTING) catkin_add_nosetests(test/test_no_ros.py) diff --git a/hironx_ros_bridge/conf/rtc_on_off_test.conf.in b/hironx_ros_bridge/conf/rtc_on_off_test.conf.in new file mode 100644 index 00000000..712e9532 --- /dev/null +++ b/hironx_ros_bridge/conf/rtc_on_off_test.conf.in @@ -0,0 +1,10 @@ +model: file://@PROJECT_SOURCE_DIR@/models/@ROBOT_NAME@.dae +dt: 0.005 +collision_pair: RARM_JOINT2:LARM_JOINT2 RARM_JOINT3:LARM_JOINT3 RARM_JOINT4:LARM_JOINT4 RARM_JOINT5:LARM_JOINT5 +end_effectors: rarm,RARM_JOINT5,CHEST_JOINT0,0.0,0.0,0.0,-0.57735027,-0.57735027,-0.57735027,-2.0943951023931953,larm,LARM_JOINT5,CHEST_JOINT0,0.0,0.0,0.0,-0.57735027,-0.57735027,-0.57735027,-2.0943951023931953, + +# RTC disable/enable settings which will be loaded via RobotHardware +CollisionDetector.enable: YES +ServoController.enable: NO +DataLogger.enable: NOO # Test case when typo exists + diff --git a/hironx_ros_bridge/test/test-hironx-rtc-on-off.test b/hironx_ros_bridge/test/test-hironx-rtc-on-off.test new file mode 100644 index 00000000..d129a1ee --- /dev/null +++ b/hironx_ros_bridge/test/test-hironx-rtc-on-off.test @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + diff --git a/hironx_ros_bridge/test/test_hironx_rtc_on_off.py b/hironx_ros_bridge/test/test_hironx_rtc_on_off.py new file mode 100755 index 00000000..6fbca5b0 --- /dev/null +++ b/hironx_ros_bridge/test/test_hironx_rtc_on_off.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from distutils.version import StrictVersion + +from test_hironx import * + +class TestHironxRtcOnOff(TestHiro): + + def test_rtc_on_off(self): + self.assertTrue(['co', "CollisionDetector"] in self.robot.getRTCList()) + self.assertFalse(['sc', "ServoController"] in self.robot.getRTCList()) + self.assertTrue(['log', "DataLogger"] in self.robot.getRTCList()) + + +if __name__ == '__main__': + import rostest + rostest.rosrun(PKG, 'test_hironx_rtc_on_off', TestHironxRtcOnOff)