Add transport type dropdown for pointclouds#1
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a transport type dropdown to point cloud displays, enabling users to select different transport methods (raw, draco, zstd, zlib, cloudini) for subscribing to point cloud topics. This is a temporary fix to allow subscription to point_cloud_interfaces/msg/CompressedPointCloud2.
Changes:
- Replaced static transport detection from topic names with dynamic transport selection via UI dropdown
- Added auto-selection logic that prefers compressed transports when available
- Implemented transport plugin discovery and filtering based on advertised topics
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for (const auto & preferred : preferred_order) { | ||
| if (transport_plugin_types_.count(preferred) > 0) { | ||
| // Check if it appears in the option list (i.e. it's advertised). | ||
| for (const auto & [topic_name2, topic_types2] : published_topics) { |
There was a problem hiding this comment.
The variable topic_types2 in the structured binding is never used. Consider using std::ignore or an underscore to indicate that the value is intentionally unused, which would make the code's intent clearer and potentially avoid compiler warnings in strict builds.
| for (const auto & [topic_name2, topic_types2] : published_topics) { | |
| for (const auto & topic_entry : published_topics) { | |
| const auto & topic_name2 = topic_entry.first; |
| std::map<std::string, std::vector<std::string>> published_topics = | ||
| node->get_topic_names_and_types(); | ||
|
|
||
| for (const auto & [topic_name, topic_types] : published_topics) { |
There was a problem hiding this comment.
The variable topic_types in the structured binding is never used. Consider using std::ignore or an underscore to indicate that the value is intentionally unused, which would make the code's intent clearer and potentially avoid compiler warnings in strict builds.
Temporary fix to allow subscription to point_cloud_interfaces/msg/CompressedPointCloud2.
In the long term, this is probably the way to go:
ros2#1288