Robotics StackExchange | Archived questions

Launch parameters get converted

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

Asked by vKuehn on 2022-11-20 15:11:47 UTC

Comments

how to properly send parameters ...

Please see how turtlesim_node_with_parameters is defined: https://docs.ros.org/en/foxy/How-To-Guides/Launch-file-different-formats.html

Asked by ravijoshi on 2022-11-21 04:34:46 UTC

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

Asked by vKuehn on 2022-11-21 12:23:00 UTC

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

Asked by ravijoshi on 2022-11-21 20:43:09 UTC

Answers