Standard Test Nodes

hztest

hztest allows you test the publishing rate of a node. It reads in parameters that specify the topic name, rate, and error bounds of the test, and will succeed if the topic matches that specification. It can also be used to test for no publication, i.e. 0Hz. By default, hztest only tests the overall, average publication rate. This can be changed by setting the ~check_intervals parameter.

Here is a sample configuration:

<launch>
  <node name="talker" pkg="test_ros" type="talker.py" />

  <param name="hztest1/topic" value="chatter" />  
  <param name="hztest1/hz" value="10.0" />
  <param name="hztest1/hzerror" value="0.5" />
  <param name="hztest1/test_duration" value="5.0" />    
  <test test-name="hztest_test" pkg="rostest" type="hztest" name="hztest1" />
</launch>

Subscribed Topics

<value of ~topic> (any/any)
  • Topic to measure.

Parameters

~topic (str, default: None)
  • Name of topic to monitor.
~hz (float, default: None)
  • Expected rate of topic. Can be zero.
~hzerror (float, default: None)
  • Allowed error of publication rate. Required if hz != 0.0.
~test_duration (float, default: None)
  • Number of seconds to measure publication for.
~check_intervals (bool, default: False)
  • Check message-to-message interval, instead of just average overall publication rate.
~wait_time (float, default: 20.0)
  • (ROS 1.1) Number of seconds to allow node to initialize before receiving first message. If a message is not received from the node before the wait time is up, the test fails.
~wall_clock (bool, default: False)
  • (ROS 1.5) If True, then perform all rate measurements against wall clock time, regardless of whether simulation / log time is in effect.

selftest_test

selftest_test, in the self_test package, runs a self-test and checks that it passes. Please see the self_test package for more documentation.

Wiki: rostest/Nodes (last edited 2011-08-10 20:00:12 by KenConley)