ros / ros_comm

ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).
http://wiki.ros.org/ros_comm
761 stars 912 forks source link

rostopic pub -f does not substitute times or headers #2308

Open pierrefranklin opened 1 year ago

pierrefranklin commented 1 year ago

rostopic pub time and header substitution does not work with yaml file messages. For example:

rostopic pub -s -r 10 /test sensor_msgs/Temperature -f msg.yaml

with msg.yaml as

header:
  seq: 0
  stamp: now
  frame_id: ''
temperature: 0.0
variance: 0.0

results in a fixed timestamp.

In comparision,

rostopic pub -s -r 10 /test sensor_msgs/Temperature "header:
  seq: 0
  stamp: now
  frame_id: ''
temperature: 0.0
variance: 0.0"

updates the timestamp correctly.

Tested on Ubuntu 18.04, ros melodic.

guihomework commented 1 year ago

Confirmed on noetic and with "auto" as well. It seems to be duplicate of https://github.com/ros/ros_comm/issues/2062 and appears to be a known issue with a fix https://github.com/ros/ros_comm/pull/2063 but the author did not yet re-target to noetic, so the fix is not merged. Kindly ping to @pavloblindnology