0
$\begingroup$

Rosanswers logo

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?


Originally posted by pravardhan on ROS Answers with karma: 38 on 2020-05-09

Post score: 0


Original comments

Comment by gvdhoorn on 2020-05-10:
It would help if you could show the verbatim output of both roslaunch start_demo.launch and roslaunch learning_tf2 start_demo.launch.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by pravardhan with karma: 38 on 2020-05-18

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.