Skip to content

Commit

Permalink
correctly respect external ROS namespace
Browse files Browse the repository at this point in the history
- currently majority of topics is advertised under absolute paths
- and some under relative

Corretly use relative paths when advertizing topics

Related to:
- orbbec#23
  • Loading branch information
bmegli committed Jan 16, 2024
1 parent 54ca6bc commit 9896f6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ros_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ void OBCameraNode::setupPublishers() {
continue;
}
std::string name = stream_name_[stream_index];
std::string topic_name = "/" + camera_name_ + "/" + name + "/image_raw";
std::string topic_name = camera_name_ + "/" + name + "/image_raw";
ros::SubscriberStatusCallback image_subscribed_cb =
boost::bind(&OBCameraNode::imageSubscribedCallback, this, stream_index);
ros::SubscriberStatusCallback image_unsubscribed_cb =
boost::bind(&OBCameraNode::imageUnsubscribedCallback, this, stream_index);
image_publishers_[stream_index] = nh_.advertise<sensor_msgs::Image>(
topic_name, 1, image_subscribed_cb, image_unsubscribed_cb);
topic_name = "/" + camera_name_ + "/" + name + "/camera_info";
topic_name = camera_name_ + "/" + name + "/camera_info";
camera_info_publishers_[stream_index] = nh_.advertise<sensor_msgs::CameraInfo>(
topic_name, 1, image_subscribed_cb, image_unsubscribed_cb);
}
Expand Down

0 comments on commit 9896f6b

Please sign in to comment.