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

topic_tools transform from launch file?

asked 2015-07-21 23:41:55 -0600

lucasw gravatar image

updated 2020-11-21 11:33:16 -0600

Is topic_tools transform incapable of being run from a launch file? Maybe it has a non-standard parser for getting the python imports, and can't handle __ arguments properly?

<?xml version="1.0"?>
  <node name="radius" pkg="rostopic" type="rostopic"
      args="pub /radius std_msgs/Float32 'data: 1.0' -r 1" />

  <node name="radius_to_diameter" pkg="topic_tools" type="transform"
      args="/radius /diameter std_msgs/Float32 ' * 2'" />

Fails with:

process[radius-1]: started with pid [26144]
process[radius_to_diameter-2]: started with pid [26150]
usage: transform [-h] [-i MODULES [MODULES ...]]
                 input output_topic output_type expression
transform: error: unrecognized arguments: __name:=radius_to_diameter __log:=/home/lucasw/.ros/log/.../radius_to_diameter-2.log
[radius_to_diameter-2] process has died [pid 26150, exit code 2, cmd /opt/ros/indigo/lib/topic_tools/transform /radius /diameter std_msgs/Float32 * 2 __name:=radius_to_diameter __log:=/home/lucasw/.ros/log/.../radius_to_diameter-2.log].


rosrun topic_tools transform /radius /diameter std_msgs/Float32 ' * 2'

works as expected.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-07-22 12:01:03 -0600

It looks it's missing a call to rospy.myargv to strip all the extra stuff before trying to parse the args. File an issue against ros_comm (or better yet, a pull request).

edit flag offensive delete link more


I'll do that.

lucasw gravatar image lucasw  ( 2015-07-22 12:39:42 -0600 )edit

so what is the correct way now?

Kansai gravatar image Kansai  ( 2021-04-14 19:18:24 -0600 )edit

@Kansai the launch file example in the question now works

lucasw gravatar image lucasw  ( 2021-09-26 09:49:30 -0600 )edit

Question Tools

1 follower


Asked: 2015-07-21 23:41:55 -0600

Seen: 3,179 times

Last updated: Jul 22 '15