-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get content of topic from launch_testing_ros::WaitForTopics
#346
Comments
If you deem this feature useful, I would be available to implement it and make a pull request. |
Hi @LastStarDust ! That is a good suggestion. While
If you could open a PR, I'll be happy to review it. |
Signed-off-by: Giorgio Pintaudi [email protected] ros2#346
@adityapande-1995 Hello. Thank you for your feedback. I created a pull request #353 for this feature as you suggested. |
ros2#346 Signed-off-by: Pintaudi Giorgio <[email protected]>
ros2#346 Signed-off-by: Pintaudi Giorgio <[email protected]>
* Get content of topic from launch_testing_ros::WaitForTopics #346 Signed-off-by: Pintaudi Giorgio <[email protected]> --------- Signed-off-by: Pintaudi Giorgio <[email protected]>
Hello, I would like to re-iterate how important this feature is for creating production-ready ROS code that is tested at the middleware level. In following the V-model of development in commercial projects that use ROS 2, it is very important to have tooling to send and receive messages, services, and actions to validate that the behavior of a node is in line with the requirements, and to be able to have reliable automated tests that can prove adherence to the requirements. Asserting that the node published a message, but ignoring the content is not sufficient enough of a test to demonstrate adherence to design requirements for any asynchronous publishers. A great example is to check that the header timestamp is not zero and is the same as the event that triggered the publish. If a node receives an event, and a developer incorrectly uses the wrong timestamping by calling Currently, my team is maintaining a layer on top of launch_ros to perform this kind of testing, and would much prefer to work with the ROS community to improve test infrastructure. Being able to have a batteries-included test infrastructure will help companies focus on testing their node behaviors rather than writing boilerplate or infra. LastStarDust has put a great amount of work to supporting this kind of testing, however his work hasn't gotten to humble where it can be used in production. I ask the maintainers and OSRC to focus some renewed time and energy on contributions that support the production testing of ROS 2. |
* Get content of topic from launch_testing_ros::WaitForTopics #346 Signed-off-by: Pintaudi Giorgio <[email protected]> --------- Signed-off-by: Pintaudi Giorgio <[email protected]> (cherry picked from commit 2d125a5)
* Get content of topic from launch_testing_ros::WaitForTopics #346 Signed-off-by: Pintaudi Giorgio <[email protected]> --------- Signed-off-by: Pintaudi Giorgio <[email protected]> (cherry picked from commit 2d125a5) Signed-off-by: Aditya Pande <[email protected]>
* Get content of topic from launch_testing_ros::WaitForTopics #346 Signed-off-by: Pintaudi Giorgio <[email protected]> --------- Signed-off-by: Pintaudi Giorgio <[email protected]> (cherry picked from commit 2d125a5) # Conflicts: # launch_testing_ros/launch_testing_ros/wait_for_topics.py # launch_testing_ros/test/examples/wait_for_topic_launch_test.py
* Get content of topic from launch_testing_ros::WaitForTopics #346 Signed-off-by: Pintaudi Giorgio <[email protected]> --------- Signed-off-by: Pintaudi Giorgio <[email protected]> (cherry picked from commit 2d125a5) # Conflicts: # launch_testing_ros/launch_testing_ros/wait_for_topics.py # launch_testing_ros/test/examples/wait_for_topic_launch_test.py Signed-off-by: Aditya Pande <[email protected]>
* Get content of topic from launch_testing_ros::WaitForTopics #346 Signed-off-by: Pintaudi Giorgio <[email protected]> --------- Signed-off-by: Pintaudi Giorgio <[email protected]> (cherry picked from commit 2d125a5) # Conflicts: # launch_testing_ros/launch_testing_ros/wait_for_topics.py # launch_testing_ros/test/examples/wait_for_topic_launch_test.py Signed-off-by: Aditya Pande <[email protected]>
* Get content of topic from launch_testing_ros::WaitForTopics #346 --------- (cherry picked from commit 2d125a5) Signed-off-by: Pintaudi Giorgio <[email protected]> Signed-off-by: Aditya Pande <[email protected]> Co-authored-by: Giorgio Pintaudi <[email protected]>
… (#389) * `WaitForTopics`: get content of messages for each topic (#353) * Get content of topic from launch_testing_ros::WaitForTopics #346 Signed-off-by: Pintaudi Giorgio <[email protected]> --------- Signed-off-by: Pintaudi Giorgio <[email protected]> (cherry picked from commit 2d125a5) # Conflicts: # launch_testing_ros/launch_testing_ros/wait_for_topics.py # launch_testing_ros/test/examples/wait_for_topic_launch_test.py Signed-off-by: Aditya Pande <[email protected]> * Resolve conflicts (#390) Signed-off-by: Ryan Friedman <[email protected]> Signed-off-by: Aditya Pande <[email protected]> --------- Signed-off-by: Pintaudi Giorgio <[email protected]> Signed-off-by: Aditya Pande <[email protected]> Signed-off-by: Ryan Friedman <[email protected]> Co-authored-by: Giorgio Pintaudi <[email protected]> Co-authored-by: Ryan <[email protected]>
This is now backported to all active distros. It is now solved. Please close the issue as completed. |
Closing as solved by #353 |
Feature request
Feature description
In the
WaitForTopics
sample code here, I see how I can easily test that a node has published a topic with a certain name, but it is not shown how to test the actual content of the topic.It would be very helpful if the content of the topic could be available to the tester, too.
Implementation considerations
Looking deeper at the source code here, it seems that only the topic name is stored.
Because of Python duck-typing it should be more or less easy to just return the content of the topic. Something like
where
self.received_messages
is a dictionary where the key is the topic name and the value is the list of received messages. Just as an example.The text was updated successfully, but these errors were encountered: