topic_tools icon indicating copy to clipboard operation
topic_tools copied to clipboard

Use ROS parameters in transform

Open mateusz-lichota opened this issue 3 years ago • 1 comments

Description

It would be immensly helpful to be able to set the parameters of transform via a yaml parameter file. For example, in a launch file:

Node(
        package='topic_tools',
        executable='transform_node.py',
        name='transform',
        output='screen',
        parameters=[
            {'input': '/conemap'},
            {'output-topic': '/conemap_rviz'},
            {'output-type': 'visualization_msgs/MarkerArray'},
            {'expression': 'conemap_to_markerarray.convert(m)'},
            {'import': ['conemap_to_markerarray']}
        ])

This way one can make a pip-installable python package, and withou worrying about any ROS implementation details just run it as a very simple ros node. I have a working implementation of this feature in my fork, although I'm a newbie to ros and it's probably full of bugs etc

Completion Criteria

You can use both command line arguments and ros parameters to alter transform settings.

mateusz-lichota avatar Dec 06 '21 19:12 mateusz-lichota

Yes - relay accepts inputs this way, and work-in-progress throttle https://github.com/ros-tooling/topic_tools/pull/20 does as well. You are right that this is useful, and the intended interface of the program.

I think the way to implement this is to have the argparse portion of transform add parameters to the NodeOptions for the created node. Then the node can read its Parameters for configuration, instead of being passed an argparse.Namespace.

emersonknapp avatar Dec 08 '21 00:12 emersonknapp