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

This is only a half-answer, which I've figured out while debugging a similar problem.

Yes, test nodes do publish to rosout, however, the rosout node that subscribes to these messages and publishes rosout_agg is not started by rostest.

Running my test via rostest creates a ~/.ros/log/rostest-computer-PID.log file that does say, [roslaunch][INFO] 2020-06-01 10:51:35,758: Added core node of type [rosout/rosout] in namespace [/], but has no other mention of a rosout node. By comparison, when running roslaunch the resulting log in ~/.ros/log/latest/roslaunch-computer-PID.log has this line, but also has a lot more about actually starting the node and publishing rosout_agg.

To verify my theory, I also just had my node subscribe directly to rosout instead of rosout_agg, and it did get messages and work properly.

Update: I found a workaround. Simply launch your own rosout node in your .test file, with a different name, and it works just like roslaunch:

<node name="my_rosout" pkg="rosout" type="rosout" />

This is only a half-answer, which I've figured out while debugging a similar problem.

Yes, test nodes do publish to rosout, however, the rosout node that subscribes to these messages and publishes rosout_agg is not started by rostest.

Running my test via rostest creates a ~/.ros/log/rostest-computer-PID.log file that does say, [roslaunch][INFO] 2020-06-01 10:51:35,758: Added core node of type [rosout/rosout] in namespace [/], but has no other mention of a rosout node. By comparison, when running roslaunch the resulting log in ~/.ros/log/latest/roslaunch-computer-PID.log has this line, but also has a lot more about actually starting the node and publishing rosout_agg.

To verify my theory, I also just had my node subscribe directly to rosout instead of rosout_agg, and it did get messages and work properly.