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

roslaunch is not launching all nodes

asked 2020-05-09 17:16:18 -0500

pravardhan gravatar image

I am using ros melodic on ubuntu18. I was following the tutorials on tf2, so after going through the broadcaster and listener, the start demo launch file is not launching the listener node. What is even weirder to me is that it works (without giving an error) when I launch the file directly from the folder i.e.

roslaunch start_demo.launch

instead of

roslaunch learning_tf2 start_demo.launch

Here is my launch file

<launch>
<node pkg="turtlesim" type="turtlesim_node" name="sim"/>
<node pkg="turtlesim" type="turtle_teleop_key" name="teleop" output="screen"/>


<node name="turtle1_tf2_broadcaster" pkg="learning_tf2" type="turtle_tf2_broadcaster.py" respawn="false" output="screen" >
  <param name="turtle" type="string" value="turtle1" />
</node>
<node name="turtle2_tf2_broadcaster" pkg="learning_tf2" type="turtle_tf2_broadcaster.py" respawn="false" output="screen" >
  <param name="turtle" type="string" value="turtle2" /> 
</node>
<node name="turtle_listener" pkg="learning_tf2" type="turtle_tf2_listener.py" output="screen"/></launch>

I have done things like deleting my devel and build folders, running catkin_make, sourcing setup.bash, but still the same issue. Am I missing something here? When I run from the folder directly:

NODES
  /
    sim (turtlesim/turtlesim_node)
    teleop (turtlesim/turtle_teleop_key)
    turtle1_tf2_broadcaster (learning_tf2/turtle_tf2_broadcaster.py)
    turtle2_tf2_broadcaster (learning_tf2/turtle_tf2_broadcaster.py)
    turtle_listener (learning_tf2/turtle_tf2_listener.py)

When I reference through package:

NODES
  /
    sim (turtlesim/turtlesim_node)
    teleop (turtlesim/turtle_teleop_key)
    turtle1_tf2_broadcaster (learning_tf2/turtle_tf2_broadcaster.py)
    turtle2_tf2_broadcaster (learning_tf2/turtle_tf2_broadcaster.py)

It's the same launch file! What am I missing here?

edit retag flag offensive close merge delete

Comments

It would help if you could show the verbatim output of both roslaunch start_demo.launch and roslaunch learning_tf2 start_demo.launch.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-10 03:59:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-05-18 01:40:30 -0500

pravardhan gravatar image

I am sorry, I realized the mistake later. What's happening is that I had another workspace with the same package name and it was sourced last in my bashrc, hence the launch file in that package was getting called which didn't have all the nodes in it. When sourced correctly, it was indeed pointing to the correct launch file and all nodes ran as expected.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-05-09 17:16:18 -0500

Seen: 415 times

Last updated: May 18 '20