Skip to content

Environment variables not set for actions inside RosTimer #376

@tonynajjar

Description

@tonynajjar

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22
  • Installation type:
    • binaries
  • Version or commit hash:
    • Humble
  • DDS implementation:
    • Cyclone
  • Client library (if applicable):

Steps to reproduce issue

from launch import LaunchDescription
from launch.actions import (
    GroupAction,
    SetEnvironmentVariable,
)
from launch_ros.actions import Node, RosTimer

def generate_launch_description():  # noqa: D103
    ld = LaunchDescription()
    ld.add_action(
        GroupAction(
            actions=[
                SetEnvironmentVariable(name="ROS_DOMAIN_ID", value="2"),
                RosTimer(
                    period=1.0,
                    actions=[
                        # Gets ROS_DOMAIN_ID of 0
                        Node(
                            package="demo_nodes_py",
                            executable="talker",
                            output="screen",
                        ),
                    ],
                ),
                # Gets ROS_DOMAIN_ID of 2
                Node(
                    package="demo_nodes_py",
                    executable="listener",
                    output="screen",
                ),
            ]
        )
    )

    return ld

Expected behavior

Both nodes get the same ROS_DOMAIN_ID of 2

Actual behavior

The node in RosTimer does not get ROS_DOMAIN_ID set

Additional information


Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions