ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

That would be a nice feature, though there could be ambiguous cases with the same names (it could always default to the actual topic which it looks like rostopic echo does, unless it doesn't match the expected type then try the message field), or some other character than / could be required.

topic_tools transform can relay message fields:

rostopic pub /test geometry_msgs/Point "{x: 1.0, y: 2.0, z: 3.0}" -r 1

Then

rosrun topic_tools transform /test /test/z std_msgs/Float64 'm.z'

This is neat:

rosrun topic_tools transform /test /test/xy opencv_apps/Point2D 'm.x, m.y'

or

rostopic pub /test sensor_msgs/Image "{header: auto, height: 0, width: 0, encoding: '', is_bigendian: 0, step: 0, data: ''}"  -r 1

rosrun topic_tools transform /test /test/header std_msgs/Header 'm.header'

and then test/z, test/xy, or test/header exists for any node that wants it.

If ros could do it automatically ideally it would not do it in the subscriber (requiring the overhead of sending and receiving an entire Image for example just for a few bytes of a field), but would be essentially launching something like the topic_tools transform behind the scenes.

That would be a nice feature, though there could be ambiguous cases with the same names (it could always default to the actual topic which it looks like rostopic echo does, unless it doesn't match the expected type then try the message field), or some other character than / could be required.

topic_tools transform can relay message fields:

rostopic pub /test geometry_msgs/Point "{x: 1.0, y: 2.0, z: 3.0}" -r 1

Then

rosrun topic_tools transform /test /test/z std_msgs/Float64 'm.z'

This is neat:

rosrun topic_tools transform /test /test/xy opencv_apps/Point2D 'm.x, m.y'

or

rostopic pub /test sensor_msgs/Image "{header: auto, height: 0, width: 0, encoding: '', is_bigendian: 0, step: 0, data: ''}"  -r 1

rosrun topic_tools transform /test /test/header std_msgs/Header 'm.header'

and then test/z, test/xy, or test/header exists exist for any node that wants it.them.

If ros could do it automatically ideally it would not do it in the subscriber (requiring the overhead of sending and receiving an entire Image for example just for a few bytes of a field), but would be essentially launching something like the topic_tools transform behind the scenes.

That would be a nice feature, though there could be ambiguous cases with the same names (it could always default to the actual topic which it looks like rostopic echo does, unless it doesn't match the expected type then try the message field), or some other character than / could be required.

topic_tools transform can relay message fields:

rostopic pub /test geometry_msgs/Point "{x: 1.0, y: 2.0, z: 3.0}" -r 1

Then

rosrun topic_tools transform /test /test/z std_msgs/Float64 'm.z'

This is neat:

rosrun topic_tools transform /test /test/xy opencv_apps/Point2D 'm.x, m.y'

or

rostopic pub /test sensor_msgs/Image "{header: auto, height: 0, width: 0, encoding: '', is_bigendian: 0, step: 0, data: ''}"  -r 1

rosrun topic_tools transform /test /test/header std_msgs/Header 'm.header'

and then test/z, test/xy, or test/header exist for any node that wants them.

If ros could do it automatically ideally it would not do it in the subscriber (requiring the overhead of sending transporting and receiving an entire Image for example just for a few bytes of a field), but would be essentially launching something like the topic_tools transform behind the scenes.