ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rosbuild_add_roslaunch_check fails for included files using launch file arguments

asked 2012-07-08 21:25:03 -0500

weisshardt gravatar image

updated 2012-07-09 06:50:54 -0500

joq gravatar image

Hi,

maybe this is a very special usecase but I encountered some missmatching between the behaviour of roslaunch and the result of rosbuild_add_roslaunch_check.

In detail: I tried to setup a launch file with

<?xml version="1.0"?>
<launch>

<!-- define arg -->
<arg name="pkg_arg" default="$(find my_pkg)"/>

<!-- use arg -->
<param name="param1" value="$(arg pkg_arg)"/> <!-- this is working, test is ok -->
<include file="$(arg pkg_arg)/included.launch"/> <!-- this is working too, but test fails-->

</launch>

trying to use a launch file argument to find an include file. The behaviour when roslaunching the file is fine, the parameter gets uploaded and the included.launch file gets included. Perfect. But when I add a rosbuild_add_roslaunch_check for that file I get

Traceback (most recent call last):
  File "/opt/ros/electric/stacks/ros_comm/tools/rostest/bin/roslaunch-check.py", line 86, in <module>
error_msg = check_roslaunch_file(roslaunch_path)
  File "/opt/ros/electric/stacks/ros_comm/tools/rostest/bin/roslaunch-check.py", line 48, in check_roslaunch_file
error_msg = roslaunch.rlutil.check_roslaunch(roslaunch_file)
  File "/opt/ros/electric/stacks/ros_comm/tools/roslaunch/src/roslaunch/rlutil.py", line 206, in check_roslaunch
base_pkg, file_deps, missing = roslaunch.depends.roslaunch_deps([f])
  File "/opt/ros/electric/stacks/ros_comm/tools/roslaunch/src/roslaunch/depends.py", line 239, in roslaunch_deps
rl_file_deps(file_deps, launch_file, verbose)
  File "/opt/ros/electric/stacks/ros_comm/tools/roslaunch/src/roslaunch/depends.py", line 146, in rl_file_deps
parse_launch(launch_file, file_deps, verbose)
  File "/opt/ros/electric/stacks/ros_comm/tools/roslaunch/src/roslaunch/depends.py", line 131, in parse_launch
_parse_launch(launch_tag.childNodes, launch_file, file_deps, verbose)
  File "/opt/ros/electric/stacks/ros_comm/tools/roslaunch/src/roslaunch/depends.py", line 82, in _parse_launch
sub_launch_file = resolve_args(tag.attributes['file'].value)
  File "/opt/ros/electric/ros/core/roslib/src/roslib/substitution_args.py", line 216, in resolve_args
resolved = _arg(resolved, a, args, context)
  File "/opt/ros/electric/ros/core/roslib/src/roslib/substitution_args.py", line 167, in _arg
raise ArgException(arg_name)
roslib.substitution_args.ArgException: pkg_arg

My guess is that something in the cmake macro for checking roslaunch files is wrong. Can somebody point me to the right location?

Best, Florian

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-07-09 20:36:37 -0500

weisshardt gravatar image

The argument pkg_arg get substituted by the absolute path to the package my_pkg which could for example be the string /home/user/ros/my_pkg. Hence rosbuild_add_roslaunch_check could check the current ROS_PACKAGE_PATH for the existence of this package and the file included.launch as roslaunch does when executing. The value for the argument is determined by the current ROS_PACKAGE_PATH which can be checked offline in my opinion.

By the way, the behaviour is the same as hardcoding the argument to point to my_pkg:

<arg name="pkg_arg" default="/home/user/ros/my_pkg"/>

So why shouldn't it be possible to check this?

edit flag offensive delete link more

Comments

Because rosbuild_add_roslaunch_check() runs during make test, and that argument is not set until the launch file actually runs.

joq gravatar image joq  ( 2012-07-10 04:46:09 -0500 )edit
0

answered 2012-07-09 06:54:10 -0500

joq gravatar image

I don't see how rosbuild_add_roslaunch_check could possibly work in this case, since the package name is not known until the launch file is invoked.

What would you expect it to do?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-07-08 21:25:03 -0500

Seen: 262 times

Last updated: Jul 09 '12