python API for roslaunch with parameter

asked 2019-03-10 09:11:08 -0500

I want to run a roslaunch file with parameter, I follow this tutorial:

import roslaunch
uuid = roslaunch.rlutil.get_or_generate_uuid(None, False)
cli_args = ['/home/m/catkin_ws/src/rl_nav/launch/nav_gazebo.launch','maze_id:=2']
roslaunch_args = cli_args[1:]
roslaunch_file = [(roslaunch.rlutil.resolve_launch_arguments(cli_args)[0], roslaunch_args)]
parent = roslaunch.parent.ROSLaunchParent(uuid, roslaunch_file)

But when I run this script, there is an error:

TypeError: not all arguments converted during string formatting

Why does it and how can I solve it? Thank you.

edit retag flag offensive close merge delete


Hey, did you ever find a solution for this problem? I am having the same issue. Cheers!

MrSquid gravatar image MrSquid  ( 2019-05-14 02:52:42 -0500 )edit

Any update?

achmad_fathoni gravatar image achmad_fathoni  ( 2019-07-01 04:18:19 -0500 )edit

I have the same problem. There seems to be discrepancy between the documentation and the code. The code expects a list of strings, but the documentation indicates using a list of tuples of strings.

samarth.robo gravatar image samarth.robo  ( 2019-09-07 14:08:24 -0500 )edit