wiki:WikiStart/OngoingWork/BaseTypesCleanup/MultiLaserScan

To represent scans done by a 3D laserscanner, like the Velodyne or a combination of a 2D laserscanner and a servo, a new base type should be created.

The current type (MultiLevelLaserScan) which is used with the Velodyne has the same issues like the LaserScan type and needs to be redone to become a base type.

Proposal: MultiLaserScan

The following type was created on basis of the discussion on the mailing list. The Typename is also open for discussion, please amend the list of possible typenames at the end of the page.

Without the 3 first variables (scan_times, scan_angles and samples_per_scan) this type would become a new LaserScan type. Which means one could also inherit from a new LaserScan type, add the new 3 variables and override the convertScanToPointCloud methods.

enum LASER_MEASUREMENT_STATE 
{
    VALID_MEASUREMENT  = 0,
    TOO_FAR            = 1,
    TOO_NEAR           = 2,
    MEASUREMENT_ERROR  = 3,
};

struct MultiLaserScan 
{
    typedef float scalar;
    
    /** The timestamp per-scan */
    std::vector<base::Time> scan_times;

    /** The angle per-scan */
    std::vector<base::Angle> scan_angles;
    
    /** Number of samples in a single scan */
    boost::uint32_t samples_per_scan;

    /** Start angle of a single scan */
    base::Angle start_angle;

    /** Angular resolution in a single scan */
    base::Angle angular_resolution;
    
    /** Minimal valid range returned by laserscanner */
    scalar min_range;
    
    /** Maximal valid range returned by laserscanner */
    scalar max_range;

    /** The distance samples. The data for scan n is in 
     * distances[samples_per_scan * n] .. distances[samples_per_scan * (n+1) - 1]
     */
    std::vector<scalar> distances;

    /** The remission samples. The data for scan n is in 
     * distances[samples_per_scan * n] .. distances[samples_per_scan * (n+1) - 1]
     */
    std::vector<scalar> remissions;
    
    LASER_MEASUREMENT_STATE getMeasurementState(unsigned int index) const;
    LASER_MEASUREMENT_STATE getMeasurementState(scalar distance) const;
        
    bool isMeasurementValid(unsigned int index) const;
    bool isMeasurementValid(scalar distance) const;
    
    template<typename T>
    void convertScanToPointCloud(std::vector<T> &point_cloud,
				const Eigen::Affine3d& transformation = Eigen::Affine3d::Identity(),
				bool skip_invalid_points = true) const;
    
    template<typename T>
    void convertScanToPointCloud(std::vector<T> &point_cloud,
				const Eigen::Affine3d& first_transformation,
				const Eigen::Affine3d& last_transformation,
				bool skip_invalid_measurements = true) const;
};

Possible Typenames:

  • SweepedLaserScan
  • MultiLaserScan
  • LaserScanArray
  • MultiLevelLaserScan
  • LaserScan2
  • LaserScans
  • Scan3D
  • DepthInformation
  • Depth3D
  • DepthMap
Last modified 5 years ago Last modified on 08/20/14 16:08:48