Skip to content

Launch tests

This module contains launch test case implementations

Classes:

TestTopographyCase(*args, **kwargs)Tests that all nodes initialize with the correct ROS topic subscriptions

class test.launch.testcases.TestTopographyCase(*args, **kwargs)

Bases: TestCase

Tests that all nodes initialize with the correct ROS topic subscriptions

Initializer override for declaring attributes used in the test case

Attributes:

EXPECTED_NAMESPACESExpected namespaces of EXPECTED_NODES in corresponding order
EXPECTED_NODESNames of nodes that should be found when running the launch configuration
EXPECTED_TOPICSNames of topics that should be found when running the launch configuration
EXPECTED_TYPESTypes of EXPECTED_TOPICS in corresponding order

Methods:

setUp()Creates a ROS node for testing
setUpClass()Initialize ROS context
tearDown()Destroys the ROS node
tearDownClass()Shutdown ROS context
test_node_names_and_namespaces()Tests that nodes are running with the correct name and namespace.
test_topic_names_and_types()Tests that nodes subscribe to and publish the expected ROS topics

EXPECTED_NAMESPACES = ('/gisnav', '/gisnav', '/gisnav', '/gisnav', '/gisnav', '/')

Expected namespaces of EXPECTED_NODES in corresponding order

EXPECTED_NODES = ('gis_node', 'stereo_node', 'bbox_node', 'pose_node', 'uorb_node', 'test_node')

Names of nodes that should be found when running the launch configuration

test_node is created by the test case.

EXPECTED_TOPICS = ('/camera/camera_info', '/camera/image_raw', '/fmu/in/sensor_gps', '/gisnav/bbox_node/fov/bounding_box', '/gisnav/gis_node/orthoimage', '/gisnav/stereo_node/pose_image', '/gisnav/pose_node/pose', '/mavros/gimbal_control/device/attitude_status', '/mavros/global_position/global', '/mavros/local_position/pose', '/rosout', '/tf', '/tf_static')

Names of topics that should be found when running the launch configuration

EXPECTED_TYPES = ('sensor_msgs/msg/CameraInfo', 'sensor_msgs/msg/Image', 'px4_msgs/msg/SensorGps', 'geographic_msgs/msg/BoundingBox', 'gisnav_msgs/msg/OrthoImage', 'gisnav_msgs/msg/OrthoStereoImage', 'geometry_msgs/msg/PoseWithCovarianceStamped', 'mavros_msgs/msg/GimbalDeviceAttitudeStatus', 'sensor_msgs/msg/NavSatFix', 'geometry_msgs/msg/PoseStamped', 'rcl_interfaces/msg/Log', 'tf2_msgs/msg/TFMessage', 'tf2_msgs/msg/TFMessage')

Types of EXPECTED_TOPICS in corresponding order

setUp()

Creates a ROS node for testing

classmethod setUpClass()

Initialize ROS context

tearDown()

Destroys the ROS node

classmethod tearDownClass()

Shutdown ROS context

test_node_names_and_namespaces()

Tests that nodes are running with the correct name and namespace.

This test allows for more nodes than expected to be running without failing.

test_topic_names_and_types()

Tests that nodes subscribe to and publish the expected ROS topics

This test allows for more nodes than expected to be running without failing.

GISNav v0.68.1-2-gf2c72641

Released under the MIT License.