I am currently stuck on how to prepare the launch file in order to launch the map_server node in the map_server package to load the map I created called ‘my_map’. How do you go about with this?
This is what I have done so far…but i’m getting an error saying:
ERROR: cannot launch node of type [provide_map/map_server]: Cannot locate node of type [map_server] in package [provide_map]. Make sure file exists in package path and permission is set to executable (chmod +x). The launch file does have executable permission.
@RA2004
If you are referring to the following exercise, then it didn’t ask you to create a launch file, only to use rosrun. Launch files are not needed for rosrun..
In any case, if you want to create a launch file for the command, your pkg (package) would be map_server, not provide_map as you specified in your launch file.
PS: this course assumes that you have a knowledge of ROS Basics. If you don’t have it, then I recommend that you take the ROS Basics in 5 Days course.
My bad….it’s exercise 2.5, I’ve tried it with changing the pkg to map_server, but I’m still getting an error. Would the type and node also be map_server? What I’m confused abt is that in the ROS basics course…normally the type argument is a python file, so what would it be in this case?
What error are you getting? Paste your updated launch file and the error message here. Take a screenshot of the error, including the command you ran that gave the error.
Something like this should work. Make sure you compile and source your workspace first:
That was my launch file. The error I was getting was:
[ERROR] [1697188821.561966561]: Map_server could not open /home/user/catkin_ws/src/my_map.yaml.
[map_server-1] process has died [pid 2785, exit code 255, cmd /opt/ros/noetic/lib/map_server/map_server /home/user/catkin_ws/src/my_map.yaml __name:=map_server __log:=/home/user/.ros/log/d9ac2698-69a7-11ee-a81f-0242ac1c0006/map_server-1.log].
log file: /home/user/.ros/log/d9ac2698-69a7-11ee-a81f-0242ac1c0006/map_server-1*.log
I’ve tried it with your code for the launch file as well but I’m getting the same error. Also, can I ask why the name argument is provide_map (if that is the name of the package that I was meant to create)?
the command i ran was: roslaunch provide_map launch_file.launch
Is this the correct location of the map file? Did you create the map file?
The name argument can be anything meaningful, such as provide_map_via_map_server.
That’s the name your node will have on the operation system (OS) when launched. Usually the OS will add something to it (in this case provide_map becomes provide_map-1).