SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
89 stars 81 forks source link

How to modify PicoScan range in the launch file? #317

Closed sjeffreydong closed 2 months ago

sjeffreydong commented 2 months ago

Dear Teams,

How to modify PicoScan range in the launch file? I didn't find it image

rostest commented 2 months ago

Thanks for your feedback. Min. range values can be set for each PointCloud by the rangeFilter in the launchfile sick_picoscan.launch:

        <!-- Configuration of customized pointclouds:
        ...
        Optional parameter "rangeFilter" configures how invalid measurements are filtered in the customized pointcloud.
            rangeFilter=<range_min>,<range_max>,<filter_flag>
        The range (distance) of invalid scan points is 0 and can be filtered, i.e. removed from the pointcloud or set to 0, FLT_MAX or NAN.
        If the range (distance) of a scan point is less than <range_min> or greater than <range_max>, this point is filtered depending on <filter_flag>:
            <filter_flag> = 0: RANGE_FILTER_DEACTIVATED,  do not apply range filter (default)
            <filter_flag> = 1: RANGE_FILTER_DROP,         drop point, if range is not within [range_min, range_max]
            <filter_flag> = 2: RANGE_FILTER_TO_ZERO,      set range to 0, if range is not within [range_min, range_max]
            <filter_flag> = 3: RANGE_FILTER_TO_RANGE_MAX, set range to range_max, if range is not within [range_min, range_max]
            <filter_flag> = 4: RANGE_FILTER_TO_FLT_MAX,   set range to FLT_MAX, if range is not within [range_min, range_max]
            <filter_flag> = 5: RANGE_FILTER_TO_NAN        set range to NAN, if range is not within [range_min, range_max]
        Note: Using range_filter_handling 4 or 5 requires handling of FLT_MAX and NAN values in an application.
        The working range of a picoScan is specified by 0.05 m up to 120 m. Example to drop invalid measurements:
            rangeFilter=0.05,120,1
        -->
        <!-- example for cloud_unstructured_fullframe with range_min = 0.05 m, range_max = 999 m, filter_flag = 1 (RANGE_FILTER_DROP) -->
        <param name="cloud_unstructured_fullframe" rangeFilter=0.05,999,1 />

Note that the range filter is applied on PointCloud messages, not on LaserScan messages. Due to their definition, LaserScan messages must have the all range values of a scan. If required, you may drop scan points by their range when handling LaserScan messages in your application. Due to the definition of LaserScan messages, it is not possible to drop scan points with a range below a given threshold. Parameter "rangeFilter" is therefor only applied to PointCloud messages.

Value "range_min" of a LaserScan message should not be negative (like -0.001). Please update to the latest sick_scan_xd release, if not yet done.