# Publish the IMU data with `qrb_ros_imu` The [qrb_ros_imu](https://github.com/qualcomm-qrb-ros/qrb_ros_imu) sample application publishes the inertial measurement unit (IMU) data collected from the ICM-42688 hardware on Qualcomm Robotics Platforms. It provides the following: - Composable ROS Node support. - Zero-Copy transport powered by [QRB ROS Transport](https://github.com/qualcomm-qrb-ros/qrb_ros_transport). ## Pipeline flow for `qrb_ros_imu` **`qrb_ros_imu` pipeline** The [qrb_ros_imu](https://github.com/qualcomm-qrb-ros/qrb_ros_imu/tree/main/qrb_ros_imu) is a ROS 2 package. It creates a publisher with `qrb_ros_transport` for zero-copy transport. It supports node composition, making it possible to improve performance using ROS intra-process communication. ## `qrb_ros_imu` APIs **ROS interfaces** | Interface | Name | Type | Description | | --- | --- | --- | --- | | `Publisher` | `/imu` | `sensor_msgs/msg/Imu` | Outputs the IMU data. | **ROS parameters** | Name | Type | Description | Default value | | --- | --- | --- | --- | | `debug` | bool | To measure the latency from IMU data generation to its output by the ROS node. | false | `qrb_sensor_client` **APIs** | Function | Parameters | Description | | --- | --- | --- | | `bool create_connection()` | Empty | Connect with sensor service, return `true` means create successfully. | | `void disconnect_server()` | Empty | Disconnect with sensor service. | | `bool get_imu_data(sensors_event_t ** accel_ptr, sensors_event_t ** gyro_ptr, int32_t * sample_count)` | | Retrieves IMU data. Returns `true` if successful.
If `true`, `accel_ptr` and `gyro_ptr` point to the latest IMU data, and `sample_count` specifies how many samples are retrieved. | ## Prerequisites You have set up the device, installed ROS2 Jazzy and QIR SDK on the device according to [Install the QIR SDK](https://docs.qualcomm.com/doc/80-90441-2/topic/2-install-the-qir-sdk.html#install-qir-sdk). ## Run out-of-the-box `qrb_ros_imu` **Steps** 1. Install the qrb\_ros\_transport packages. sudo apt install ros-jazzy-qrb-ros-imu sudo apt install qcom-sensor\* reboot Copy to clipboard 2. Use the IMU node. source /opt/ros/jazzy/setup.bash ros2 run qrb_ros_imu imu_node Copy to clipboard 3. Check ROS topics with the topic /imu. source /opt/ros/jazzy/setup.bash ros2 topic echo /imu Copy to clipboard ## Build and run `qrb_ros_imu` **Steps** 1. Install dependencies. sudo apt install ros-jazzy-qrb-ros-transport-imu-type \\ ros-dev-tools Copy to clipboard 2. Clone the repository to the device. mkdir -p ~/qrb_ros_ws/src cd ~/qrb_ros_ws/src git clone https://github.com/qualcomm-qrb-ros/qrb_ros_imu.git Copy to clipboard 3. Build and run `qrb_ros_imu`. cd ~/qrb_ros_ws colcon build source install/setup.bash ros2 run qrb_ros_imu imu_node Copy to clipboard Last Published: Sep 07, 2026 [Previous Topic Implement model inference with qrb\_ros\_nn\_inference](https://docs.qualcomm.com/bundle/publicresource/80-90441-2/topics/implement-model-inference-with-qrb_ros_nn_inference.md) [Next Topic Run a zero-copy camera with qrb\_ros\_camera](https://docs.qualcomm.com/bundle/publicresource/80-90441-2/topics/run-a-zero-copy-camera-with-qrb_ros_camera.md)