Launch parameters get converted

asked 2022-11-20 14:11:47 -0500

vKuehn gravatar image

HI,

with that launch file

from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    return LaunchDescription([
        Node(
            package='node_with_parameter',
            executable='node_with_parameter',
            name='node_with_parameter',
            output='screen',
            parameters=[{"turn": 200}])
])

the "turn: 200" get's converted when reading the argument with

myvar = sys.argv[1]

to

     --ros-args

any idea why ? any hint how to properly send parameters in such a simple launch file ?

Regards

edit retag flag offensive close merge delete

Comments

how to properly send parameters ...

Please see how turtlesim_node_with_parametersis defined: https://docs.ros.org/en/foxy/How-To-G...

ravijoshi gravatar image ravijoshi  ( 2022-11-21 03:34:46 -0500 )edit

it works launch arguments not with sys args and is over complicate- If you have a simpler explenation how to give sys args from a launch file it will be greatly appreciated

vKuehn gravatar image vKuehn  ( 2022-11-21 11:23:00 -0500 )edit

Why do you want to use sys args ? ROS params are made for that! May I request you to share your use case, please?

ravijoshi gravatar image ravijoshi  ( 2022-11-21 19:43:09 -0500 )edit