Skip to content

Teleop_twist_joy parameters not set from joy.yaml correctly #187

Description

@PaulBouchier

Report to Linorobot google group from Mark Barton: mbarton451@gmail.com

Whenever I launch with the following, the teleop_twist_joy parameters are set to the package default and not the values from the joy.yaml file.

ros2 launch linorobot2_bringup bringup.launch.py joy:=true

def generate_launch_description():
joy_config_path = PathJoinSubstitution(
[FindPackageShare("linorobot2_bringup"), "config", "joy.yaml"]
)
return LaunchDescription([
Node(
package='joy_linux',
executable='joy_linux_node',
name='joy_linux_node',
output='screen',
),

    Node(
        package='teleop_twist_joy',
        executable='teleop_node',
        name='teleop_twist_joy_node',
        output='screen',
        parameters=[joy_config_path]
    )
])

After a bit of searching I found this which has a different way of finding joy.yaml and it does work:
:
from ament_index_python.packages import get_package_share_directory
def generate_launch_description():
config_dir = os.path.join(get_package_share_directory('linorobot2_bringup'), 'config')
params_file = os.path.join(config_dir, 'joy.yaml')

return LaunchDescription([
    Node(
        package='joy_linux',
        executable='joy_linux_node',
        name='joy_linux_node',
        output='screen',
    ),

    Node(
        package='teleop_twist_joy',
        executable='teleop_node',
        name='teleop_twist_joy_node',
        output='screen',
        parameters=[params_file]
    )
])

I see how the second version works and it makes more sense to me, but I don't see why the first version doesn't work. Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions