Calling a C++ class from pytorch

Hello boys,

I have looked into the cffi extensions but it seems all the examples are based on c code examples.

I am working with the message_filters class in ROSCPP to exchange image from different sensors on a robot. I will like to process the sensor images with pytorch. rospy would not help given its non-support for the message_filters class. Besides, the little support that was added in python is very slow. It seems my best bet is to write a cffi extension and import my class into pytorch.

Are there any examples of exporting c++ classes with cffi extension in pytorch? Would appreciate any pointers on this. Thanks!

Pardon me. We cannot transport images with cvBridge but it seems someone has a nice way of subscribing to compressed images without the hassle of message_filters.

Still, it would be interesting to know how to write cffi extensions with c++ classes for the sake of the future.