3131#include " rclcpp/node_interfaces/node_base_interface.hpp"
3232#include " rclcpp/node_interfaces/node_logging_interface.hpp"
3333#include " rclcpp/node_interfaces/node_services_interface.hpp"
34+ #include " rclcpp/node_interfaces/node_clock_interface.hpp"
3435
3536#include " rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
3637
@@ -52,10 +53,12 @@ namespace rclcpp_lifecycle
5253LifecycleNode::LifecycleNodeInterfaceImpl::LifecycleNodeInterfaceImpl (
5354 std::shared_ptr<rclcpp::node_interfaces::NodeBaseInterface> node_base_interface,
5455 std::shared_ptr<rclcpp::node_interfaces::NodeServicesInterface> node_services_interface,
55- std::shared_ptr<rclcpp::node_interfaces::NodeLoggingInterface> node_logging_interface)
56+ std::shared_ptr<rclcpp::node_interfaces::NodeLoggingInterface> node_logging_interface,
57+ std::shared_ptr<rclcpp::node_interfaces::NodeClockInterface> node_clock_interface)
5658: node_base_interface_(node_base_interface),
5759 node_services_interface_ (node_services_interface),
58- node_logging_interface_(node_logging_interface)
60+ node_logging_interface_(node_logging_interface),
61+ node_clock_interface_(node_clock_interface)
5962{
6063}
6164
@@ -86,6 +89,8 @@ LifecycleNode::LifecycleNodeInterfaceImpl::init(bool enable_communication_interf
8689 state_machine_options.enable_com_interface = enable_communication_interface;
8790 state_machine_options.allocator = node_options->allocator ;
8891
92+ rcl_clock_t * clock = node_clock_interface_->get_clock ()->get_clock_handle ();
93+
8994 // The call to initialize the state machine takes
9095 // currently five different typesupports for all publishers/services
9196 // created within the RCL_LIFECYCLE structure.
@@ -97,6 +102,7 @@ LifecycleNode::LifecycleNodeInterfaceImpl::init(bool enable_communication_interf
97102 rcl_ret_t ret = rcl_lifecycle_state_machine_init (
98103 &state_machine_,
99104 node_handle,
105+ clock,
100106 ROSIDL_GET_MSG_TYPE_SUPPORT (lifecycle_msgs, msg, TransitionEvent),
101107 rosidl_typesupport_cpp::get_service_type_support_handle<ChangeStateSrv>(),
102108 rosidl_typesupport_cpp::get_service_type_support_handle<GetStateSrv>(),
0 commit comments