Cant subscribe to PoinCloud2 [closed]

asked 2021-01-12 04:11:23 -0600

Schloern93 gravatar image

updated 2021-01-12 04:18:34 -0600

Hallo, Can someone explain me the difference of the two publishers?


pub_point_cloud_ = create_publisher<PointCloud2>("points", rclcpp::SensorDataQoS());


pub_point_cloud_ = create_publisher<PointCloud2>("points", 1);

In the case of the first publisher, I can't subscribe to the PointCloud message as follows which I don't understand. Moreover, I cannot display the points of the message in rviz2.

d435_test_2 = this->create_subscription<sensor_msgs::msg::PointCloud2>(
            "/points", 1, std::bind(&ObjectDetectionNode::test_2_callback, this, std::placeholders::_1));

void test_2_callback(const sensor_msgs::msg::PointCloud2::SharedPtr msgs)
      std::cout << "start_//color/image_raw-------" << "\n";    

When I use publisher 2 I can do everything normally.

Please give me a short explanation. An example of how to make a subscriber for the first publisher would also be nice

Thanks for the help

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Schloern93
close date 2021-01-14 05:06:13.720569