Repository: ros/ros_comm

Issue:
'rostopic echo' returning incomplete message data for some topics
it appears that the kinetic-devel branch has a regression, introduced at commit https://github.com/ros/ros_comm/commit/e0f63978fe0dd239ba8002a7e79756cdf1a335d0

`rostopic echo` may not properly return the message data for some topics

this can be reproduced as follows:
- put the latest ros_comm (kinetic-devel branch) in a source overlay workspace (i overlaid this on-top of indigo)
- start roscore in one terminal
- start the sample TF broadcaster node (code below) in another terminal
- run `rostopic echo /tf`. this will return `transforms: None`
- spinning up a rosnode (tested via rospy) and subscribing to the topic does indeed result in the expected message data. this is only a problem using `rostopic echo` on the commandline it seems

repeating the above on a previous commit (i.e. 9ff6955679afc791240aba637dacde6eeb5ae8eb) of ros_comm has no issue and `rostopic echo /tf` returns the expect result

sample TF broadcaster node:

```
#!/usr/bin/env python  
import rospy
import tf
import time

if __name__ == '__main__':
    rospy.init_node('test')

    while not rospy.is_shutdown():
        br = tf.TransformBroadcaster()
        br.sendTransform((0, 0, 0),
                         tf.transformations.quaternion_from_euler(0, 0, 0),
                         rospy.Time.now(),
                         'test',
                         "world")
        time.sleep(1)
```

'rostopic echo' returning incomplete message data for some topics
it appears that the kinetic-devel branch has a regression, introduced at commit https://github.com/ros/ros_comm/commit/e0f63978fe0dd239ba8002a7e79756cdf1a335d0

`rostopic echo` may not properly return the message data for some topics

this can be reproduced as follows:
- put the latest ros_comm (kinetic-devel branch) in a source overlay workspace (i overlaid this on-top of indigo)
- start roscore in one terminal
- start the sample TF broadcaster node (code below) in another terminal
- run `rostopic echo /tf`. this will return `transforms: None`
- spinning up a rosnode (tested via rospy) and subscribing to the topic does indeed result in the expected message data. this is only a problem using `rostopic echo` on the commandline it seems

repeating the above on a previous commit (i.e. 9ff6955679afc791240aba637dacde6eeb5ae8eb) of ros_comm has no issue and `rostopic echo /tf` returns the expect result

sample TF broadcaster node:

```
#!/usr/bin/env python  
import rospy
import tf
import time

if __name__ == '__main__':
    rospy.init_node('test')

    while not rospy.is_shutdown():
        br = tf.TransformBroadcaster()
        br.sendTransform((0, 0, 0),
                         tf.transformations.quaternion_from_euler(0, 0, 0),
                         rospy.Time.now(),
                         'test',
                         "world")
        time.sleep(1)
```



Discussion:
Thank you for reporting this. The change was part of #724.

@wkentaro Can you please try to reproduce the reported problem and if necessary provide a patch.

Ok I will.

Thank you for reporting this. The change was part of #724.

@wkentaro Can you please try to reproduce the reported problem and if necessary provide a patch.

Ok I will.


Resolving patch:
diff --git a/tools/rostopic/src/rostopic/__init__.py b/tools/rostopic/src/rostopic/__init__.py
--- a/tools/rostopic/src/rostopic/__init__.py
+++ b/tools/rostopic/src/rostopic/__init__.py
@@ -1362,7 +1362,8 @@ class TransformedMessage(genpy.Message):
                 try:
                     msg_class = genpy.message.get_message_class(t)
                     if msg_class is None:
-                        continue
+                        # happens for list of ROS messages like std_msgs/String[]
+                        raise ValueError
                     nested_transformed = value_transform(f_val)
                     setattr(val_trans, f, nested_transformed)
                 except ValueError:


Test patch: