Strange problem with ROSLaunchParent
Hello all, my first post on this forum!
I have a strange problem trying to launch a launch file using ROSLaunchParent.
I have a node I am trying to launch using a launch file:
<launch>
<!-- Launch the robot_localization node -->
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_symeter" clear_params="true">
<rosparam command="load" file="$(find symeter2)/config/ekf_config.yaml" />
</node>
</launch>
which is named symeter2_nav.launch
, and which belongs to a package named symeter2
.
If I attempt to launch through the command line interface, all goes well:
$ roslaunch symeter2 symeter2_nav.launch
... logging to /home/tellus-user/.ros/log/1eef2bb4-68a6-11e8-b842-48e2444fe644/roslaunch-pcrouge-720.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.
started roslaunch server http://pcrouge:37605/
SUMMARY
========
CLEAR PARAMETERS
* /ekf_symeter/
PARAMETERS
* /ekf_symeter/acceleration_gains: [1.0, 0.0, 0.0, 0...
* /ekf_symeter/acceleration_limits: [20, 20, 20, 3, 3...
.....
However, if I try to launch the exact same launch file programmatically using the following code:
import roslaunch
class MyPlugin(Plugin):
...
def startnav_pressed(self):
self.launch_startnav()
return
...
def launch_startnav(self):
uuid = roslaunch.rlutil.get_or_generate_uuid(None, False)
roslaunch.configure_logging(uuid)
cli_args = ['symeter2', 'symeter2_nav.launch']
roslaunch_file = roslaunch.rlutil.resolve_launch_arguments(cli_args)
roslaunch_arg = []
launch = roslaunch.parent.ROSLaunchParent(uuid, [(roslaunch_file, roslaunch_arg)])
rospy.loginfo("roslaunch_file is %s", roslaunch_file)
launch.start()
the calling node crashes with the following message:
[INFO] [1528297147.923750, 6.622000]: roslaunch_file is ['/home/tellus-user/Bureau/StageSebh/repos/testgazebo/src/symeter2/launch/symeter2_nav.launch']
Traceback (most recent call last):
File "/home/tellus-user/Bureau/StageSebh/repos/testgazebo/src/symeter2_gui/src/symeter2_gui/my_module.py", line 80, in startnav_pressed
self.launch_startnav()
File "/home/tellus-user/Bureau/StageSebh/repos/testgazebo/src/symeter2_gui/src/symeter2_gui/my_module.py", line 114, in launch_startnav
launch.start()
File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/parent.py", line 271, in start
self._start_infrastructure()
File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/parent.py", line 220, in _start_infrastructure
self._load_config()
File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/parent.py", line 135, in _load_config
roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
File "/opt/ros/lunar/lib/python2.7/dist-packages/roslaunch/config.py", line 459, in load_config_default
raise RLException(e)
roslaunch.core.RLException: Invalid roslaunch XML syntax: 'list' object has no attribute 'read'
which is strange as my launch file has no list
object. Has anybody got any idea to what is going on?
My environment is * /rosdistro: lunar * /rosversion: 1.13.6 on Ubuntu 16.04