Ask Your Question
0

image_transport republish via LaunchDescription and remapping

asked 2020-12-03 09:32:00 -0600

anthares gravatar image

Hi there,

How can I start image_transport republish via Launch file?

I tried the following:

import launch
import launch.actions
import launch.substitutions
import launch_ros.actions

def generate_launch_description():

    return launch.LaunchDescription([
        launch_ros.actions.Node(package='image_tools', node_executable='cam2image', output='screen', node_name='cam2image'),
        launch_ros.actions.Node(package='image_transport', node_executable='republish', arguments=[ 
                'raw',
                '--ros-args',
                '-r in:=image',
                'raw', 
                '-r out:=/camera/image_raw'
            ],
            output='screen', node_name='republish')
    ])

But from the log I can see that no images are republished:

[INFO] [launch]: All log files can be found below /root/.ros/log/2020-12-03-15-29-26-520456-db7019ece524-5304
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [cam2image-1]: process started with pid [5315]
[INFO] [republish-2]: process started with pid [5316]
[cam2image-1] [INFO] [cam2image]: Publishing image #1
[cam2image-1] [INFO] [cam2image]: Publishing image #2
[cam2image-1] [INFO] [cam2image]: Publishing image #3
[cam2image-1] [INFO] [cam2image]: Publishing image #4
[cam2image-1] [INFO] [cam2image]: Publishing image #5
[cam2image-1] [INFO] [cam2image]: Publishing image #6
[cam2image-1] [INFO] [cam2image]: Publishing image #7
[cam2image-1] [INFO] [cam2image]: Publishing image #8
[cam2image-1] [INFO] [cam2image]: Publishing image #9

What is wrong with my setup? Any idea?

Thanks!

Cheers, Anthares

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-03 10:40:55 -0600

anthares gravatar image

I have changed the way that I define the params for image_transport:

def generate_launch_description():
    return launch.LaunchDescription([
        launch_ros.actions.Node(package='image_tools', node_executable='cam2image', output='screen', node_name='cam2image'),
        launch_ros.actions.Node(package='image_transport', node_executable='republish', output='screen', node_name='republish', remappings=[
            ('in', 'image'),
            ('out', '/camera/image_raw')
        ], arguments=['raw'])
    ])

It actually work. I checked with RQT and I can see source and target topics being created and populated: republish is doing his job, it just doesnt produce any log. I should have checked first, sorry!

Cheers.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-12-03 09:32:00 -0600

Seen: 107 times

Last updated: Dec 03 '20