Skip to content

Commit b87d701

Browse files
mergify[bot]lreiherEmre Karincali
authored
add support for ffmpeg_image_transport and point_cloud_transport (#1568) (#1571)
(cherry picked from commit a33b5e9) Co-authored-by: Lennart Reiher <[email protected]> Co-authored-by: Emre Karincali <[email protected]>
1 parent 380abd3 commit b87d701

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

rviz_default_plugins/src/rviz_default_plugins/displays/camera/camera_display.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#include "rviz_common/display_context.hpp"
6868
#include "rviz_common/load_resource.hpp"
6969

70+
#include "rviz_default_plugins/displays/image/get_transport_from_topic.hpp"
7071
#include "rviz_default_plugins/displays/image/ros_image_texture.hpp"
7172

7273
namespace rviz_default_plugins
@@ -185,7 +186,6 @@ void CameraDisplay::onInitialize()
185186
this->addChild(visibility_property_, 0);
186187
}
187188

188-
189189
void CameraDisplay::setupSceneNodes()
190190
{
191191
background_scene_node_ = scene_node_->createChildSceneNode();
@@ -346,7 +346,7 @@ void CameraDisplay::createCameraInfoSubscription()
346346
// TODO(anyone) Store this in a member variable
347347

348348
std::string camera_info_topic = image_transport::getCameraInfoTopic(
349-
topic_property_->getTopicStd());
349+
getBaseTopicFromTopic(topic_property_->getTopicStd()));
350350

351351
rclcpp::SubscriptionOptions sub_opts;
352352
sub_opts.event_callbacks.message_lost_callback =
@@ -409,7 +409,7 @@ void CameraDisplay::clear()
409409
current_caminfo_.reset();
410410

411411
std::string camera_info_topic =
412-
image_transport::getCameraInfoTopic(topic_property_->getTopicStd());
412+
image_transport::getCameraInfoTopic(getBaseTopicFromTopic(topic_property_->getTopicStd()));
413413

414414
setStatus(
415415
StatusLevel::Warn, CAM_INFO_STATUS,
@@ -456,7 +456,7 @@ bool CameraDisplay::updateCamera()
456456

457457
if (!info) {
458458
std::string camera_info_topic = image_transport::getCameraInfoTopic(
459-
topic_property_->getTopicStd());
459+
getBaseTopicFromTopic(topic_property_->getTopicStd()));
460460

461461
setStatus(
462462
StatusLevel::Warn, CAM_INFO_STATUS,

rviz_default_plugins/src/rviz_default_plugins/displays/image/get_transport_from_topic.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ namespace displays
3939
bool isRawTransport(const std::string & topic)
4040
{
4141
std::string last_subtopic = topic.substr(topic.find_last_of('/') + 1);
42-
return last_subtopic != "compressed" && last_subtopic != "compressedDepth" &&
43-
last_subtopic != "theora";
42+
return last_subtopic != "compressed" &&
43+
last_subtopic != "compressedDepth" &&
44+
last_subtopic != "theora" &&
45+
last_subtopic != "ffmpeg";
4446
}
4547

4648
std::string getTransportFromTopic(const std::string & topic)

rviz_default_plugins/src/rviz_default_plugins/displays/pointcloud/get_transport_from_topic.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ bool isPointCloud2RawTransport(const std::string & topic)
4040
{
4141
std::string last_subtopic = topic.substr(topic.find_last_of('/') + 1);
4242
return last_subtopic != "draco" && last_subtopic != "zlib" &&
43-
last_subtopic != "pcl" && last_subtopic != "zstd";
43+
last_subtopic != "pcl" && last_subtopic != "zstd" &&
44+
last_subtopic != "cloudini";
4445
}
4546

4647
std::string getPointCloud2TransportFromTopic(const std::string & topic)

0 commit comments

Comments
 (0)