ROS2 python launch file always access underlay /opt/ros/foxy/share
Hey ROS Community,
i created a workspace and cloned the ros-planning/navigation2 github into my workspace. (I also have the nav2 in my underlay /opt/ros/foxy/share) Next i created a python launch file to run the navigation stack and other stuff. However, the python launch file always access my underlay nav2params.yaml file in /opt/ros/foxy/share instead of my nav2params.yaml in my workspace. I renamed the folder in my workspace from nav2bringup (in /opt/ros/foxy) to robotnav2_bringup (my src workspace)
My code:
nav2_launch_file_dir = os.path.join(get_package_share_directory('robot_nav2_bringup'), 'launch')
IncludeLaunchDescription(
PythonLaunchDescriptionSource([nav2_launch_file_dir, '/bringup_launch.py']),
launch_arguments={
'map': map_dir,
'use_sim_time': use_sim_time}.items(),
Why the launch file always access the underlay /opt/ros/foxy/share? Maybe because of getpackageshare_directory? What i have to do instead?
Thank you so much for you help :) ),
Asked by Nartmangnourt on 2023-06-16 09:02:02 UTC
Comments