From f5a13555171a50c51ad818307c661c94a1243625 Mon Sep 17 00:00:00 2001 From: ahendrix Date: Mon, 20 Jan 2014 13:19:54 -0800 Subject: [PATCH] Install sounds. Fixes #29. --- sound_play/CMakeLists.txt | 3 +++ sound_play/scripts/soundplay_node.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sound_play/CMakeLists.txt b/sound_play/CMakeLists.txt index d5083dda..1743f16c 100644 --- a/sound_play/CMakeLists.txt +++ b/sound_play/CMakeLists.txt @@ -33,3 +33,6 @@ install(FILES install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) + +install(DIRECTORY sounds + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) diff --git a/sound_play/scripts/soundplay_node.py b/sound_play/scripts/soundplay_node.py index 655c9893..7021be53 100755 --- a/sound_play/scripts/soundplay_node.py +++ b/sound_play/scripts/soundplay_node.py @@ -301,7 +301,7 @@ def __init__(self): rospy.init_node('sound_play') self.diagnostic_pub = rospy.Publisher("/diagnostics", DiagnosticArray) - rootdir = os.path.join(os.path.dirname(__file__),'..','sounds') + rootdir = os.path.join(roslib.packages.get_pkg_dir('sound_play'),'sounds') self.builtinsoundparams = { SoundRequest.BACKINGUP : (os.path.join(rootdir, 'BACKINGUP.ogg'), 0.1),