Skip to content

Conversation

Nosille
Copy link

@Nosille Nosille commented Aug 15, 2025

Public API Changes

Reorganized codebase to isolate subscribers from streamers.
Created image_transport and pointcloud2 subscribers.
Added parameters to control how pointcloud2 msg is converted into an image stream within pointcloud2 subscriber.

Description

This is a big change that will probably take a little back and forth. If you are not interested let me know. The goal was to make it possible to subscribe to ros msg formats other than images and convert them to image streams. Existing msgs subscription capabilities were moved from the existing streamer files to a new image_transport_subscriber file. A new pointcloud2_subscriber option was added that subscribes to pointcloud2 msgs, projects them into a 2d image (user selected viewing frame with parameters for height, width, and focal length), then sends the resulting image to any of the existing streamers.

When coupled with a package like (https://github.com/naoki-mizuno/spacenav_rviz) that moves the selected viewing frame in real time. It is possible to generate a streaming flythrough of a pointcloud with this change.

@bjsowa
Copy link
Member

bjsowa commented Aug 30, 2025

Thanks for your contribution! Haven't look through the code yet but I'm having my doubts whether this belongs here. When developing with ROS, I always try to follow a principle which says that a node should perform a single logical function. In case of web_video_server, it's streaming image topics to the web. Instead of adding this functionality to web_video_server, wouldn't you rather create a separate node for converting point clouds to images and run it together with web_video_server?

@Nosille
Copy link
Author

Nosille commented Sep 17, 2025

You make a good point, and I generally approach ROS the same way. However, after trying several different approaches for converting pointclouds to images, I settled on this addition to web_video_server as the best solution for my needs. Take a look at the code before you rule it out. I was able to mostly isolate the pointcloud2 stuff to a single independent class. Further, I think I improved the organization of streamers/subscribers witihin web_video_server beyond the addition of the pointcloud2 class.

A little background. We are remotely controlling our robot over a very low bandwidth connection (< 50 Mb/s). As a result, direct access to ros images is questionable and direct access to lidar data is out of the question. We started using web_video_server to reduce the bandwidth requirements for our driving cameras and it made a big difference. Later when we needed to access lidar data, we created a standalong pointcloud to image publisher to leverage image compression. The approach worked but was clunky in the sense that we kept adding more and more image publisher nodes for all the different frames of reference and maps we wanted access to. In additional, all of those nodes were running regardless of current use by the remote computer. This implementation within web_video_server allows us to remotely start and stop pointcloud to image processing as needed while also changing critical setting through changes to the http call. No need to anticipate topics or independently change parameters in third party nodes.

@bjsowa
Copy link
Member

bjsowa commented Oct 8, 2025

Sorry for the delay. I will try to finally reserve some time to push this further.

Further, I think I improved the organization of streamers/subscribers witihin web_video_server beyond the addition of the pointcloud2 class.

Could you split the refactor of streamers/subscribers into a separate PR?

@Nosille
Copy link
Author

Nosille commented Oct 8, 2025

I can work on that.

@bjsowa
Copy link
Member

bjsowa commented Oct 19, 2025

@Nosille You may want to look at #192 .

@Nosille
Copy link
Author

Nosille commented Oct 20, 2025

Nice! There seems to be a lot of overlap between what I tried to accomplish with my refactor and the plugin approach. I will look into what it would take to make my stuff compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants