Solution to Exercise 2.5

This solution to exercise 2.5 is a little different.

  1. What does it mean to write arg name="" and then what does default="" do ?
  2. What is the function of args="$(arg map_file)" in node tag?
  3. Does order not matter in .launch file ? (whether we write arg tag first or node tag)

Hello @abdulbasitisdost,

With arg name="map_file" you are creating a new parameter named map_file, which is going to be set to the value specified in default="". Then, when you use args="$(arg map_file)" you are basically indicating to pass to the map_server node the map_file parameter, which value is /home/user/catkin-ws/src/my_map.yaml.

Summarizing, you are passing to the map_server node a parameter that contains the path of the map file you want to load.


1 Like

user:~/catkin_ws$ roslaunch provide_map map.launch
RLException: [map.launch] is neither a launch file in package [provide_map] nor is [provide_map] a launch file name
The traceback for the exception was written to the log file

I am getting this error, i am unable to launch it

For proper context, please make a separate post for the problem you are having.