diff --git a/src/nodelets/obstacles_detection.cpp b/src/nodelets/obstacles_detection.cpp index d0d5f01b..fbfbb3fc 100644 --- a/src/nodelets/obstacles_detection.cpp +++ b/src/nodelets/obstacles_detection.cpp @@ -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("cloud", rclcpp::SensorDataQoS(), std::bind(&ObstaclesDetection::callback, this, std::placeholders::_1)); groundPub_ = create_publisher("ground", 1);