File tree 1 file changed +5
-5
lines changed
behaviortree_ros2/include/behaviortree_ros2
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
175
175
*/
176
176
virtual NodeStatus onTick (const std::shared_ptr<TopicT>& last_msg) = 0;
177
177
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 ,
180
180
* the next call will process the same message again, if no new message received.
181
181
*
182
182
* This can be equated with latched vs non-latched topics in ros 1.
183
183
*
184
- * @return true will clear the message after ticking/processing.
184
+ * @return false will clear the message after ticking/processing.
185
185
*/
186
- virtual bool clearProcessedMessage () { return true ; }
186
+ virtual bool latchLastMessage () const { return false ; }
187
187
188
188
private:
189
189
@@ -317,7 +317,7 @@ template<class T> inline
317
317
};
318
318
sub_instance_->callback_group_executor .spin_some ();
319
319
auto status = CheckStatus (onTick (last_msg_));
320
- if (clearProcessedMessage ())
320
+ if (! latchLastMessage ())
321
321
{
322
322
last_msg_.reset ();
323
323
}
You can’t perform that action at this time.
0 commit comments