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

Revision history [back]

click to hide/show revision 1
initial version

Hey mab0189!

The reason that you cannot see the log info is because your callback callc_listener.callback is never executed.

But why is that? Well in this case it is from the grouping of each node under a different namespace.

Your talker node is under the "talker" namespace meaning that (unless specified to be global) subscriptions are nested under that namespace. This means that your talker node is publishing to the topic /talker/Calc_Chatter and similarly your listener is listening on the topic /listener/Calc_Chatter. These two topics are clearly different and that is the root of your issue.

The solution is therefore to remove the (in this case) unneeded group tags that currently wrap your nodes in the launch file. try...

<launch>
    <node pkg="calculate" name="my_calc_talker" type="calc_talker.py" output="screen"/>
    <node pkg="calculate" name="my_calc_listener" type="calc_listener.py" output="screen"/>
</launch>

A few other notes.

  1. You can check my analysis of the topics by running rostopic list after launching your launch file.
  2. You are correct in that output="screen" is required for the logging to be visible when using the launch file.
  3. Namespacing is a tricky topic (I struggle with it still). you can read more on it here.