Closed ftatp closed 1 year ago
One simple solution would be to pass different lambda functions to the different Subscribe calls:
_ros.Subscribe<PointCloud2>(topicName1, msg=>GeneratePointCloud(msg, topicName1));
_ros.Subscribe<PointCloud2>(topicName2, msg=>GeneratePointCloud(msg, topicName2));
_ros.Subscribe<PointCloud2>(topicName3, msg=>GeneratePointCloud(msg, topicName3));
GeneratePointCloud(PointCloud2 message, string topicName)
{
~~
}
And yes, we do accept submissions on this repo, though we probably wouldn't be interested in this specific change.
I have to subscribe more than 2 nodes at once with the same type of message.
Each generated pointCloud needs to know which topic it is from. But because there is no parameter in the CallbackFunction that describes the topic, I have to make different callback functions for each different topics doing the same thing.
So the best thing that I think is making an override of Subscribe that has the parameters like this: Subscribe(string topic, Callback<T, string topic>);
P.S. I want to contribute on the ROSConnection.dll to test it. Is it possible for me to look into the codes and modify it? I'll just fork it and give some pull requests