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

Killing a node that is set to respawn=true is not possible as explained here

However, reading the output of the node from another terminal or even GUI is totally feasible!

  1. Use ros logging system ROS_[DEBUG/INFO/WARN/ERROR]_STREAM... for C++ instead of cout (rospy.log[debug/info...] instead of print for python).
  2. Remove the output=screen from your launch, this will avoid having the log printed out in the same terminal from which you launch all your nodes
  3. Set the logging level of your node to the level needed, from within the code, via rqt_logger_level, or even with a configuration file
  4. You can now read the logs with any of those solutions:
  5. via another terminal with rosconsole echo /node/name
  6. rqt_console , you'll need to filter out the node you're looking for
  7. swri_console which is a replacement for rqt_console, that is my prefered solution

Also note that you can use different logger names for different part of your code, and filter the logs you need by setting different log level for each logger via rosconsole, rqt_logger_level, or swri_console. If you need more debugging tools, you can event change the LOG_FORMAT to include the node name, function name, or even the ligne of code from which the log comes from.

Hope it helps !