Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion depth_image_proc/src/point_cloud_xyz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ PointCloudXyzNode::PointCloudXyzNode(const rclcpp::NodeOptions & options)
{
std::lock_guard<std::mutex> lock(connect_mutex_);
if (s.current_count == 0) {
sub_depth_.shutdown();
// Reset the subscriber instead of calling shutdown(): shutdown() leaves the
// synchronization check timer of the CameraSubscriber running, which crashes
// when it fires after the subscriptions are destroyed.
sub_depth_ = image_transport::CameraSubscriber();
} else if (!sub_depth_) {
// For compressed topics to remap appropriately, we need to pass a
// fully expanded and remapped topic name to image_transport
Expand Down
5 changes: 4 additions & 1 deletion depth_image_proc/src/point_cloud_xyz_radial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ PointCloudXyzRadialNode::PointCloudXyzRadialNode(const rclcpp::NodeOptions & opt
{
std::lock_guard<std::mutex> lock(connect_mutex_);
if (s.current_count == 0) {
sub_depth_.shutdown();
// Reset the subscriber instead of calling shutdown(): shutdown() leaves the
// synchronization check timer of the CameraSubscriber running, which crashes
// when it fires after the subscriptions are destroyed.
sub_depth_ = image_transport::CameraSubscriber();
} else if (!sub_depth_) {
// For compressed topics to remap appropriately, we need to pass a
// fully expanded and remapped topic name to image_transport
Expand Down
5 changes: 4 additions & 1 deletion image_proc/src/crop_decimate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ CropDecimateNode::CropDecimateNode(const rclcpp::NodeOptions & options)
[this](rclcpp::MatchedInfo &)
{
if (pub_.getNumSubscribers() == 0) {
sub_.shutdown();
// Reset the subscriber instead of calling shutdown(): shutdown() leaves the
// synchronization check timer of the CameraSubscriber running, which crashes
// when it fires after the subscriptions are destroyed.
sub_ = image_transport::CameraSubscriber();
} else if (!sub_) {
// Create subscriber with QoS matched to subscribed topic publisher
auto qos_profile = getQosProfile(this, image_topic_);
Expand Down
5 changes: 4 additions & 1 deletion image_proc/src/rectify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ RectifyNode::RectifyNode(const rclcpp::NodeOptions & options)
[this](rclcpp::MatchedInfo &)
{
if (pub_rect_.getNumSubscribers() == 0) {
sub_camera_.shutdown();
// Reset the subscriber instead of calling shutdown(): shutdown() leaves the
// synchronization check timer of the CameraSubscriber running, which crashes
// when it fires after the subscriptions are destroyed.
sub_camera_ = image_transport::CameraSubscriber();
} else if (!sub_camera_) {
// Create subscriber with QoS matched to subscribed topic publisher
auto qos_profile = getQosProfile(this, image_topic_);
Expand Down
5 changes: 4 additions & 1 deletion image_proc/src/resize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ ResizeNode::ResizeNode(const rclcpp::NodeOptions & options)
[this](rclcpp::MatchedInfo &)
{
if (pub_image_.getNumSubscribers() == 0) {
sub_image_.shutdown();
// Reset the subscriber instead of calling shutdown(): shutdown() leaves the
// synchronization check timer of the CameraSubscriber running, which crashes
// when it fires after the subscriptions are destroyed.
sub_image_ = image_transport::CameraSubscriber();
} else if (!sub_image_) {
// Create subscriber with QoS matched to subscribed topic publisher
auto qos_profile = getQosProfile(this, image_topic_);
Expand Down
5 changes: 4 additions & 1 deletion image_proc/src/track_marker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ TrackMarkerNode::TrackMarkerNode(const rclcpp::NodeOptions & options)
[this](rclcpp::MatchedInfo &)
{
if (pub_->get_subscription_count() == 0) {
sub_camera_.shutdown();
// Reset the subscriber instead of calling shutdown(): shutdown() leaves the
// synchronization check timer of the CameraSubscriber running, which crashes
// when it fires after the subscriptions are destroyed.
sub_camera_ = image_transport::CameraSubscriber();
} else if (!sub_camera_) {
// Create subscriber with QoS matched to subscribed topic publisher
auto qos_profile = getQosProfile(this, image_topic_);
Expand Down
10 changes: 8 additions & 2 deletions image_rotate/src/image_flip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,17 @@ void ImageFlipNode::onInit()
if (img_pub_ && img_pub_.getNumSubscribers() == 0) {
RCLCPP_DEBUG(get_logger(), "Unsubscribing from image topic.");
img_sub_.shutdown();
cam_sub_.shutdown();
// Reset the subscriber instead of calling shutdown(): shutdown() leaves the
// synchronization check timer of the CameraSubscriber running, which crashes
// when it fires after the subscriptions are destroyed.
cam_sub_ = image_transport::CameraSubscriber();
} else if (cam_pub_ && cam_pub_.getNumSubscribers() == 0) {
RCLCPP_DEBUG(get_logger(), "Unsubscribing from image topic.");
img_sub_.shutdown();
cam_sub_.shutdown();
// Reset the subscriber instead of calling shutdown(): shutdown() leaves the
// synchronization check timer of the CameraSubscriber running, which crashes
// when it fires after the subscriptions are destroyed.
cam_sub_ = image_transport::CameraSubscriber();
} else {
// For compressed topics to remap appropriately, we need to pass a
// fully expanded and remapped topic name to image_transport
Expand Down
5 changes: 4 additions & 1 deletion image_rotate/src/image_rotate_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ void ImageRotateNode::onInit()
if (img_pub_.getNumSubscribers() == 0) {
RCLCPP_DEBUG(get_logger(), "Unsubscribing from image topic.");
img_sub_.shutdown();
cam_sub_.shutdown();
// Reset the subscriber instead of calling shutdown(): shutdown() leaves the
// synchronization check timer of the CameraSubscriber running, which crashes
// when it fires after the subscriptions are destroyed.
cam_sub_ = image_transport::CameraSubscriber();
} else {
// For compressed topics to remap appropriately, we need to pass a
// fully expanded and remapped topic name to image_transport
Expand Down