Send an opaque pointer through client-server setup

asked 2019-11-27 15:19:15 -0600

Ubuntu 16.04 - ROS Kinetic Kame

I have an opaque pointer which is defined in .h file as follows:

typedef struct SomeObject* SomeContext_t;

I need to share this between different nodes as the entities defined in SomeContext_t only exists in itself. I am doing this to have external control over a sdk without having to send data through TCP/IP i.e I want to have decentralised control over components. Already considered nodelets but do not want to use it because it will go down even if one nodelet goes down.

Looking at this question: https://answers.ros.org/question/2085... , is it possible to customize msg/srv to send such type of pointer? It says that one can use custom message but I am unable to understand how? I have already read the tutorials for customizing message but could not comprehend

edit retag flag offensive close merge delete

Comments

As noted in the previous question, you can't pass pointers between different processes. If you want a more detailed answer, you should tell us what the object that you're trying to pass actually is.

ahendrix gravatar imageahendrix ( 2019-11-27 21:08:25 -0600 )edit

The object is an opaque pointer, which is obviously protected by whoever wrote it down. I know how to use it from the documentation but type of this pointer, I am completely clueless.

Atul Ahirrao gravatar imageAtul Ahirrao ( 2019-12-05 11:16:43 -0600 )edit

If you cannot provide any more information, then I cannot help you, and I suspect that what you're asking is not possible.

Instead of sharing the pointer, you may need to build a ROS API that proxies to the SDK that you're trying to use.

ahendrix gravatar imageahendrix ( 2019-12-05 11:59:31 -0600 )edit

I wish I could but it is a black-box to me. What do you mean by building a ROS API that proxies the SDK?

Atul Ahirrao gravatar imageAtul Ahirrao ( 2019-12-05 15:25:40 -0600 )edit

For each function in the API, make a ROS service or topic for that part of the API.

ahendrix gravatar imageahendrix ( 2019-12-06 23:06:39 -0600 )edit