feat: Add subscriber plugins using pluginlib#198
feat: Add subscriber plugins using pluginlib#198Nosille wants to merge 22 commits intoRobotWebTools:ros2from
Conversation
|
Thank you for the PR. I'll try find some time to review it till the end of the week (ping me if I forget). My only request for now is to split it into 2 separate PRs, one that changes the classes structure and one that adds the pointcloud subscriber plugin. |
|
I finally found time to remove the pointcloud2 stuff. I will make a separate pull request after this one is complete. |
bjsowa
left a comment
There was a problem hiding this comment.
Sorry I couldn't find much time to review this. I generally like the idea of separating streamers and subscribers. I quickly skimmed through the code and the solution looks alright. My only concern is that the subscriber interface only works for streamers which expect a raw image. This does not fit with the ros_compressed streamer which never decodes the image.
I'll try to take go back to it later next week. For now, try to pass CI.
include/web_video_server/subscribers/image_transport_subscriber.hpp
Outdated
Show resolved
Hide resolved
include/web_video_server/subscribers/pointcloud2_subscriber.hpp
Outdated
Show resolved
Hide resolved
f169af0 to
cdd9d2e
Compare
cdd9d2e to
3e5555c
Compare
3e5555c to
be02e1d
Compare
|
When I removed the pointcloud2 subscriber I didn't remove its dependencies. Most of these comments are a result of that. They have been removed now. Seems like the CI/CD errors are all format related. I do not have much practice with formatters and my first attempt resulted in many more changes than I think you are looking for. Any advice? I don't see format guidance in this projects documentation. The compressed image streamer is an odd ball that doesn't quite fit. I handled it by simply letting it stay the way it was , i.e., it doesn't actually use the subscriber list sent to it. Another weakness in my current implementation is that each streamer will use the first subscriber factory that says it can handle the current msg type. It currently isn't a problem, but could become one as redundant subscribers are added. I am a little unsure how best to handle it, and I am open to suggestions. |
For formatting, just use: |
|
If you want to run clang-tidy tests locally, make sure to compile with then run: If you want to make it faster, add Some of the errors can be fixed automatically with |
Public API Changes
Reorganized codebase to isolate subscribers from streamers.
Make subscribers an additional pluginlib class (base_class_type="web_video_server::SubscriberFactoryInterface">)
Created image_transport and pointcloud2 subscribers
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. This was done in a plugin-able fashion. Existing image_transport based subscription capabilities were removed from the existing streamer plugins and replaced with a new subscriber plugin. A new pointcloud2_subscriber plugin 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. A somewhat silly subscriber plugin example/tutorial was created in the docs that converts a string msg into an image.