RVIZ how to pass in parameter in launch file
I am trying to write a launch file that automate my visualization process, the idea is to take a msg.Image topic name as argument and launch RVIZ to launch a image panel for that topic:
def generate_launch_description():
sensor_topic_arg = DeclareLaunchArgument(
'sensor_topic',
default_value='/test_sensor'
)
ld = launch.LaunchDescription([
sensor_topic_arg
])
ld.add_action(
Node(
package='rviz2',
executable='rviz2',
)
)
return ld
How can I pass the image topic to RVIZ as an argument, so that the RVIZ will be able to show the topic on an image panel on launch.