No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 0.13.0
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ros2/examples.git
VCS Type git
VCS Version master
Last Updated 2021-10-18
Dev Status MAINTAINED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Examples of simple launch tests

Additional Links

No additional links.

Maintainers

  • Mabel Zhang
  • Shane Loretz

Authors

  • Aditya Pande

Launch testing examples

This package contains simple use cases for the launch and launch_testing packages. These are designed to help beginners get started with these packages and help them understand the concepts.

Examples

check_node_launch_test.py

Usage:

launch_test launch_testing_examples/check_node_launch_test.py

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.

check_msgs_launch_test.py

Usage:

launch_test launch_testing_examples/check_msgs_launch_test.py

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.

set_param_launch_test.py

Usage:

launch_test launch_testing_examples/set_param_launch_test.py

This example demonstrates how to launch a node, set a parameter in it and check if that was successful.

hello_world_launch_test.py

Usage:

launch_test launch_testing_examples/hello_world_launch_test.py

This test is a simple example on how to use the launch_testing.

It launches a process and asserts that it prints "hello_world" to stdout using proc_output.assertWaitFor(). Finally, it checks if the process exits normally (zero exit code).

The @launch_testing.markers.keep_alive decorator ensures that the launch process stays alive long enough for the tests to run.

CHANGELOG

Changelog for package launch_testing_examples

0.13.0 (2021-10-18)

  • Reverted WaitForTopics utility usage (#326)
  • Moved examples (#324)
  • Contributors: Aditya Pande

0.12.0 (2021-08-05)

0.11.2 (2021-04-26)

0.11.1 (2021-04-12)

0.11.0 (2021-04-06)

0.10.3 (2021-03-18)

0.10.2 (2021-01-25)

0.10.1 (2020-12-10)

0.10.0 (2020-09-21)

0.9.2 (2020-06-01)

0.9.1 (2020-05-26)

0.9.0 (2020-04-30)

0.8.2 (2019-11-19)

0.8.1 (2019-10-24)

0.8.0 (2019-09-26)

0.7.3 (2019-05-29)

0.7.2 (2019-05-20)

0.7.1 (2019-05-08)

0.7.0 (2019-04-14)

0.6.2 (2019-02-08)

0.6.1 (2018-12-07)

0.6.0 (2018-11-20)

0.5.1 (2018-06-27)

0.5.0 (2018-06-26)

0.4.0 (2017-12-08)

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing_examples at answers.ros.org

No version for distro noetic. Known supported distros are highlighted in the buttons above.
No version for distro melodic. Known supported distros are highlighted in the buttons above.
No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.