15 #ifndef NAV2_COLLISION_MONITOR__POINTCLOUD_HPP_
16 #define NAV2_COLLISION_MONITOR__POINTCLOUD_HPP_
22 #include "sensor_msgs/msg/point_cloud2.hpp"
24 #include "nav2_collision_monitor/source.hpp"
26 namespace nav2_collision_monitor
48 const nav2_util::LifecycleNode::WeakPtr & node,
49 const std::string & source_name,
50 const std::shared_ptr<tf2_ros::Buffer> tf_buffer,
51 const std::string & base_frame_id,
52 const std::string & global_frame_id,
53 const tf2::Duration & transform_tolerance,
54 const rclcpp::Duration & source_timeout,
55 const bool base_shift_correction);
75 const rclcpp::Time & curr_time,
76 std::vector<Point> & data);
89 void dataCallback(sensor_msgs::msg::PointCloud2::ConstSharedPtr msg);
94 rclcpp::Subscription<sensor_msgs::msg::PointCloud2>::SharedPtr
data_sub_;
97 double min_height_, max_height_;
102 sensor_msgs::msg::PointCloud2::ConstSharedPtr
data_;
Implementation for pointcloud source.
void getParameters(std::string &source_topic)
Getting sensor-specific ROS-parameters.
sensor_msgs::msg::PointCloud2::ConstSharedPtr data_
Latest data obtained from pointcloud.
void configure()
Data source configuration routine. Obtains pointcloud related ROS-parameters and creates pointcloud s...
void dataCallback(sensor_msgs::msg::PointCloud2::ConstSharedPtr msg)
PointCloud data callback.
rclcpp::Subscription< sensor_msgs::msg::PointCloud2 >::SharedPtr data_sub_
PointCloud data subscriber.
PointCloud(const nav2_util::LifecycleNode::WeakPtr &node, const std::string &source_name, const std::shared_ptr< tf2_ros::Buffer > tf_buffer, const std::string &base_frame_id, const std::string &global_frame_id, const tf2::Duration &transform_tolerance, const rclcpp::Duration &source_timeout, const bool base_shift_correction)
PointCloud constructor.
~PointCloud()
PointCloud destructor.
bool getData(const rclcpp::Time &curr_time, std::vector< Point > &data)
Adds latest data from pointcloud source to the data array.