Can I transmit data via ROS in deepstream?

**• Hardware Platform (Jetson / GPU)**Jetson
• DeepStream Version6.0.
I am using sample: deepstream_app, I wonder if I can transmit some messages via ROS if I just using command :
deepstream-app -c deepstream_app_config.txt
to run the program

What do you mean by “transmit some messages via ROS”? Do you mean to send some messages from deepstream-app to some ROS nodes? What kind of messages through which protocol do you want?

Yes,I want to send messages from deepstream-app to some ROS nodes.The messages are actually the (x,y) coordinates stored in the NvDsObjectMeta.The codes may be like:

void pub_state()
{
    ros::NodeHandle nd;
    ros::Publisher pub = nd.advertise<geometry_msgs::PoseStamped>("/coordinates", 1);
    ros::Rate loop_rate(10);
    while (ros::ok())
    {
        geometry_msgs::PoseStamped example;
        ros::Time currentTime = ros::Time::now();
        example.header.stamp = currentTime;
        example.pose.position.x = x;
        example.pose.position.y = y;

        pub.publish(example);
        loop_rate.sleep();
        ros::spinOnce();
    }
}

Can you tell us what kind of IPC protocol do you want to transfer the data? If there any data receiving function with your ROS nodes?

What kind of ROS node are you working on?

The plan is that I send messages via topic from deepstream to the camera node to subscribe the topic;then the camera will process the x,y coordinates to x,y,z and then send it to robot node to subscribe.

Generally speaking,I will control the robot and the camera by setting the same ip address network segment.

Are you talking about the camera you mentioned in Can I create depth image from NvBufSurface? - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums?

Can the camera support message broker?

Is your ROS also running on the same Jetson platform as the DeepStream app is running on?

Yes,that’s the camera I mention.
I think that I should write another python code to cope with the depth images and receive the topic message from deepstream.

Yes,the ROS is on the same Jetson platform

So your design is that there are three processes running in Jetson.

  1. A python app which get the depth images from the camera
  2. The “deepstream-app” to do the inferencing with normal 2D frames from the cemera
  3. The ROS node

You want to transfer some message between 1 and 2, 2 and 3. Right?

I think 1 and 2 are connected by 3,isn’t it?

The ROS may be just a media to complete the communication between topics. And for 2,it publishes the topic, for 1,it receives the topic.

Connected by what? Do you mean you design the ROS node as the message broker server while 1 and 2 are all clients?

Can you explain which is server and which is client?

Are you designing your own ROS node which will involve DeepStream and the camera SDK?

I find a picture to explain the communication:

ROS Master is responsible for managing the registration information of Talkers and Listeners, matching Talkers and Listeners with the same topic, and helping Talkers establish connections with Listeners. After the connection is established, Talkers can publish messages, and the published messages will be subscribed to by Listeners.

So,here the deepstream as talker to publish the topic messages and camera in another python program as listener to subscribe the topic.

server and client is another communication way of ROS called Service.Here I am using the Topic way

Currently, the DeepStream message broker Gst-nvmsgbroker — DeepStream documentation only supports the cloud protocols such as Kafka, Redis, AMQP,…

You may need to customize your own message broker protocol according to Gst-nvmsgbroker — DeepStream documentation

Another method is to write your own DeepStream app, create a separated thread besides the main thread of DeepStream pipeline, get the bbox coordinates and the frame information in the probe function, and send the data and information to the new thread. In the new thread, you can implement the ROS topic publish functions.

Can you tell us which company your are working for? You may send through the forum’s private messages if you don’t want to share the information publicly.

Thanks, I will try that

I am just a postgraduate in a university.Is there anything I can offer to help you?

Thanks for your interest in DeepStream. Wish the answer may help you!