﻿# A velocity-only JointState can be valid but cannot supply joint positions to robot_state_publisher

Optional JointState fields and a consumer’s required measurements are different contracts. Inspect position availability before diagnosing missing robot transforms.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/robotics-jointstate-velocity-only-state-publisher-position/
Language: en

## Discovery and valid messages do not establish kinematic input

A robot driver publishes joint velocities, and its JointState messages arrive at a perception application. The transform tree still lacks updated joint geometry. The integration team assumes delivery or naming failed because a message validator accepted the traffic. First inspect whether positions were provided. A schema can describe several measurement subsets, while a particular consumer needs a specific subset for its operation. Successful transport and valid representation do not manufacture the missing quantity required to compute a joint pose.

## Optional fields describe real measurement availability

The [JointState definition](https://raw.githubusercontent.com/ros2/common_interfaces/rolling/sensor_msgs/msg/JointState.msg) permits empty optional measurement arrays; populated arrays associate entries with joint names. It also specifies a common recording time for states in the message. A velocity-only message can therefore represent available data without claiming position measurements. Keep that meaning in the application. Do not classify every empty position array as a malformed serialization, and do not fill it with numerical zeros merely to make every array the same size.

## The reviewed publisher has a narrower input requirement

The reviewed [robot_state_publisher callback](https://raw.githubusercontent.com/ros/robot_state_publisher/rolling/src/robot_state_publisher.cpp) checks the position array against the names and ignores the message when positions are absent. It then constructs a named position map for kinematic publication. This does not invalidate the message definition; it defines what this consumer can use. Preserve the installed implementation and diagnostic message when applying the explanation. Another subscriber may legitimately consume velocities while this publisher cannot derive its required joint transforms from them alone.

## Do not integrate velocity without an explicit estimator

If the application needs positions, obtain them from the intended measurement or explicitly defined estimation path. Integrating velocities requires an initial condition, timing and drift treatment; it is not an automatic consequence of receiving a velocity array. Substituting fabricated positions can make visualization move while concealing the missing source. Also preserve named association for real positions: sorting names without the corresponding values changes kinematics. A consumer workaround should not silently become a new unvalidated state estimator.

## Test eligibility separately from message validity

Propose a passive fixture containing named velocities with empty positions, complete named positions and a deliberately mismatched populated array. Check the schema rules and the reviewed publisher’s behavior as separate expectations. Include reordered complete name/value pairs to verify that association survives the adapter. Acceptance explains why a valid velocity-only message supplies no position update. No robot, driver or publisher experiment was run here, and the fixture does not establish encoder accuracy or physical actuator behavior.

## Keep consumer eligibility visible in the state pipeline

[RDT availability maps](/journal/fg2-rdt-unified-state-vector-availability-map/) explain a model-adapter contract for present and absent components. [RoboNet derived action fields](/journal/fg2-robonet-action-zero-padding-imputation-target-mask/) explain another provenance boundary. Here the added decision is whether the received subset satisfies a kinematic publisher’s input needs. Report measurement availability, named positions and consumer acceptance separately. That prevents missing transforms from prompting zero-filled geometry and lets a valid partial message remain useful to consumers whose requirements it actually satisfies.
