Skip to content

Commit 9b9e40a

Browse files
Fix: Correct URDF path in demo_launch.py (ros2#5874)
* Fix: Correct URDF path in demo_launch.py This pull request resolves a launch file error by correcting the path used to find the robot's URDF file. The previous configuration was causing a TypeError because FindPackageShare was being called with too many arguments. The correct implementation separates the package name from the file path, allowing PathJoinSubstitution to correctly combine them. This ensures the robot_state_publisher can successfully locate and load the r2d2.urdf.xml file. Signed-off-by: Hemand Sunny <[email protected]> Signed-off-by: Alejandro Hernández Cordero <[email protected]> Co-authored-by: Alejandro Hernández Cordero <[email protected]>
1 parent 31f7d98 commit 9b9e40a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/Tutorials/Intermediate/URDF/launch/demo_launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def generate_launch_description():
99
use_sim_time = LaunchConfiguration('use_sim_time', default='false')
1010
urdf = FileContent(
11-
PathJoinSubstitution([FindPackageShare('urdf_tutorial_r2d2', 'r2d2.urdf.xml')]))
11+
PathJoinSubstitution([FindPackageShare('urdf_tutorial_r2d2'), 'r2d2.urdf.xml']))
1212

1313
return LaunchDescription([
1414
DeclareLaunchArgument(

0 commit comments

Comments
 (0)