-
Notifications
You must be signed in to change notification settings - Fork 207
Add Pointcloud2 Subscriber #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ros2
Are you sure you want to change the base?
Conversation
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 |
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. |
Sorry for the delay. I will try to finally reserve some time to push this further.
Could you split the refactor of streamers/subscribers into a separate PR? |
I can work on that. |
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. |
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.