Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[topic_tools] relay_field which allows relay topic fields to another fields #639

Closed
wants to merge 4 commits into from

Conversation

wkentaro
Copy link
Contributor

No description provided.

@wkentaro
Copy link
Contributor Author

The output is like this::

relay_field

Basic usage is::

$ rosrun rospy_tutorials talker.py

$ rosrun topic_tools relay_field /chatter /image sensor_msgs/Image "header:
  seq: 0
  stamp: {secs: 0, nsecs: 0}
  frame_id: m.data
height: 0
width: 0
encoding: ''
is_bigendian: 0
step: 0
data: ''"

$ rostopic echo /image
header:
  seq: 0
  stamp: {secs: 0, nsecs: 0}
  frame_id: hello world 1436995720.88
height: 0
width: 0
encoding: ''
is_bigendian: 0
step: 0
data: ''
...

@wkentaro
Copy link
Contributor Author

relates to #638

@wjwwood
Copy link
Member

wjwwood commented Jul 17, 2015

Ok, thanks we'll get to this as soon as we can!

@dirk-thomas
Copy link
Member

Thanks for creating this new script. Currently it is not yet being installed and therefore would not be part of the Debian package. Please add it to the list of installed scripts:

catkin_install_python(PROGRAMS
scripts/mux_add
scripts/mux_delete
scripts/mux_list
scripts/mux_select
scripts/transform
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

@wkentaro
Copy link
Contributor Author

Thanks. I added it to the list.

@dirk-thomas
Copy link
Member

Thanks. I have squashed the commits and fixed a few minor Python style issues. It has been merged in 2faea45.

@wkentaro
Copy link
Contributor Author

Thanks.

2015年9月17日木曜日、Dirk Thomasnotifications@github.comさんは書きました:

Thanks. I have squashed the commits and fixed a few minor Python style
issues. It has been merged in 2faea45
2faea45
.


Reply to this email directly or view it on GitHub
#639 (comment).

和田 健太郎 / Kentaro Wada
http://wkentaro.com http://www.wkentaro.com

@wkentaro wkentaro deleted the relay-field branch October 9, 2015 14:56
@gavanderhoorn
Copy link
Contributor

Has this ever been documented? The topic_tools wiki page does not list it.

@130s
Copy link
Member

130s commented Jul 4, 2018

Has this ever been documented? The topic_tools wiki page does not list it.

Might not be super helpful but I added this feature to the list with the smallest description and a link to this PR from the wiki.

@abaldur
Copy link

abaldur commented Aug 3, 2019

Is it possible to use the relay_field with arrays?
Let's say I have a topic /array_of_floats with msg type: float64[] data.
The following does not work for me:
rosrun topic_tools relay_field /array_of_floats /value_of_first_index std_msgs/Float64 "{data: m.data[0]}"
Any ideas?

@cwecht
Copy link
Contributor

cwecht commented Aug 3, 2019

rostopic pub /array_of_floats std_msgs/Float64MultiArray "{data: [3.4, 3] }" -r 1.0
rosrun topic_tools relay_field /array_of_floats /value_of_first_index std_msgs/Float64 "data: m.data[0]"

This works. It seems, that the expression you have passed is not a Python expression.

@abaldur
Copy link

abaldur commented Aug 3, 2019

Got it, thx @cwecht

@marcelino-pensa
Copy link

marcelino-pensa commented Apr 24, 2020

In case anyone is a noob like I am and is wondering how to run the example above through a launch file, this is how you do it:

<launch>
  <node pkg="topic_tools" type="relay_field"
        name="field_relayer"
        args="/chatter /image sensor_msgs/Image 
            '{header:
                {seq: 0,
                stamp: {secs: 0, nsecs: 0},
                frame_id: m.data},
            height: 0,
            width: 0,
            encoding: '',
            is_bigendian: 0,
            step: 0,
            data: ''}' "/>
</launch>

@BereNiM
Copy link

BereNiM commented Apr 28, 2021

Hello, I'm newie in ROS. I have a topic with some fields (see the image) and I want to send the information from proces_value to another node (/states). I've tried something like rosrun topic_tools relay_field /lidar/joint1_position_controller/state/process_value /state std_msgs/Float64 "{data: m.data}" but it doesn't work :( Is it possible to do that with relay_field tool?

image

Thanks in advance (:

@marcelino-pensa
Copy link

marcelino-pensa commented Jan 31, 2022

It seems like this package is completely broken in Noetic, as not even the simple example of the OP works (issue as described in #2167 )
=/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants