diff --git a/launch/rtsp.launch.py b/launch/rtsp.launch.py index 49a76f4..a3ccae4 100644 --- a/launch/rtsp.launch.py +++ b/launch/rtsp.launch.py @@ -1,10 +1,11 @@ from launch import LaunchDescription from launch.actions import ExecuteProcess +from ament_index_python.packages import get_package_share_directory import os def generate_launch_description(): - home_dir = os.path.expanduser("~") - script_path = os.path.join(home_dir, 'ros2_ws/src/image2rtsp/python/rtsp.py') + pkg_share = get_package_share_directory('image2rtsp') + script_path = os.path.join(pkg_share, '../../../../src/image2rtsp/python/rtsp.py') return LaunchDescription( [