Skip to content

Commit

Permalink
Modify topic for label_info in segmentation_camera
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunseok-yang committed Mar 8, 2024
1 parent e186e5d commit 16f7080
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class CameraBase : public Base

protected:
std::string frame_id_;
std::string topic_base_name_;

// image buffer from simulator
cloisim::msgs::ImageStamped pb_img_;
Expand Down
6 changes: 3 additions & 3 deletions cloisim_ros_camera/src/camera_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ CameraBase::CameraBase(
const string namespace_)
: Base(node_name, namespace_, options_)
, frame_id_("camera_link")
, topic_base_name_("")
{
topic_name_ = "camera";
// DBG_SIM_INFO("CameraBase");
}

Expand Down Expand Up @@ -85,11 +87,9 @@ void CameraBase::InitializeCameraInfo()

void CameraBase::InitializeCameraPublish()
{
topic_name_ = "camera";

msg_img_.header.frame_id = frame_id_;

const auto topic_base_name_ = GetPartsName() + "/" + topic_name_;
topic_base_name_ = GetPartsName() + "/" + topic_name_;

image_transport::ImageTransport it(GetNode());
pub_ = it.advertiseCamera(topic_base_name_ + "/image_raw", 1);
Expand Down
3 changes: 2 additions & 1 deletion cloisim_ros_camera/src/segmentation_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ void SegmentationCamera::InitializeCameraData()
AddPublisherThread(data_bridge_ptr, bind(&SegmentationCamera::PublishData, this, std::placeholders::_1));
}

pub_labelinfo_ = create_publisher<vision_msgs::msg::LabelInfo>("label_info", rclcpp::QoS(rclcpp::KeepLast(1)).transient_local());
pub_labelinfo_ = create_publisher<vision_msgs::msg::LabelInfo>(
topic_base_name_ + "/label_info", rclcpp::QoS(rclcpp::KeepLast(1)).transient_local());

DBG_SIM_INFO("%s hashKey: data(%s)", typeid(this).name(), hashKeyData.c_str());
}
Expand Down

0 comments on commit 16f7080

Please sign in to comment.