Merge pull request #426 from blacksoul000/ros2

Add tf pointers initialization
This commit is contained in:
matlabbe
2020-06-05 12:35:22 -04:00
committed by GitHub
+3
View File
@@ -75,6 +75,9 @@ ObstaclesDetection::ObstaclesDetection(const rclcpp::NodeOptions & options) :
grid_.parseParameters(gridParameters);
tfBuffer_ = std::make_shared< tf2_ros::Buffer >(this->get_clock());
tfListener_ = std::make_shared< tf2_ros::TransformListener >(*tfBuffer_);
cloudSub_ = create_subscription<sensor_msgs::msg::PointCloud2>("cloud", rclcpp::SensorDataQoS(), std::bind(&ObstaclesDetection::callback, this, std::placeholders::_1));
groundPub_ = create_publisher<sensor_msgs::msg::PointCloud2>("ground", 1);