Skip to content

Logging Improvement: Provide information when IPC cannot be enabled  #2703

@SteveMacenski

Description

@SteveMacenski

Feature request

Feature description

Right now, if IPC cannot be enabled, you get a generic error reading

intraprocess communication is not allowed with a zero qos history depth value

It would be great if this provided us with some more information, such as the name of the interface that is throwing this, if its a publisher, subscriber, action, or service, etc. Honestly though, even just the topic name would do wonders, I'm currently searching through all interfaces in Costmap2D to find the offender and its quite the needle in the haystack

Implementation considerations

I was able to deduce that it is a publisher because of the slight variation in the error prints between publishers and subscriptions (but that seems accidental to have "zero" versus "0").

  • // Register the publisher with the intra process manager.
    if (qos.history() != rclcpp::HistoryPolicy::KeepLast) {
    throw std::invalid_argument(
    "intraprocess communication allowed only with keep last history qos policy");
    }
    if (qos.depth() == 0) {
    throw std::invalid_argument(
    "intraprocess communication is not allowed with a zero qos history depth value");
    }
    if (qos.durability() == rclcpp::DurabilityPolicy::TransientLocal) {
    buffer_ = rclcpp::experimental::create_intra_process_buffer<
    ROSMessageType, ROSMessageTypeAllocator, ROSMessageTypeDeleter>(
    rclcpp::detail::resolve_intra_process_buffer_type(options_.intra_process_buffer_type),
    qos,
    std::make_shared<ROSMessageTypeAllocator>(ros_message_type_allocator_));
    }
  • if (qos_profile.history() != rclcpp::HistoryPolicy::KeepLast) {
    throw std::invalid_argument(
    "intraprocess communication allowed only with keep last history qos policy");
    }
    if (qos_profile.depth() == 0) {
    throw std::invalid_argument(
    "intraprocess communication is not allowed with 0 depth qos policy");
    }

Can we improve this by having the logging include the topic string?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions