From d1dafc1ef6e26a4a4e925c8c95c669cadcc212a5 Mon Sep 17 00:00:00 2001 From: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> Date: Wed, 5 Nov 2025 17:58:11 +0100 Subject: [PATCH] Compatiblity with 'Populate Transitions' ros2/rcl#1269 Signed-off-by: SuperJappie08 <36795178+SuperJappie08@users.noreply.github.com> --- .../launch_ros/events/lifecycle/state_transition.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/launch_ros/launch_ros/events/lifecycle/state_transition.py b/launch_ros/launch_ros/events/lifecycle/state_transition.py index e0fa80979..647b8ea93 100644 --- a/launch_ros/launch_ros/events/lifecycle/state_transition.py +++ b/launch_ros/launch_ros/events/lifecycle/state_transition.py @@ -15,6 +15,7 @@ """Module for StateTransition event.""" from typing import Text +from typing import TYPE_CHECKING from launch.event import Event @@ -24,6 +25,9 @@ # imports here would cause loops, but are only used as forward-references for type-checking from ...actions import LifecycleNode # noqa: F401 +if TYPE_CHECKING: + import builtin_interfaces.msg + class StateTransition(Event): """Event emitted when a lifecycle node makes a state transition.""" @@ -45,7 +49,7 @@ def __init__( super().__init__() self.__action = action self.__msg = msg - self.__timestamp = msg.timestamp + self.__stamp = msg.stamp self.__transition = msg.transition.label self.__start_state = msg.start_state.label self.__goal_state = msg.goal_state.label @@ -61,9 +65,9 @@ def msg(self) -> lifecycle_msgs.msg.TransitionEvent: return self.__msg @property - def timestamp(self) -> int: - """Getter for timestamp.""" - return self.__timestamp + def stamp(self) -> 'builtin_interfaces.msg.Time': + """Getter for stamp.""" + return self.__stamp @property def transition(self) -> Text: