Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions launch_ros/launch_ros/events/lifecycle/state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Module for StateTransition event."""

from typing import Text
from typing import TYPE_CHECKING

from launch.event import Event

Expand All @@ -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."""
Expand All @@ -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
Expand All @@ -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:
Expand Down