Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addressing rtabmap node
message_filters
callback delay. This PR implements the suggested approach for ros2 from this comment: #1054 (comment)CommonDataSubscriber
virtual functions:CommonDataSubscriber::commonMultiCameraCallback()
thread-safeCommonDataSubscriber::commonLaserScanCallback()
thread-safeCommonDataSubscriber::commonOdomCallback()
thread-safeCommonDataSubscriber::commonSensorDataCallback()
thread-safePossible issues (I think this also applies to old approach):
CommonDataSubscriber
are called from synchronization thread. For examples,CoreWrapper::commonMultiCameraCallback()
does independent pre-processing of the data before sending a SensorData toCoreWrapper::process()
, there could be where we call the timer callback to change thread (note that we can skip all messages conversions if we know rtabmap is currently processing previous data, and just do the odometry update doing stuff of the previous point).Update: Related to above issues, even if now we process all sync topics for odometry checks, we can miss some of them if odometry topic cannot be exactly synchronized with images/lidar data. Ideally, we should remove odometry topic from message_filters and process them independently. I'll check if this could be done easily, otherwise I'll create an issue about that and merge this PR. Added issue here: #1222