File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
behaviortree_ros2/include/behaviortree_ros2 Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -175,15 +175,15 @@ class RosTopicSubNode : public BT::ConditionNode
175175 */
176176 virtual NodeStatus onTick (const std::shared_ptr<TopicT>& last_msg) = 0;
177177
178- /* * Clear the message that has been processed. If returns true and no new message is
179- * received, before next call there will be no message to process. If returns false ,
178+ /* * latch the message that has been processed. If returns false and no new message is
179+ * received, before next call there will be no message to process. If returns true ,
180180 * the next call will process the same message again, if no new message received.
181181 *
182182 * This can be equated with latched vs non-latched topics in ros 1.
183183 *
184- * @return true will clear the message after ticking/processing.
184+ * @return false will clear the message after ticking/processing.
185185 */
186- virtual bool clearProcessedMessage () { return true ; }
186+ virtual bool latchLastMessage () const { return false ; }
187187
188188private:
189189
@@ -317,7 +317,7 @@ template<class T> inline
317317 };
318318 sub_instance_->callback_group_executor .spin_some ();
319319 auto status = CheckStatus (onTick (last_msg_));
320- if (clearProcessedMessage ())
320+ if (! latchLastMessage ())
321321 {
322322 last_msg_.reset ();
323323 }
You can’t perform that action at this time.
0 commit comments