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

topic_tools transform from launch file?

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

lucasw gravatar image

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

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"?>
<launch>
  <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 'm.data * 2'" />
</launch>

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 m.data * 2 __name:=radius_to_diameter __log:=/home/lucasw/.ros/log/.../radius_to_diameter-2.log].

While

rosrun topic_tools transform /radius /diameter std_msgs/Float32 'm.data * 2'

works as expected.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

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

Comments

I'll do that.

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

so what is the correct way now?

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

@Kansai the launch file example in the question now works

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

Question Tools

1 follower

Stats

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

Seen: 3,207 times

Last updated: Jul 22 '15