Using multiple launch files from universal_robot_package in one launch file [closed]

asked 2017-10-22 08:50:43 -0500

EdwinvanEmmerik gravatar image

updated 2017-10-23 08:33:09 -0500

Hi everyone!

Because everytime I want to work on my project I have to use these three commands:

roslaunch ur_gazebo ur5.launch limited:=true

roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true limited:=true

roslaunch ur5_moveit_config moveit_rviz.launch config:=true

Now I wanted to make my life easier and implement these three commands in a launch file and the results is shown below:

   ?xml version="1.0"?>
<launch>
    <!-- Startup ur5.launch with arg "limited" -->
    <include file="$(find ur_gazebo)/launch/ur5.launch">
        <arg name="limited" value="true"/>
    </include>
    <!-- Startup ur5_moveit_planning_execution.launch with args: sim:=true and limited:=true -->
    <include file="$(find ur5_moveit_config)/launch/ur5_moveit_planning_execution.launch">
        <arg name="sim" value="true"/>
        <arg name="limited" value="true"/>
    </include>
    <!-- Startup moveit_rviz.launch with arg: config:=true -->
    <include file="$(find ur5_moveit_config)/launch/moveit_rviz.launch">
        <arg name="config" value="true"/>
    </include>
</launch>

Only the ur5.launch will startup using gazebo. The rest of them just doesn't seem to react. I do know when spawning nodes it is different and that I could output to screen in different terminals and stuff like that.

I hope somebody can tell me what I am doing wrong.

EDIT: The other nodes do not start up (also visible in rqt) and I do not see any logging from these nodes (because they do not startup obviously).

Thanks in advance,

Edwin van Emmerik

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by EdwinvanEmmerik
close date 2017-10-26 03:34:07.633567

Comments

1

Please clarify what "just doesn't seem to react" means: launch files are passive, declarative entities, so they cannot 'react'. Are the nodes not being started? Do you not see any logging from those nodes that you'd expect to see? Something else?

gvdhoorn gravatar image gvdhoorn  ( 2017-10-23 02:26:17 -0500 )edit

I added some information, if something is unclear please say it just like u just did!

EdwinvanEmmerik gravatar image EdwinvanEmmerik  ( 2017-10-23 08:33:54 -0500 )edit
1

That's strange. I just tried your launch file (adding the missing < at the begging of the file) and it works as expected. One thing I would try is to lunch first ur_gazebo ur5.launch, after that, launch ur5_moveit_planning_execution.launch and moveit_rviz.launch together.

Francisco gravatar image Francisco  ( 2017-10-24 23:23:38 -0500 )edit

For some reason it couldn't read the file that I was assigning to. I think it had something to do with other files which had the same name. Mybad.. Thanks to you I knew the launch file worked though! Made me solve my problem!

EdwinvanEmmerik gravatar image EdwinvanEmmerik  ( 2017-10-26 03:33:22 -0500 )edit

For some reason it couldn't read the file that I was assigning to.

can you explain what this means?

What were you doing exactly (command line)?

gvdhoorn gravatar image gvdhoorn  ( 2017-10-26 03:50:56 -0500 )edit

I tried to 'roslaunch universal-robot my_file.launch' from the main package where all of my files where located. I needed to replace this launch file to the folder( I chose ur_gazebo) and then call 'roslaunch ur_gazebo my_file.launch'.

Rookie mistake!

EdwinvanEmmerik gravatar image EdwinvanEmmerik  ( 2017-10-26 10:11:39 -0500 )edit

Do I understand you correctly that you had the launch file in the metapackage (ie: universal_robot) instead of a regular package?

I'm not sure I understand how moving the launch file suddenly made it work.

Metapackages are not supposed to contain launch files, but that doesn't explain this.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-26 10:27:09 -0500 )edit

Hi,

I re-created the problem because you said: 'but that doesn't explain this.'. However it is giving me this error: 'myfile.launch is neither a launch file in package universal_robot nor is universal_robot a launch file name'. Why do you think this happens? Does 'supposed to' mean never?

EdwinvanEmmerik gravatar image EdwinvanEmmerik  ( 2017-10-27 11:54:32 -0500 )edit