Convert Figma logo to code with AI

HKUST-Aerial-Robotics logoA-LOAM

Advanced implementation of LOAM

2,089
791
2,089
46

Top Related Projects

A Robust and Versatile Monocular Visual-Inertial State Estimator

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.

LeGO-LOAM: Lightweight and Ground-Optimized Lidar Odometry and Mapping on Variable Terrain

3,328

LIO-SAM: Tightly-coupled Lidar Inertial Odometry via Smoothing and Mapping

An open source platform for visual-inertial navigation research.

Quick Overview

A-LOAM (Advanced LiDAR Odometry and Mapping) is an optimized version of LOAM (LiDAR Odometry and Mapping) for LiDAR SLAM. It improves upon the original LOAM algorithm by incorporating advanced optimization techniques and modern C++ features, resulting in enhanced performance and efficiency for real-time mapping and localization using LiDAR data.

Pros

  • Improved performance and efficiency compared to the original LOAM algorithm
  • Utilizes modern C++ features for better code organization and maintainability
  • Supports various LiDAR sensors, including Velodyne and Ouster
  • Provides real-time mapping and localization capabilities

Cons

  • Limited documentation and examples for beginners
  • Requires expertise in LiDAR technology and SLAM algorithms
  • May require fine-tuning for optimal performance with different LiDAR sensors
  • Dependency on ROS (Robot Operating System) may limit its use in non-ROS environments

Code Examples

  1. Subscribing to LiDAR point cloud data:
ros::Subscriber subLaserCloud = nh.subscribe<sensor_msgs::PointCloud2>("/velodyne_points", 100, laserCloudHandler);
  1. Extracting features from point cloud:
void extractFeatures(const pcl::PointCloud<PointType>::Ptr& pc_in, pcl::PointCloud<PointType>::Ptr& pc_out_edge, pcl::PointCloud<PointType>::Ptr& pc_out_surf)
{
    std::vector<int> indices;
    pcl::removeNaNFromPointCloud(*pc_in, *pc_in, indices);
    pcl::VoxelGrid<PointType> downSizeFilter;
    downSizeFilter.setLeafSize(0.2, 0.2, 0.2);
    downSizeFilter.setInputCloud(pc_in);
    downSizeFilter.filter(*pc_in);
    // ... (feature extraction logic)
}
  1. Performing scan registration:
void laserOdometry()
{
    if (!systemInited)
    {
        systemInited = true;
        std::cout << "Initialization finished \n";
    }
    else
    {
        int cornerPointsSharpNum = cornerPointsSharp->points.size();
        int surfPointsFlatNum = surfPointsFlat->points.size();

        TicToc t_opt;
        for (size_t opti_counter = 0; opti_counter < 2; ++opti_counter)
        {
            corner_correspondence = 0;
            plane_correspondence = 0;

            // ... (optimization logic)
        }
    }
}

Getting Started

  1. Clone the repository:
git clone https://github.com/HKUST-Aerial-Robotics/A-LOAM.git
  1. Build the project:
cd A-LOAM
mkdir build && cd build
cmake ..
make
  1. Run the A-LOAM node:
roslaunch aloam_velodyne aloam_velodyne_VLP_16.launch
  1. Play your ROS bag file:
rosbag play your_lidar_data.bag

Competitor Comparisons

A Robust and Versatile Monocular Visual-Inertial State Estimator

Pros of VINS-Mono

  • Utilizes both visual and inertial data for more robust state estimation
  • Supports loop closure for improved accuracy in long-term operation
  • Provides a more comprehensive solution for visual-inertial odometry and mapping

Cons of VINS-Mono

  • Higher computational complexity due to the fusion of multiple sensor inputs
  • Requires careful calibration of both camera and IMU for optimal performance
  • More sensitive to environmental conditions and sensor noise

Code Comparison

VINS-Mono (feature tracking):

