Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "ros/ros.h"
00031 #include <sensor_msgs/LaserScan.h>
00032 #include <geometry_msgs/PoseArray.h>
00033 #include <visualization_msgs/Marker.h>
00034 #include <sstream>
00035
00036 #include <dynamic_reconfigure/server.h>
00037 #include <v4r_laser_filter/CornerFilterConfig.h>
00038 #include <v4r_laser_filter/v4r_laser_filter_utils.h>
00039
00040 #ifndef V4R_LASER_CORNER_FILTER_NODE
00041 #define V4R_LASER_CORNER_FILTER_NODE
00042
00043
00045 class LaserCornerFilterNode {
00046 public:
00047 struct Parameters {
00048 Parameters()
00049 : publish_marker(true)
00050 , min_line_length(0.1)
00051 , min_points_on_line(10)
00052 , normal_angle_threshold(0.1)
00053 , max_corner_line_differnce(1.2)
00054 , max_line_error(0.5)
00055 , max_corner_error(0.5)
00056 , redefine_corners(true)
00057 , remove_double_detections(true)
00058 , remove_double_detections_threshold(0.1)
00059 , write_scan(false)
00060 , read_scan(false)
00061 , scan_filename("/tmp/scan.bin")
00062 {};
00063 bool publish_marker;
00064 float min_line_length;
00065 int min_points_on_line;
00066 float normal_angle_threshold;
00067 float max_corner_line_differnce;
00068 float max_line_error;
00069 float max_corner_error;
00070 bool redefine_corners;
00071 bool remove_double_detections;
00072 float remove_double_detections_threshold;
00073 bool write_scan;
00074 bool read_scan;
00075 std::string scan_filename;
00076 };
00077 LaserCornerFilterNode ( ros::NodeHandle &n );
00078 void callback (const sensor_msgs::LaserScan::ConstPtr& msg);
00079 void callbackParameters ( v4r_laser_filter::CornerFilterConfig &config, uint32_t level );
00080 private:
00081 void init_marker_visualization();
00082 void publish_marker_visualization();
00083 void publish_marker_posearray();
00084 private:
00085 ros::NodeHandle n_;
00086 ros::NodeHandle n_param_;
00087 Parameters param_;
00088 ros::Subscriber sub_;
00089 ros::Publisher pub_marker_visualization_;
00090 ros::Publisher pub_marker_posearray_;
00091 unsigned callbackCount;
00092 visualization_msgs::Marker msg_corner_pose_;
00093 visualization_msgs::Marker msg_corner_pose_estimation_;
00094 visualization_msgs::Marker msg_corner_l0_;
00095 visualization_msgs::Marker msg_corner_l0_estimation_;
00096 visualization_msgs::Marker msg_corner_l1_;
00097 visualization_msgs::Marker msg_corner_l1_estimation_;
00098 visualization_msgs::Marker msg_corner_text_;
00099 geometry_msgs::PoseArray msg_marker_posearray_;
00100 dynamic_reconfigure::Server<v4r_laser_filter::CornerFilterConfig> reconfigureServer_;
00101 dynamic_reconfigure::Server<v4r_laser_filter::CornerFilterConfig>::CallbackType reconfigureFnc_;
00102 sensor_msgs::LaserScan msg_scan_;
00103 std::vector<LaserFilter::Measurment> measurments_;
00104 std::vector<LaserFilter::Beam> beams_;
00105 std::vector<LaserFilter::LineSegment> lines_;
00106 std::vector<LaserFilter::Corner> corners_;
00107
00108 };
00109
00110 #endif // V4R_LASER_CORNER_FILTER_NODE