ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to use C++ subscribe to a custom msg array published by Python

asked 2019-05-30 06:00:25 -0500

ffzj gravatar image

updated 2019-05-30 06:02:19 -0500

gvdhoorn gravatar image

I use python publish a msg like this:

    int32 Num
    string color
    string name
   InfoData[] Infos

Now I want to use C++ subscribe the InfoDataArray.mag and store in the Structure. how to do this ?

edit retag flag offensive close merge delete



Please tell us what you've tried yourself already.

We're here to help, but not to write your code for you.

Susbcribers and publishers are language agnostic. It doesn't matter whether you "publish in Python" or "subscribe in C++". The data will arrive.

gvdhoorn gravatar image gvdhoorn  ( 2019-05-30 06:03:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-05-30 07:55:35 -0500

First place to start would be: (from ROS Wiki Tutorial). The callback is where you will handle the parsing of the message and subsequent storing into your array I think.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-05-30 06:00:25 -0500

Seen: 419 times

Last updated: May 30 '19