Ros Tutorial Launch files #2 and #6 throw raise ResourceNotFound(name, ros_paths=self._ros_paths) error

tutorial_1.launch worked successfully.

Errors for tutorial_2 and tutorial_6

husarion@husarion:~/GHRosBotTutorials/tutorial_pkg/launch$ roslaunch tutorial_2.launch
… logging to /home/husarion/.ros/log/bffac51c-5afa-11e9-a446-80c5f2fe70a5/roslaunch-husarion-17165.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/init.py”, line 306, in main
p.start()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py”, line 268, in start
self._start_infrastructure()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py”, line 217, in _start_infrastructure
self._load_config()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py”, line 132, in _load_config
roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/config.py”, line 451, in load_config_default
loader.load(f, config, verbose=verbose)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 749, in load
self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 721, in _load_launch
self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 685, in _recurse_load
val = self._include_tag(tag, context, ros_config, default_machine, is_core, verbose)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 95, in call
return f(*args, **kwds)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 589, in _include_tag
inc_filename = self.resolve_args(tag.attributes[‘file’].value, context)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 183, in resolve_args
return substitution_args.resolve_args(args, context=context.resolve_dict, resolve_anon=self.resolve_anon)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py”, line 370, in resolve_args
resolved = _resolve_args(resolved, context, resolve_anon, commands)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py”, line 383, in _resolve_args
resolved = commands[command](resolved, a, args, context)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py”, line 151, in _find
source_path_to_packages=source_path_to_packages)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py”, line 197, in _find_executable
full_path = _get_executable_path(rp.get_path(args[0]), path)
File “/usr/lib/python2.7/dist-packages/rospkg/rospack.py”, line 203, in get_path
raise ResourceNotFound(name, ros_paths=self._ros_paths)
ResourceNotFound: tutorial_pkg
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/opt/ros/kinetic/share

husarion@husarion:~/GHRosBotTutorials/tutorial_pkg/launch$ roslaunch tutorial_6.launch
… logging to /home/husarion/.ros/log/bffac51c-5afa-11e9-a446-80c5f2fe70a5/roslaunch-husarion-22281.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/init.py”, line 306, in main
p.start()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py”, line 268, in start
self._start_infrastructure()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py”, line 217, in _start_infrastructure
self._load_config()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py”, line 132, in _load_config
roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/config.py”, line 451, in load_config_default
loader.load(f, config, verbose=verbose)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 749, in load
self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 721, in _load_launch
self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 685, in _recurse_load
val = self._include_tag(tag, context, ros_config, default_machine, is_core, verbose)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 95, in call
return f(*args, **kwds)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 589, in _include_tag
inc_filename = self.resolve_args(tag.attributes[‘file’].value, context)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py”, line 183, in resolve_args
return substitution_args.resolve_args(args, context=context.resolve_dict, resolve_anon=self.resolve_anon)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py”, line 370, in resolve_args
resolved = _resolve_args(resolved, context, resolve_anon, commands)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py”, line 383, in _resolve_args
resolved = commands[command](resolved, a, args, context)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py”, line 151, in _find
source_path_to_packages=source_path_to_packages)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py”, line 197, in _find_executable
full_path = _get_executable_path(rp.get_path(args[0]), path)
File “/usr/lib/python2.7/dist-packages/rospkg/rospack.py”, line 203, in get_path
raise ResourceNotFound(name, ros_paths=self._ros_paths)
ResourceNotFound: tutorial_pkg
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/opt/ros/kinetic/share

Hello Jim,

Reading from the last three lines of the error log:

ResourceNotFound: tutorial_pkg
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/opt/ros/kinetic/share

Package tutorial_pkg can not be found and search paths are /opt/ros/kinetic/share/ros and /opt/ros/kinetic/share.

Package tutorial_pkg is in workspace that you created, thus you need to load package search paths with command:

cd ~/GHRosBotTutorials
source devel/setup.sh

These command needs to be executed each time you open new terminal or you can add them to .bashrc file in home directory.

Regards,
Łukasz

That didn’t work:

husarion@husarion:~/GHRosBotTutorials$ cd ~/GHRosBotTutorials
husarion@husarion:~/GHRosBotTutorials$ source devel/setup.sh
bash: devel/setup.sh: No such file or directory
husarion@husarion:~/GHRosBotTutorials$

Have you initialized and built your workspace?

cd ~/GHRosBotTutorials/src
catkin_init_workspace
cd ~/GHRosBotTutorials
catkin_make

After this operation you should have two new folders in your workspace: build and devel, thesecond one should contain setup.sh file.

Regards,
Łukasz

so should the directory tutorial_pkg (the download of the github collection of tutorials) be moved to ~/GHRosBotTutorials/src/tutorial_pkg from ~/GHRosBotTutorials/tutorial_pkg ?

looking at the catkin cheat sheet Releases · ros/cheatsheet · GitHub fro does appear the packages should be in the src sub directory.

Yet another problem!!!

Now when I run roslaunch i get this:

husarion@husarion:~/GHRosBotTutorials$ roslaunch tutorial_pkg tutorial_6.launch
… logging to /home/husarion/.ros/log/4783ade8-5d3d-11e9-b7f9-80c5f2fe70a5/roslaunch-husarion-12497.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

error loading tag:
file does not exist [/rosbot_conf.yaml]
XML is
The traceback for the exception was written to the log file
husarion@husarion:~/GHRosBotTutorials$

There was some updates in tutorial_pkg repository to make distinction between ROSbot 2.0 and ROSbot 2.0 PRO.
Now it needs a global variable ROSBOT_VER to be defined or have /rosbot_conf.yaml config file.

Easier way should be with ROSBOT_VER variable.
If you are working with ROSbot 2.0 define variable:

export ROSBOT_VER 2.0

And if you are working with ROSbot 2.0 PRO:

export ROSBOT_VER 2.0_PRO

You could add above line to .bashrc file if you do not want to set this variable every time you open new terminal.

Regards,
Łukasz