I use a cart equipped with a binocular camera for purely visual navigation tasks.
However, because my ground material is reflective, the cart will misidentify the scanned ground as an obstacle when navigating, making it impossible to navigate.
I would like to ask if there is a way to solve this problem at the software level.
My humble opinion is to filter out the lower part of the image scanned by the camera directly in rtabmap.
I donât know if it is possible directly in rtabmap. But you could write a custom node that filters the input image by cropping a part of it and keeping the other part that serves you. You can do that using openCV and Numpy if you are working with Python.
In this example the image is cropped by keeping all pixels that are vertically starting at 30px and ending at 250px, and horizontally from 100px to 230px, the rest gets discarded.
You could use this kind of functionality applied to a node that subscribes to the original image and publishes the cropped image.
just like this pic, the camera node published depth data through the /origin_topic, and the suber subscribed it.
I modified the data and publish it through /new_topic. But I have no method to deliver it to suber. Because I donât want to change the suberâs code.
So Iâm wondering if there is a way to deliver the modified data to the original subscriber without modifying his code.
Hello @zlwnge , I am not sure if I understand you correctly. Why would the subscriber subscribe to both /origin and also /new ? Should it not subscribe to one topic or the other? Why subscribe to both?
Iâm very sorry I didnât articulate what I meant.
I want subscribers to subscribe to the âoriginâ that I have modified. That is, I want to act as an invisible hand and drop the data in the middle without informing both parties.
Itâs like when two people write a letter and I open the envelope halfway, change a paragraph, put it back in the original envelope, and pass it on to the subscriber.
Please let me know if there is anything I havenât described clearly.
Hi @zlwnge,
from your image (by the way I think your image is missing one node that modifies the data) and your explanation it seems to me that you want to implement two nodes in parallel. One node that only republishes data without modifying it and one node that modifies the data.
So your camera node publishes data to the topic /origin. Then you have one node âNode Aâ that subscribe to topic âoriginâ and publishes to topic ânewâ without modifying anything. Then you have another node âNode Bâ that also subscribe to topic âoriginâ and publishes to topic ânewâ but modifies the data. Finally your node that uses the data subscribes to the topic ânewâ. This last node will get unmodified and modified data.
I still cannot understand why you would want to have a node that gets modified and unmodified data through the same topic but this is how I would implement it is I would need to do so.
Node A publish data to topic /depth/image, then Node B gets data from /depth/image.
Now I let a Node C subscribe the /depth/image and get the data, then Node C modified the data. But I still want to publish it to the topic /depth/image, thus making Node B get the modified data rather than the origin data.
But now I know this seems impossible. Because it is not possible to deliver two different pieces of data on one topic, even though their message types are the same. It seems to cause conflict, right?
Thank you very much for your patience and guidance!
zlwnge
Hi @zlwnge,
you can have multiple nodes publishing to the same topic that is possible. From the technical point of view you can do that, no problem. My question is more about the logical point of view, why would you want Node C to subscribe to both unmodified data from Node A and also simultaneously modified data from node B.
But regardless, you can move on and implement it, technically it is possible.