Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetParameter does not propagate into event handler callback #373

Open
tonynajjar opened this issue Aug 4, 2023 · 1 comment
Open

SetParameter does not propagate into event handler callback #373

tonynajjar opened this issue Aug 4, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@tonynajjar
Copy link

tonynajjar commented Aug 4, 2023

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22
  • Installation type:
    • binaries
  • Version or commit hash:
    • Humble
  • DDS implementation:
    • rmw_cyclonedds_cpp

Steps to reproduce issue

from launch import LaunchDescription
from launch.actions import GroupAction, RegisterEventHandler
from launch.event_handlers import OnProcessStart
from launch_ros.actions import LoadComposableNodes, Node, SetParameter
from launch_ros.descriptions import ComposableNode


def generate_launch_description():  # noqa: D103
    container = Node(
        name="container",
        package="rclcpp_components",
        executable="component_container",
        output="screen",
        respawn=True,
    )
    load_composable_nodes = LoadComposableNodes(
        target_container="container",
        composable_node_descriptions=[
            ComposableNode(
                package="composition", plugin="composition::Talker", name="talker"
            ),
        ],
    )
    event = RegisterEventHandler(
        OnProcessStart(
            target_action=container,
            on_start=[load_composable_nodes],
        )
    )

    bringup_cmd_group = GroupAction(
        actions=[
            SetParameter("use_sim_time", True),
            container,
            # load_composable_nodes, # with this use_sim_time of the talker node is True
            event, # with this use_sim_time  of the talker node  is False

        ]
    )

    ld = LaunchDescription()
    ld.add_action(bringup_cmd_group)
    return ld

Expected behavior

ros2 param get /talker use_sim_time -> should yield True

Actual behavior

ros2 param get /talker use_sim_time -> yields False

Additional information

In case you are wondering why I need to do it like this, it's to workaround this issue


@tonynajjar
Copy link
Author

I notice the same for SetEnvironmentVariable, it will also not propagate into the event handler callback

@clalancette clalancette added the help wanted Extra attention is needed label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants