On this page

BatteryStatePublisher QML Type

Publishes sensor_msgs::msg::BatteryState messages — Constants are chosen to match the enums in the linux kernel defined in include/linux/power_supply.h as of version 3.7 The one difference is for style reasons the constants are all uppercase not mixed case. More...

Import Statement: import QtRos2.SensorMsgs
Inherits:

PublisherBase

Status: Experimental Extension

Properties

Methods

Detailed Description

BatteryStatePublisher publishes batteryState values to a ROS 2 topic. Set the topic and node properties, then call publish() to send messages.

See also BatteryStateSubscriber and batteryState.

Property Documentation

capacity : real

The capacity field value included in the next publish. Setting this property emits capacityChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

cellTemperature : list<real>

The cellTemperature field value included in the next publish. Setting this property emits cellTemperatureChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

cellVoltage : list<real>

The cellVoltage field value included in the next publish. Setting this property emits cellVoltageChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

charge : real

The charge field value included in the next publish. Setting this property emits chargeChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

current : real

The current field value included in the next publish. Setting this property emits currentChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

designCapacity : real

The designCapacity field value included in the next publish. Setting this property emits designCapacityChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

header : header

The header field value included in the next publish. Setting this property emits headerChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

location : string

The location field value included in the next publish. Setting this property emits locationChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

percentage : real

The percentage field value included in the next publish. Setting this property emits percentageChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

powerSupplyHealth : uint8_t

The powerSupplyHealth field value included in the next publish. Setting this property emits powerSupplyHealthChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

powerSupplyStatus : uint8_t

The powerSupplyStatus field value included in the next publish. Setting this property emits powerSupplyStatusChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

powerSupplyTechnology : uint8_t

The powerSupplyTechnology field value included in the next publish. Setting this property emits powerSupplyTechnologyChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

present : bool

The present field value included in the next publish. Setting this property emits presentChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

serialNumber : string

The serialNumber field value included in the next publish. Setting this property emits serialNumberChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

temperature : real

The temperature field value included in the next publish. Setting this property emits temperatureChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

voltage : real

The voltage field value included in the next publish. Setting this property emits voltageChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

Method Documentation

void publish(batteryState msg)

Publishes batteryState msg to the ROS 2 topic set by the topic property. Does nothing if the publisher is not connected.

© 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.