Documentation Index
Fetch the complete documentation index at: https://docs.roboticks.io/llms.txt
Use this file to discover all available pages before exploring further.
Launch testing
launch_testing is the ROS2 standard for system tests — tests that bring up real nodes, real topics, real lifecycle transitions, and assert on the outside-the-box behaviour. The Roboticks SDK ships three thin helpers to make the boilerplate tolerable.
Use pytest with rclpy helpers for unit and integration tests. Use launch_testing when the thing under test is a graph of nodes and you need to assert across their boundaries.
The three helpers
| Helper | Purpose |
|---|---|
make_node_action(package, executable, **kwargs) | Builds a launch_ros.actions.Node with sensible defaults (output to screen, parameters from dict, namespaced). |
generate_test_description(*actions, ready_event=None) | Wraps a list of actions in the dance launch_testing demands: launch description, ready-fn, return-tuple. |
spin_node(node, *, within) | Spins a single rclpy node for a bounded duration, useful inside the post_shutdown phase. |
Integration vs system tests
| Pattern | Bring up | Assert via | Typical fixture |
|---|---|---|---|
| Integration test | One node, in-process | assert_topic_published from roboticks.assertions | pytest fixture |
| System test | Two-or-more nodes, separate processes | Subscribed observers + launch_testing assertions | generate_test_description |
A complete example: navigation stack handshake
This test brings up the planner and controller, sends a goal, and asserts the controller publishes/cmd_vel within 5 seconds.
Why the helpers exist
Vanillalaunch_testing makes you assemble four things every test:
- A
LaunchDescriptionofNodeactions. - A
ReadyToTest()sentinel. - A
pytest_markerhook. - A
return (description, context_dict)tuple.
generate_test_description() collapses that into one call. make_node_action() collapses the per-node arg-soup. spin_node() saves you re-typing the rclpy executor dance in post_shutdown.
post_shutdown assertions
For checks that need the nodes gone (clean shutdown, log content, no orphaned processes), uselaunch_testing.post_shutdown_test():
Routing to a runner
Alaunch_testing test ID is <file>::generate_test_description::<TestClass>::<test_method>. The Roboticks scheduler treats it like any other pytest test for routing — @requires_sim on the class (or the function) tells the job router to land on a sim runner. See Sim runners.
Next
Fault injection
Inject faults into the running system from inside a launch test.
MCAP capture
Record the launched graph for replay during failure triage.
Sim runners
Pick Gazebo Harmonic or Webots; control hosted vs self-hosted GPU pools.
Pytest tests
For the simpler in-process case.