ResourceNotFound error with rostest absolute path to launch file
Hi,
I have a bunch of "*.launch" files which starts different nodes on my machine. Since, these launch files are not specific to any package, I have kept these files in the catkin workspace directory.
catkin_workspace/src/<pkg1>, <pkg2>
catkin_workspace/mylaunch.launch
After running catkin_make and source devel.setup.sh I can run my launch file from anywhere just by supplying path to launch file.
cd catkin_worksapce
roslaunch mylaunch.launch
and it starts the configured nodes as desired.
Now I am trying to add test tags to this launch file as well. I followed the wiki page rostest. However running the rostest as follows throws ResourceNotFound error.
cd catkin_workspace
rostest mylaunch.test
I am able to run the same test+launch file if I put it under src/<package1>/mylaunch.launch and run by
rostest src/<pkg1>/mylaunch.launch.
Anyone can shed light on this problem?To me it seems to a bug. Because rostest should work similar to roslaunch.
As per Dirk's advice updating the tracestack of exception
... logging to /home/dev/.ros/log/rostest-localhost-32420.log
Traceback (most recent call last):
File "/opt/ros/indigo/bin/rostest", line 36, in <module>
rostestmain()
File "/opt/ros/indigo/lib/python2.7/dist-packages/rostest/__init__.py", line 268, in rostestmain
_main()
File "/opt/ros/indigo/lib/python2.7/dist-packages/rostest/rostest_main.py", line 126, in rostestmain
pkg_dir = r.get_path(pkg)
File "/usr/lib/pymodules/python2.7/rospkg/rospack.py", line 190, in get_path
raise ResourceNotFound(name, ros_paths=self._ros_paths)
rospkg.common.ResourceNotFound
The launch file
<launch>
<node
pkg="listner"
type="listner.py"
name="listner"
output="screen"
/>
<node
pkg="talker"
type="talker.py"
name="talker"
/>
<param name="hztest1/topic" value="chatter" />
<param name="hztest1/hz" value="10.0" />
<param name="hztest1/hzerror" value="0.5" />
<param name="hztest1/test_duration" value="5.0" />
<test test-name="hztest_test" pkg="rostest" type="hztest" name="hztest1"/>
</launch>
It might help if out post the exact error message which will contain the name of the not found resource.
Please format the posted stacktrace in a readable way. It also looks like it is truncated. When I force this I get output similar to this:
rospkg.common.ResourceNotFound: test_rosparam
followed by some lines listing theROS_PACKAGE_PATH
.Usually the
ResourceNotFound
exception should print the package name which was not found. You could tweak the file locally to print the name in question. Also try runningrospack profile
to refresh your cache.@Dirk Thomas, Sorry I was busy in other task so couldn't reply yesterday.
rospack profile
didn't solved the problem. Thepackage name
inRosPack
isNone
. But when you are providing absolute path package name is expected to beNone
, right?The package name is not based on the launch file you invoke. It is coming from somewhere in your launch file. Can you please post your lunch file?
And you do have two packages with the names
listner
andtalker
? And you can manually run these nodes usingrosrun listner listner.py
androsrun talker talker.py
?Yes. I can run these packages individually as well with roslauch and rostest with package name. I trying to compare the source code for roslaunch and rostest to figure out the difference, just swamped with other tasks.