Example 2.6_syntax error

Hello,

When I have done example 2.6. I have taken the below result instead of the expected result.

user:~/catkin_ws/src/my_package$ rosrun my_package my_package_launch_file.launch
/home/user/catkin_ws/src/my_package/launch/my_package_launch_file.launch: line 1: syntax error near unexpected token newline' /home/user/catkin_ws/src/my_package/launch/my_package_launch_file.launch: line 1:

rosrun my_package my_package_launch_file.launch is not correct. It should be roslaunch my_package my_package_launch_file.launch

What is the difference between rosrun and roslaunch?

Read about the differences between roslaunch and rosrun.