Robotics StackExchange | Archived questions

Using multiple launch files from universal_robot_package in one launch file

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 ur5moveitconfig ur5moveitplanning_execution.launch sim:=true limited:=true

roslaunch ur5moveitconfig 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

Asked by EdwinvanEmmerik on 2017-10-22 08:50:43 UTC

Comments

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?

Asked by gvdhoorn on 2017-10-23 02:26:17 UTC

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

Asked by EdwinvanEmmerik on 2017-10-23 08:33:54 UTC

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.

Asked by Francisco on 2017-10-24 23:23:38 UTC

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!

Asked by EdwinvanEmmerik on 2017-10-26 03:33:22 UTC

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)?

Asked by gvdhoorn on 2017-10-26 03:50:56 UTC

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!

Asked by EdwinvanEmmerik on 2017-10-26 10:11:39 UTC

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.

Asked by gvdhoorn on 2017-10-26 10:27:09 UTC

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?

Asked by EdwinvanEmmerik on 2017-10-27 11:54:32 UTC

I think I wrote "not supposed to", but yes, metapackages should not contain any files other than those that make it a metapackage. Please see reps/rep-0140.html#metapackage.

Asked by gvdhoorn on 2017-10-27 14:33:17 UTC

Answers