# QRB-ROS-battery
The `qrb_ros_battery` 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
Table : ROS node used in qrb-ros-battery pipeline
| ROS node | Description |
| --- | --- |
| Battery Copy to clipboard | Publishes the battery information. |
## ROS topics used in the `qrb-ros-battery` pipeline
Table : ROS topics used in qrb-ros-battery pipeline
| ROS topic | Type | Published by |
| --- | --- | --- |
| /battery_stats Copy to clipboard | Copy to clipboard | `Battery`node |
## Prerequisites
You have **Set up the device** according to [Set up the environment for running sample applications](https://docs.qualcomm.com/doc/80-70020-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/nodes/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 -zxf /opt/qrb_ros_battery.tar.gz -C /usr/
Copy to clipboard
3. Run `qrb_ros_battery` on the device by referring to [Run out-of-the-box qrb-ros-battery](https://docs.qualcomm.com/doc/80-70020-265/topic/qrb-ros-battery.html#case1-ros-battery).
Last Published: Oct 10, 2025
[Previous Topic
QRB-ROS-camera](https://docs.qualcomm.com/bundle/publicresource/80-70020-265/topics/qrb-ros-camera.md) [Next Topic
Orbbec-camera](https://docs.qualcomm.com/bundle/publicresource/80-70020-265/topics/orbbec-camera_5_2_8.md)