On this page

Choosing Sensor Message Types

Qt ROS2 provides QML-friendly wrappers for the standard sensor_msgs and nav_msgs message types. This page helps you pick the right message type for your hardware and explains which messages SLAM and navigation stacks expect or produce.

Note: All message types listed here are from sensor_msgs, nav_msgs, or geometry_msgs unless stated otherwise. Audio is a known gap — see Audio sensors and speech.

Distance and ranging sensors

Sensor TypeMessage TypeNotes
2D lidar / laser range-finderlaserScan (LaserScan)Single planar sweep; provides ranges and optional intensities.
Multi-echo 2D lidarmultiEchoLaserScan (MultiEchoLaserScan)Like LaserScan but each range bin can report multiple return distances. Useful for glass, vegetation, or fog detection.
3D lidar / depth camera (unordered or 2D-organized)pointCloud2 (PointCloud2)Flexible binary blob; supports arbitrary per-point fields (x, y, z, intensity, …).
Ultrasonic / infrared range sensorrange (Range)Single-beam measurement with min/max range bounds and radiation type field (ultrasound, infrared).

Camera sensors

Sensor TypeMessage TypeNotes
RGB or mono cameraimage (Image)Uncompressed; the Qt wrapper exposes a QImage property for direct use in QML. Encoding field selects colour format (rgb8, rgba8, bgr8, mono8, mono16, …).
Compressed camera stream (JPEG / PNG)compressedImage (CompressedImage)Smaller over-the-wire size; the Qt wrapper decodes to a QImage on demand.
Camera calibration parameterscameraInfo (CameraInfo)Accompanies Image messages; carries intrinsics, distortion, and projection matrices. Subscribe alongside Image on a synchronised pair of topics.
Region of interest within a camera imageregionOfInterest (RegionOfInterest)Embedded in CameraInfo; also used standalone to flag a crop window.

Inertial and navigation sensors

Sensor TypeMessage TypeNotes
IMU (accelerometer + gyroscope ± magnetometer)imu (Imu)Reports orientation, angular velocity, and linear acceleration each with a 3×3 covariance matrix. Set covariance diagonal to -1 if a field is not measured.
GPS / GNSS receivernavSatFix (NavSatFix)Latitude, longitude, altitude and position covariance; status field indicates fix quality (no fix, fix, SBAS fix, GBAS fix).
Magnetic compassmagneticField (MagneticField)3-axis field vector in Tesla with covariance.
External time reference (GPS PPS, NTP, PTP)timeReference (TimeReference)Stamps a measurement from an external clock so the ROS graph can correlate it with system time. Useful for hardware-synchronised camera rigs and lidar sweeps.

Power and battery

Sensor TypeMessage TypeNotes
Battery or power supplybatteryState (BatteryState)Covers voltage, current, temperature, charge, capacity, and state-of-charge percentage (0.0–1.0). Enum constants identify chemistry (LiPo, NiMH, …), health (good, overheat, dead, …), and charging status (charging, discharging, full, …). Multi-cell packs can report per-cell voltage and temperature arrays.

Environmental sensors

Sensor TypeMessage TypeNotes
Barometer / pressure sensorfluidPressure (FluidPressure)Absolute pressure in Pascals with variance.
Temperature sensortemperature (Temperature)Temperature in degrees Celsius with variance.
Humidity sensorrelativeHumidity (RelativeHumidity)Relative humidity as a ratio (0.0–1.0) with variance.
Illuminance / ambient lightilluminance (Illuminance)Illuminance in lux with variance.

Actuators and kinematics

These messages describe the state of joints and limbs rather than sensors in the traditional sense, but they flow through the same sensor pipeline.

Use CaseMessage TypeNotes
Robot arm or wheeled-robot joint positionsjointState (JointState)Reports position (rad or m), velocity, and effort per named joint. Any of the three arrays may be left empty if not measured. Subscribe to /joint_states to drive a 3D model or display telemetry.
Floating-base or multi-DOF jointsmultiDOFJointState (MultiDOFJointState)Generalises JointState to joints with more than one degree of freedom; each joint carries a full Transform, Twist, and Wrench.

SLAM and navigation

SLAM (Simultaneous Localization and Mapping) algorithms consume sensor data and publish map and pose estimates. A Qt dashboard typically subscribes to SLAM outputs to display a live map and robot position.

SLAM inputs

Feed at least one ranging source and optionally an IMU into a SLAM node:

InputMessage Type
2D lidar sweeplaserScan (LaserScan) on /scan
3D lidar or depth cloudpointCloud2 (PointCloud2) on /points
Wheel odometry (pre-SLAM estimate)odometry (Odometry) on /odom
Inertial measurementimu (Imu) on /imu

SLAM outputs

OutputMessage TypeNotes
Occupancy grid mapoccupancyGrid (OccupancyGrid) on /map2D grid where each cell is free (0), occupied (100), or unknown (-1). Subscribe to render a live floor plan.
Corrected robot poseposeWithCovarianceStamped (PoseWithCovarianceStamped)SLAM-corrected pose with uncertainty ellipse; broadcast on /pose.
Odometry estimateodometry (Odometry) on /odomCombines pose and twist with covariances; used by the navigation stack.
Planned pathpath (Path) on /planSequence of poses from the current position to the navigation goal.

Note: SLAM and navigation stacks also broadcast coordinate-frame transforms on the /tf and /tf_static topics using the tf2_msgs/TFMessage type. Qt ROS2 does not currently wrap tf2_msgs, so transforms must be read through a bridging node or a dedicated C++ subscriber if your application needs them directly.

Audio sensors and speech

Standard ROS 2 (and the Qt ROS2 Bridge) does not include a message type for raw audio data. The community package audio_common_msgs (from the audio_common stack) provides AudioData and AudioStamped messages and is widely used, but it is not part of the core ROS 2 distribution and is not currently wrapped by Qt ROS2.

Typical approaches for audio in a ROS 2 system:

TaskCommon approach
Capture microphone audioA dedicated ROS node streams audio_common_msgs/AudioData; outside ROS, use Qt Multimedia (QAudioSource) and bridge results into ROS via a publisher.
Speech-to-text transcriptionA Whisper- or cloud-ASR-based node publishes the transcript as std_msgs/String on a topic such as /speech_recognition/result. Subscribe with string (String) in QML.
Text-to-speech outputSend a std_msgs/String command to a TTS node; audio playback happens inside that node or via Qt Multimedia on the Qt side.
LLM response piped to speechPublish the LLM text output as std_msgs/String; a downstream TTS node converts it to speech. The full pipeline (mic → ASR → LLM → TTS → speaker) runs as ROS nodes; the Qt UI subscribes to the intermediate text topics for display and can publish user text input to inject into the chain.

Remote control and teleoperation

Sending velocity or steering commands to a robot is covered separately. See Teleoperation and Remote Control for joy (Joy), twist (Twist), and on-screen joystick patterns.

See also Qt ROS2 QML Types.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.