MCPcopy Create free account
hub / github.com/LimHyungTae/patchwork / callbackNode

Function callbackNode

nodes/pub_for_legoloam.cpp:43–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void callbackNode(const sensor_msgs::PointCloud2::ConstPtr &msg) {
44 cout << msg->header.seq << "th node come" << endl;
45 pcl::PointCloud<PointType> pc_curr = cloudmsg2cloud<PointType>(msg);
46 pcl::PointCloud<PointType> pc_ground;
47 pcl::PointCloud<PointType> pc_non_ground;
48 pc_ground.header = pc_curr.header;
49 pc_non_ground.header = pc_curr.header;
50
51 static double time_taken;
52
53 cout << "Operating patchwork..." << endl;
54 PatchworkGroundSeg->estimate_ground(pc_curr, pc_ground, pc_non_ground, time_taken);
55
56 auto msg_curr = cloud2msg(pc_curr);
57 auto msg_ground = cloud2msg(pc_ground);
58
59 patchwork::ground_estimate cloud_estimate;
60 cloud_estimate.header = msg->header;
61 cloud_estimate.curr = msg_curr;
62 cloud_estimate.ground = msg_ground;
63 EstimatePublisher.publish(cloud_estimate);
64
65 /*
66 CloudPublisher.publish(cloud2msg(pc_curr));
67 PositivePublisher.publish(cloud2msg(pc_ground));
68 NegativePublisher.publish(cloud2msg(pc_non_ground));
69 */
70}
71
72int main(int argc, char **argv) {
73 ros::init(argc, argv, "Benchmark");

Callers

nothing calls this directly

Calls 2

estimate_groundMethod · 0.80
cloud2msgFunction · 0.70

Tested by

no test coverage detected