Skip to content

How to use agnocast to get zero copy #711

@allstarry

Description

@allstarry

I am trying to integrate Agnocast in my code. According to some document pieces, I finally got it working with seeing agnocast in dmesg, but there are 2 main issues.

  1. The listener subscription callback function cannot be triggered.
  2. The program crashed with exit code -11 after working for a while, and it won't crash after commenting out agnocast code, but the receiving one works fine.
    After that, I used autoware_agnocast_wrapper and got the same.
    Here's some of my code with agnocast.

Talker

AUTOWARE_PUBLISHER_PTR(custom_msgs::msg::Rgb3) multi_rgb_pub_agn;
AUTOWARE_MESSAGE_UNIQUE_PTR(custom_msgs::msg::Rgb3) ipc_msg_ptr;
ipc_msg_ptr = ALLOCATE_OUTPUT_MESSAGE_UNIQUE(multi_rgb_pub_agn);
...
multi_rgb_pub_agn->publish(std::move(ipc_msg_ptr));

Listenner

AUTOWARE_SUBSCRIPTION_PTR(custom_msgs::msg::Rgb3) subscription;
agnocast::SubscriptionOptions sub_options{};
callback_group_ = create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive);
  sub_options.callback_group = callback_group_;
  subscription_ = AUTOWARE_CREATE_SUBSCRIPTION(
    custom_msgs::msg::Rgb3,
    "/multi_cam_rgb3",
    rclcpp::SensorDataQoS{}.keep_last(1),
    std::bind(&IpcTestNode::jpg_cb, this, std::placeholders::_1),
    sub_options);

void jpg_cb(AUTOWARE_MESSAGE_UNIQUE_PTR(custom_msgs::msg::Rgb3) msg)
{...}
Image

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