|Tags||No category tags.|
|License||Apache License 2.0|
- Mabel Zhang
- Shane Loretz
- Aditya Pande
Launch testing examples
This package contains simple use cases for the
These are designed to help beginners get started with these packages and help them understand the concepts.
There might be situations where nodes, once launched, take some time to actually start and we need to wait for the node to start to perform some action.
We can simulate this using
launch.actions.TimerAction. This example shows one way to detect when a node has been launched.
We delay the launch by 5 seconds, and wait for the node to start with a timeout of 8 seconds.
Consider a problem statement where you need to launch a node and check if messages are published on a particular topic.
This example demonstrates how to do that, using a talker node.
It uses the
Event object to end the test as soon as the first message is received on the chatter topic, with a timeout of 5 seconds.
This example demonstrates how to launch a node, set a parameter in it and check if that was successful.
This test is a simple example on how to use the
It launches a process and asserts that it prints "hello_world" to
Finally, it checks if the process exits normally (zero exit code).
@launch_testing.markers.keep_alive decorator ensures that the launch process stays alive long enough for the tests to run.