add lines in README

main
feixyz10 2021-03-10 16:16:57 +08:00 committed by feixyz
parent 6f36f6170e
commit 53af1a97e9
9 changed files with 97 additions and 46 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(oh_my_loam) project(oh_my_loam)
set(CMAKE_CXX_FLAGS "-std=c++17 -Wall -lpthread") set(CMAKE_CXX_FLAGS "-std=c++17 -Wall")
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS_RELEASE "-O3") set(CMAKE_CXX_FLAGS_RELEASE "-O3")
@ -10,48 +10,15 @@ find_package(PCL QUIET)
find_package(g3log REQUIRED) find_package(g3log REQUIRED)
find_package(yaml-cpp REQUIRED) find_package(yaml-cpp REQUIRED)
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
nav_msgs
sensor_msgs
roscpp
rospy
rosbag
std_msgs
)
include_directories(SYSTEM include_directories(SYSTEM
${catkin_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS}
${G3LOG_INCLUDE_DIRS} ${G3LOG_INCLUDE_DIRS}
) )
catkin_package(
CATKIN_DEPENDS geometry_msgs nav_msgs roscpp rospy std_msgs
DEPENDS EIGEN3 PCL
INCLUDE_DIRS oh_my_loam common
)
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
) )
add_subdirectory(common) add_subdirectory(common)
add_subdirectory(oh_my_loam) add_subdirectory(oh_my_loam)
add_subdirectory(examples)
add_executable(main main.cc)
target_link_libraries(main
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${G3LOG_LIBRARIES}
${YAML_CPP_LIBRARIES}
common
oh_my_loam
extractor
odometer
mapper
solver
${CERES_LIBRARIES}
visualizer
base
)

View File

@ -1,18 +1,68 @@
# Oh-My-LOAM # Oh-My-LOAM
Oh-My-LOAM is a ROS-free implementation of LOAM (J. Zhang and S. Singh. LOAM: Lidar Odometry and Mapping in Real-time). This implementation is modified from [A-LOAM](https://github.com/HKUST-Aerial-Robotics/A-LOAM). Oh-My-LOAM is a ROS-free implementation of LOAM (J. Zhang and S. Singh. LOAM: Lidar Odometry and Mapping in Real-time).
This implementation is modified from [A-LOAM](https://github.com/HKUST-Aerial-Robotics/A-LOAM).
Comparing with A-LOAM, this implementation has following features: Comparing with A-LOAM, this implementation has following features:
- it's ROS-free - it's ROS-free
- it's more readable and easier to understand/modify - it's more readable and easier to understand/modify
<img src="images/nsh_indoor_outdoor.png" alt="" height="500" align="bottom" />
# How to run
## BUILD
Install dependences (lsted below).\
Clone this repository\
Compile:
```bash
mkdir build && cd build
cmake ..
make -j6
```
## Run with ROS bag as input
Although **Oh-My-LOAM** is ROS-free, running it with ROS bag as input is the simplest way.
We'll take *nsh_indoor_outdoor.bag* as example.
You can download this bag from [google drive](https://drive.google.com/file/d/1s05tBQOLNEDDurlg48KiUWxCp-YqYyGH/view) or [baidupan](https://pan.baidu.com/s/1TbfMQ3Rvmmn1hCjFhXSPcQ) (提取码:9nf7).
Launch:
```
./devel/lib/oh_my_loam/main_rosbag ../configs/config_nsh_indoor_outdoor.yaml
```
Play bag:
```
ros play nsh_indoor_outdoor.bag
```
## Run without ROS support
You can write by yourself.
# Dependences # Dependences
- Eigen: linear algebra, quaternion ### 1. C++17
- pcl: point cloud processing ### 2. Eigen: linear algebra, quaternion
- g3log: logging ```
- yaml-cpp: yaml parsing sudo apt install libeigen3-dev
- ceres: non-linear optimization ```
- c++17
### 3. pcl: point cloud processing
```
sudo apt install libpcl-dev
```
### 4. g3log: logging
Follow [g3log](https://github.com/KjellKod/g3log) to install.
### 5. yaml-cpp: yaml parsing
```
sudo apt install libyaml-cpp-dev
```
### 6. ceres: non-linear optimization
```
sudo apt install libceres-dev
```
### ROS (optional)

View File

@ -3,7 +3,6 @@ lidar: VLP16
log_to_file: false log_to_file: false
log_path: /data/log/oh_my_loam log_path: /data/log/oh_my_loam
vis: true vis: true
save_map: true
save_map_path: /data/log/oh_my_loam.pcd save_map_path: /data/log/oh_my_loam.pcd
# configs for extractor # configs for extractor

34
examples/CMakeLists.txt Normal file
View File

@ -0,0 +1,34 @@
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
nav_msgs
sensor_msgs
roscpp
rospy
rosbag
std_msgs
)
include_directories(SYSTEM
${catkin_INCLUDE_DIRS}
)
catkin_package(
CATKIN_DEPENDS roscpp rospy std_msgs
)
add_executable(main_rosbag main_rosbag.cc)
target_link_libraries(main_rosbag
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${G3LOG_LIBRARIES}
${YAML_CPP_LIBRARIES}
common
oh_my_loam
extractor
odometer
mapper
solver
${CERES_LIBRARIES}
visualizer
base
)

View File

@ -4,10 +4,10 @@
<version>0.0.0</version> <version>0.0.0</version>
<description> <description>
Reimplementation of LOAM. A ROS-free implementation of LOAM.
</description> </description>
<maintainer email="fei-china@139.com">qintong</maintainer> <maintainer email="fei-china@139.com">feixyz</maintainer>
<license>BSD</license> <license>BSD</license>

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

View File

@ -44,6 +44,7 @@ void OhmyloamVisualizer::KeyboardEventCallback(
} }
is_updated_ = true; is_updated_ = true;
} else if (event.getKeySym() == "s" && event.keyDown()) { } else if (event.getKeySym() == "s" && event.keyDown()) {
if (save_path_.empty()) return;
auto frame = GetCurrentFrame<OhmyloamVisFrame>(); auto frame = GetCurrentFrame<OhmyloamVisFrame>();
PointCloud cloud; PointCloud cloud;
cloud.reserve(frame.cloud_map_surf->size() + frame.cloud_map_surf->size()); cloud.reserve(frame.cloud_map_surf->size() + frame.cloud_map_surf->size());