Send an opaque pointer through client-server setup [closed]

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

Atul Ahirrao gravatar image

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: , 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 reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Atul Ahirrao
close date 2019-12-17 10:55:17.072198


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 image ahendrix  ( 2019-11-27 21:08:25 -0500 )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 image Atul Ahirrao  ( 2019-12-05 11:16:43 -0500 )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 image ahendrix  ( 2019-12-05 11:59:31 -0500 )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 image Atul Ahirrao  ( 2019-12-05 15:25:40 -0500 )edit

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

ahendrix gravatar image ahendrix  ( 2019-12-06 23:06:39 -0500 )edit

Sorry for the late reply @ahendrix. Apparently the opaque pointer is not supposed to be shared. So I ended up creating ROS topic to share the underlying entities in the "SomeContext_t". Thanks for your advice and also I found out some other pointers from your other threads :)

Atul Ahirrao gravatar image Atul Ahirrao  ( 2019-12-13 13:00:45 -0500 )edit