Robotics StackExchange | Archived questions

How to watch to topic while testing?

Hello,

I have several nodes that communicate with each other in one direction. I have tested each node with googletest and rostest and they all seem fine. Now I wanted to create integrated tests. For this, I created a mocknode that publishes to the first topic and receives the messages from the last topic. But the result is not as expected. So I want to look into the topics with rostopic echo to analyse the messages. But this doesn't work because rostopic echo doesn't see anything. Can someone explain me why I can't see anything and how I can watch to my topics while I run my test file?

Asked by Theremin1 on 2022-09-13 09:59:55 UTC

Comments

Answers

I used for my tests catkin run_tests my_package. This will create probably his own master node, which cannot be accessed by the rostopic echo. So I have to use the same master node for the tests and the observation.

1) start master node with roscore

2) start the monitoring of the topic with rostopic echo my_topic

3) start your rostests with rostest --reuse-master my_package my_test_file.test

Asked by Theremin1 on 2022-09-14 09:23:05 UTC

Comments