On this page

JointStatePublisher QML Type

Publishes sensor_msgs::msg::JointState messages — This is a message that holds data to describe the state of a set of torque controlled joints. More...

Import Statement: import QtRos2.SensorMsgs
Inherits:

PublisherBase

Status: Experimental Extension

Properties

Methods

Detailed Description

The state of each joint (revolute or prismatic) is defined by:

  • the position of the joint (rad or m),
  • the velocity of the joint (rad/s or m/s) and
  • the effort that is applied in the joint (Nm or N).

Each joint is uniquely identified by its name The header specifies the time at which the joint states were recorded. All the joint states in one message have to be recorded at the same time.

This message consists of a multiple arrays, one for each part of the joint state. The goal is to make each of the fields optional. When e.g. your joints have no effort associated with them, you can leave the effort array empty.

All arrays in this message should have the same size, or be empty. This is the only way to uniquely associate the joint name with the correct states.

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

See also JointStateSubscriber and jointState.

Property Documentation

effort : list<double>

The effort field value included in the next publish. Setting this property emits effortChanged 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.

name : list<string>

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

position : list<double>

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

velocity : list<double>

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

Method Documentation

void publish(jointState msg)

Publishes jointState 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.