@@ -122,13 +122,6 @@ class Tree
122122
123123 [[nodiscard]] TreeNode* rootNode () const ;
124124
125- // / Function signature for a custom sleep override.
126- // / The function receives the desired sleep duration and a reference to the
127- // / WakeUpSignal so it can check for early wake-up.
128- // / Return true if woken up before the timeout, false if the full duration elapsed.
129- using SleepOverrideFunc =
130- std::function<bool (std::chrono::system_clock::duration, WakeUpSignal&)>;
131-
132125 /* *
133126 * @brief Sleep for a certain amount of time. This sleep could be interrupted by the methods
134127 * TreeNode::emitWakeUpSignal() or Tree::emitWakeUpSignal()
@@ -145,12 +138,12 @@ class Tree
145138 void emitWakeUpSignal ();
146139
147140 /* *
148- * @brief Set a custom sleep override function. When set, Tree::sleep()
149- * will delegate to this function instead of using the default
150- * WakeUpSignal::waitFor(). This allows integrating with external clock
151- * sources (e.g. ROS sim time) while preserving wake-up signal support .
141+ * @brief Returns the shared WakeUpSignal used by this tree.
142+ * This can be used to check for preemption externally, e.g. when
143+ * implementing custom sleep logic with a different clock source.
144+ * Returns nullptr if the tree has not been initialized yet .
152145 */
153- void setSleepOverride (SleepOverrideFunc func) ;
146+ [[nodiscard]] std::shared_ptr<WakeUpSignal> wakeUpSignal () const ;
154147
155148 ~Tree ();
156149
@@ -211,7 +204,6 @@ class Tree
211204 friend class BehaviorTreeFactory ;
212205
213206 std::shared_ptr<WakeUpSignal> wake_up_;
214- SleepOverrideFunc sleep_override_;
215207
216208 enum TickOption
217209 {
0 commit comments