# Publish the battery state with `qrb_ros_battery`
The `qrb_ros_battery` sample application is a package that publishes the battery state data from the system node.
This package communicates with the battery service through DBus. The battery service obtains the current battery status by accessing the `sys` nodes.
## Pipeline flow for `qrb_ros_battery`
**Figure : `qrb_ros_battery` pipeline**
## ROS nodes used in the `qrb_ros_battery` pipeline
| ROS node | Description |
| --- | --- |
| Battery Copy to clipboard | Publishes the battery information. |
## ROS topics used in the `qrb_ros_battery` pipeline
| ROS topic | Message type | Published/Subscribed by | Description |
| --- | --- | --- | --- |
| `/battery_status` | `sensor_msgs::msg::BatteryState` | Published by `Battery` | Publishes the battery status. |
## Prerequisites
You have **Set up the device** according to [Set up the environment for running sample applications](https://docs.qualcomm.com/doc/80-70022-265/topic/quick_start.html#setup-demo-qs).
## Run out-of-the-box `qrb_ros_battery`
**Steps**
1. In terminal 1, run the battery ROS node.
>
>
> ssh root@[ip-addr]
> (ssh) source /usr/share/qirp-setup.sh
> (ssh) export ROS_DOMAIN_ID=xx (Value range of ``ROS_DOMAIN_ID``: [0, 232])
> (ssh) ros2 run qrb_ros_battery battery_node
> Copy to clipboard
2. In terminal 2, get the battery information.
>
>
> ssh root@[ip-addr]
> (ssh) source /usr/share/qirp-setup.sh
> (ssh) export ROS_DOMAIN_ID=xx
> (ssh) ros2 topic echo /battery_stats
> Copy to clipboard
## Build and run `qrb_ros_battery`
**Steps**
1. Build `qrb_ros_battery` provided by the QIR SDK on the host.
cd
source setup.sh
cd qirp-samples/platform/qrb_ros_battery
colcon build --merge-install --cmake-args ${CMAKE_ARGS}
Copy to clipboard
2. Push `qrb_ros_battery` to the device.
cd qirp-samples/platform/platform/qrb_ros_battery/install
tar czvf qrb_ros_battery.tar.gz lib share include
scp qrb_ros_battery.tar.gz root@[ip-addr]:/opt/
ssh root@[ip-addr]
(ssh) mount -o remount,rw /usr
(ssh) tar --no-overwrite-dir --no-same-owner -zxf /opt/qrb_ros_battery.tar.gz -C /usr/
Copy to clipboard
3. Run `qrb_ros_battery` on the device with the steps in [Run out-of-the-box qrb\_ros\_battery](https://docs.qualcomm.com/doc/80-70022-265/topic/qrb-ros-battery.html#case1-ros-battery).
Last Published: Nov 05, 2025
[Previous Topic
Run a zero-copy camera with](https://docs.qualcomm.com/bundle/publicresource/80-70022-265/topics/qrb-ros-camera.md) [Next Topic
Convert between NV12 and RGB888 with](https://docs.qualcomm.com/bundle/publicresource/80-70022-265/topics/qrb-ros-color-space-convert_5_2_9.md)