void FeatureTracker::readImage(const cv::Mat &_img, double _cur_time)
{
    cv::Mat img;
    TicToc t_r;
    cur_time = _cur_time;

    if (EQUALIZE)
    {
        cv::Ptr<cv::CLAHE> clahe = cv::createCLAHE(3.0, cv::Size(8, 8));
        TicToc t_c;
        clahe->apply(_img, img);
        ROS_DEBUG("CLAHE costs: %fms", t_c.toc());
    }
    else
        img = _img;

A-LOAM (feature extraction):

void laserCloudHandler(const sensor_msgs::PointCloud2ConstPtr& laserCloudMsg)
{
    if (!systemInited)
    {
        systemInitCount++;
        if (systemInitCount >= systemDelay)
        {
            systemInited = true;
        }
        else
            return;
    }

    TicToc t_whole;
    TicToc t_prepare;

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.

Pros of Cartographer

  • Multi-sensor fusion: Supports various sensor types (LiDAR, IMU, odometry)
  • Real-time performance: Optimized for online SLAM in real-time applications
  • Large-scale mapping: Efficient for creating maps of large environments

Cons of Cartographer

  • Complexity: More complex setup and configuration compared to A-LOAM
  • Resource intensive: Requires more computational resources
  • Learning curve: Steeper learning curve for new users

Code Comparison

A-LOAM (scan matching):

void laserCloudCornerLastHandler(const sensor_msgs::PointCloud2ConstPtr& laserCloudCornerLast2)
{
    timeLaserCloudCornerLast = laserCloudCornerLast2->header.stamp.toSec();
    laserCloudCornerLast->clear();
    pcl::fromROSMsg(*laserCloudCornerLast2, *laserCloudCornerLast);
}

Cartographer (scan matching):

void HandleLaserScan(const sensor_msgs::LaserScan::ConstPtr& msg) {
  carto::sensor::PointCloudWithIntensities point_cloud;
  carto::common::Time time;
  std::tie(point_cloud, time) = ToPointCloudWithIntensities(*msg);
  HandleLaserScanProto(time, msg->frame_id, point_cloud);
}

Both repositories focus on SLAM, but Cartographer offers more flexibility and features at the cost of increased complexity, while A-LOAM provides a simpler, LiDAR-focused solution.

LeGO-LOAM: Lightweight and Ground-Optimized Lidar Odometry and Mapping on Variable Terrain

Pros of LeGO-LOAM

  • Improved performance in unstructured environments due to ground optimization
  • Better loop closure detection for enhanced mapping accuracy
  • More robust to sensor noise and dynamic objects

Cons of LeGO-LOAM

  • Higher computational complexity, potentially slower in real-time applications
  • More parameters to tune, which can be challenging for new users
  • May struggle in environments with limited features or sparse point clouds

Code Comparison

A-LOAM:

void laserCloudHandler(const sensor_msgs::PointCloud2ConstPtr &laserCloudMsg)
{
    mBuf.lock();
    cloudQueue.push(laserCloudMsg);
    mBuf.unlock();
}

LeGO-LOAM:

void laserCloudHandler(const sensor_msgs::PointCloud2ConstPtr &laserCloudMsg)
{
    cloudQueueMutex.lock();
    cloudQueue.push(laserCloudMsg);
    cloudQueueMutex.unlock();
    newLaserCloudReceived = true;
}

Both implementations use similar queue-based approaches for handling incoming point cloud messages. LeGO-LOAM adds a flag to indicate new data arrival, potentially improving responsiveness in the main processing loop.

3,328

LIO-SAM: Tightly-coupled Lidar Inertial Odometry via Smoothing and Mapping

Pros of LIO-SAM

  • Integrates LiDAR, IMU, and GPS data for more robust localization and mapping
  • Implements loop closure for improved accuracy in large-scale environments
  • Offers real-time performance with lower computational requirements

Cons of LIO-SAM

  • More complex setup and configuration due to multiple sensor inputs
  • Requires careful calibration of sensors for optimal performance
  • May struggle in environments with limited GPS coverage

Code Comparison

A-LOAM (scan matching):

void laserCloudCornerLastHandler(const sensor_msgs::PointCloud2ConstPtr& msg) {
    timeLaserCloudCornerLast = msg->header.stamp.toSec();
    laserCloudCornerLast->clear();
    pcl::fromROSMsg(*msg, *laserCloudCornerLast);
    newLaserCloudCornerLast = true;
}

LIO-SAM (IMU integration):

void imuHandler(const sensor_msgs::Imu::ConstPtr& imuMsg) {
    sensor_msgs::Imu thisImu = imuConverter(*imuMsg);
    imuQueOpt.push_back(thisImu);
    imuQueImu.push_back(thisImu);
    imuTime[imuPointerLast] = thisImu.header.stamp.toSec();
    imuPointerLast = (imuPointerLast + 1) % imuQueLength;
}

An open source platform for visual-inertial navigation research.

Pros of open_vins

  • More comprehensive visual-inertial odometry (VIO) system with multi-sensor fusion capabilities
  • Supports various sensor configurations, including monocular, stereo, and multi-camera setups
  • Actively maintained with regular updates and improvements

Cons of open_vins

  • Higher complexity and steeper learning curve compared to A-LOAM
  • Requires more computational resources due to its comprehensive nature

Code Comparison

A-LOAM (scanRegistration.cpp):

void laserCloudHandler(const sensor_msgs::PointCloud2ConstPtr &laserCloudMsg)
{
    if (!systemInited)
    {
        systemInitCount++;
        if (systemInitCount >= systemDelay)
        {
            systemInited = true;
        }
        return;
    }
    // ... (processing code)
}

open_vins (VioManager.cpp):

void VioManager::feed_measurement_imu(const ov_core::ImuData &message) {
    // Append it to our vector
    imu_data.emplace_back(message);

    // Loop through and delete old measurements
    auto it0 = imu_data.begin();
    while (it0 != imu_data.end() && it0->timestamp < state->_timestamp - params.calib_camimu_dt) {
        it0 = imu_data.erase(it0);
    }
}

The code snippets show different approaches to handling sensor data. A-LOAM focuses on LiDAR data processing, while open_vins demonstrates IMU data management within a more complex VIO system.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

A-LOAM

Advanced implementation of LOAM

A-LOAM is an Advanced implementation of LOAM (J. Zhang and S. Singh. LOAM: Lidar Odometry and Mapping in Real-time), which uses Eigen and Ceres Solver to simplify code structure. This code is modified from LOAM and LOAM_NOTED. This code is clean and simple without complicated mathematical derivation and redundant operations. It is a good learning material for SLAM beginners.

Modifier: Tong Qin, Shaozu Cao

1. Prerequisites

1.1 Ubuntu and ROS

Ubuntu 64-bit 16.04 or 18.04. ROS Kinetic or Melodic. ROS Installation

1.2. Ceres Solver

Follow Ceres Installation.

1.3. PCL

Follow PCL Installation.

2. Build A-LOAM

Clone the repository and catkin_make:

    cd ~/catkin_ws/src
    git clone https://github.com/HKUST-Aerial-Robotics/A-LOAM.git
    cd ../
    catkin_make
    source ~/catkin_ws/devel/setup.bash

3. Velodyne VLP-16 Example

Download NSH indoor outdoor to YOUR_DATASET_FOLDER.

    roslaunch aloam_velodyne aloam_velodyne_VLP_16.launch
    rosbag play YOUR_DATASET_FOLDER/nsh_indoor_outdoor.bag

4. KITTI Example (Velodyne HDL-64)

Download KITTI Odometry dataset to YOUR_DATASET_FOLDER and set the dataset_folder and sequence_number parameters in kitti_helper.launch file. Note you also convert KITTI dataset to bag file for easy use by setting proper parameters in kitti_helper.launch.

    roslaunch aloam_velodyne aloam_velodyne_HDL_64.launch
    roslaunch aloam_velodyne kitti_helper.launch

5. Docker Support

To further facilitate the building process, we add docker in our code. Docker environment is like a sandbox, thus makes our code environment-independent. To run with docker, first make sure ros and docker are installed on your machine. Then add your account to docker group by sudo usermod -aG docker $YOUR_USER_NAME. Relaunch the terminal or logout and re-login if you get Permission denied error, type:

cd ~/catkin_ws/src/A-LOAM/docker
make build

The build process may take a while depends on your machine. After that, run ./run.sh 16 or ./run.sh 64 to launch A-LOAM, then you should be able to see the result.

6.Acknowledgements

Thanks for LOAM(J. Zhang and S. Singh. LOAM: Lidar Odometry and Mapping in Real-time) and LOAM_NOTED.