Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made it work in ros2 humbe #25

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5596829
changed some files for ros2
Mar 13, 2024
f728a21
done the baby step
Mar 13, 2024
1f5aae4
made it work but not completed yet for significant error for the pose
Mar 14, 2024
c595297
modified velodyne
Mar 14, 2024
7817241
moved InRadius function to pointcloud_preprocess to make it more effi…
Mar 14, 2024
0885d4b
checked it works with liosam dataset but may be able to be more precise@
Mar 15, 2024
ab41f3e
it is good to pull request now...?
Mar 15, 2024
c20a596
fixed a save_map_path
Mar 15, 2024
89b5a82
modified some
Mar 22, 2024
64b1342
disabled ahrs init and fixed a logical error
Mar 24, 2024
1522ee4
changed some param
Mar 25, 2024
b3bbfa2
omitted unncessesary parts
Mar 25, 2024
24db56f
udpated parms for local param
Mar 26, 2024
3449df6
modifed params
Mar 26, 2024
f312ea0
resolved conflicts
Mar 26, 2024
da2cab5
changed the topic name for path
Mar 27, 2024
aea5f0a
Merge branch 'humble' of https://github.com/Wataru-Oshima-Tokyo/ig_li…
Mar 27, 2024
4d40740
changed param
Mar 27, 2024
ce2840b
updated for hesai
Mar 27, 2024
01c5a44
changed param for livox
Mar 28, 2024
9a1cd1c
renamed topics and launch files
Apr 1, 2024
7c68bfd
modified params
Apr 1, 2024
bae5cf2
adjusted odom frame to others
Apr 2, 2024
9af73e8
resolved conflict
Apr 2, 2024
35f4146
miss
Apr 2, 2024
e8ff867
resolved conflit
Apr 2, 2024
740ff0b
adjusted topics to other node
Apr 3, 2024
a422e43
Merge branch 'humble' of https://github.com/Wataru-Oshima-Tokyo/ig_li…
Apr 3, 2024
449fcc0
modifed launch and config file for livox
Apr 3, 2024
5c6744d
made this work with hesai
Apr 3, 2024
f7a1201
added odom_to_map logic
Apr 28, 2024
f5d1d01
added lio/save_map
May 18, 2024
e1d98f0
aded ig_lio_mapping luanch file
May 18, 2024
c1c40e8
updatred rviz config
May 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 100 additions & 53 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,53 +1,72 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.5)
project(ig_lio)

set(CMAKE_CXX_STANDARD 17)
# Use C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
roslib
pcl_ros
livox_ros_driver
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
add_compile_options(-Wall -Wextra -Wpedantic -O3 -g)

# Find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_index_cpp REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(PCL 1.8 REQUIRED)
find_package(livox_ros_driver2 REQUIRED)
find_package(TBB REQUIRED)

# Optionally, handle any custom find_package modules like 'glog.cmake'
include(cmake/glog.cmake)

# sophus
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/sophus)

catkin_package(
# INCLUDE_DIRS include
# LIBRARIES gicp_lio
# CATKIN_DEPENDS roscpp rospy std_msgs
# DEPENDS system_lib
# Include directories
include_directories(
include
${EIGEN3_INCLUDE_DIR}
${PCL_INCLUDE_DIRS}
${TBB_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/thirdparty/sophus
)

include_directories(
include
set(dependencies
rclcpp
sensor_msgs
nav_msgs
geometry_msgs
tf2_ros
tf2
pcl_conversions
TBB
livox_ros_driver2
std_srvs
tf2_geometry_msgs
)

include_directories(SYSTEM
${catkin_INCLUDE_DIRS}
# Declare a C++ executable
add_executable(${PROJECT_NAME}_node
src/ig_lio_node.cpp
src/pointcloud_preprocess.cpp
src/lio.cpp
src/voxel_map.cpp
src/SymmetricEigenSolver.cpp
src/timer.cpp
src/faster_voxel_grid.cpp
)

add_executable(${PROJECT_NAME}_node
src/ig_lio_node
# Declare a C++ executable
add_executable(${PROJECT_NAME}_keyframe_node
src/keyframe.cpp
src/pointcloud_preprocess.cpp
src/lio.cpp
src/voxel_map.cpp
Expand All @@ -56,31 +75,59 @@ add_executable(${PROJECT_NAME}_node
src/faster_voxel_grid.cpp
)

# Declare a C++ executable
add_executable(${PROJECT_NAME}_map_node
src/map.cpp
)




# Specify libraries to link a library or executable target against
ament_target_dependencies(${PROJECT_NAME}_node
${dependencies}
)

# Specify libraries to link a library or executable target against
ament_target_dependencies(${PROJECT_NAME}_map_node
${dependencies}
)
# Specify libraries to link a library or executable target against
ament_target_dependencies(${PROJECT_NAME}_keyframe_node
${dependencies}
)

target_link_libraries(${PROJECT_NAME}_node
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${TBB_LIBRARIES}
glog
gflags
TBB::tbb
)

install(TARGETS ${PROJECT_NAME}_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
target_link_libraries(${PROJECT_NAME}_map_node
${PCL_LIBRARIES}
${TBB_LIBRARIES}
glog
gflags
)
target_link_libraries(${PROJECT_NAME}_keyframe_node
${PCL_LIBRARIES}
${TBB_LIBRARIES}
glog
gflags
)

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE
# Install the executable
install(TARGETS ${PROJECT_NAME}_node ${PROJECT_NAME}_map_node ${PROJECT_NAME}_keyframe_node
DESTINATION lib/${PROJECT_NAME}
)

install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
PATTERN ".svn" EXCLUDE)
# Install various directory contents
install(DIRECTORY include/
DESTINATION include
)

install(DIRECTORY config/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
PATTERN ".svn" EXCLUDE)
install(DIRECTORY launch config rviz
DESTINATION share/${PROJECT_NAME}
)

install(DIRECTORY rviz/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/rviz
PATTERN ".svn" EXCLUDE)
ament_package()
36 changes: 0 additions & 36 deletions config/bg_velodyne.yaml

This file was deleted.

38 changes: 38 additions & 0 deletions config/bg_velodyne.yaml.BK
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**:
ros__parameters:
lidar_topic: /points_raw
imu_topic: /imu/data
lidar_type: velodyne # livox velodyne ouster
min_radius: 1.0
max_radius: 150.0
point_filter_num: 6
time_scale: 1000.0 # nclt: 0.001 other: 1000.0
enable_ahrs_initalization: false
enable_acc_correct: false

scan_resolution: 0.5
voxel_map_resolution: 0.5
max_iterations: 10

acc_cov: 0.01
gyr_cov: 0.0001
ba_cov: 0.000001
bg_cov: 0.000001

gicp_constraints_gain: 100.0
point2plane_constraints_gain: 1000.0
enable_undistort: true
enable_outlier_rejection: true

gravity: 9.80665
init_ori_cov: 0.0001
inti_pos_cov: 0.0001
init_vel_cov: 100.0
init_ba_cov: 0.0001
init_bg_cov: 0.0001

# botanic graden
t_imu_lidar : [0.0584867781527745, 0.00840419966766332,0.168915521980526]
R_imu_lidar: [0.999678872580465, 0.0252865664429322, 0.00150422292234868,
-0.0252723438960774, 0.999649431893338, -0.0078025434141585,
-0.00170103929405540, 0.00776298237926191, 0.99996789371916]
65 changes: 65 additions & 0 deletions config/diffbot_velodyne.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**:
ros__parameters:
#for odom
odom/sendTF: false
#topic names
odom/lidar_topic: /points_raw
odom/imu_topic: /imu/data #/imu_correct
odom/lidar_type: velodyne # livox velodyne ouster

#frames
odom/odom_frame: lio_odom
odom/robot_frame: base_link
odom/imu_frame: imu_link
odom/lidar_frame: velodyne
odom/min_radius: 0.1
odom/max_radius: 150.0
odom/point_filter_num: 6
odom/time_scale: 1.0 # nclt: 0.001 other: 1000.0
odom/enable_ahrs_initalization: false
odom/enable_acc_correct: false

odom/scan_resolution: 0.2
odom/voxel_map_resolution: 0.5
odom/max_iterations: 10

odom/acc_cov: 0.1
odom/gyr_cov: 0.1
odom/ba_cov: 0.000001
odom/bg_cov: 0.000001
odom/init_ori_cov: 0.0001
odom/init_pos_cov: 0.0001
odom/init_vel_cov: 100.0
odom/init_ba_cov: 0.0001
odom/init_bg_cov: 0.0001
odom/gravity: 9.80665

odom/gicp_constraints_gain: 100.0
odom/point2plane_constraints_gain: 1000.0
odom/enable_undistort: true
odom/enable_outlier_rejection: true




#for extrinsics
extrinsics/imu2lidar/t: [0.0, 0.0, 0.0]
extrinsics/imu2lidar/r: [1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0 ]

extrinsics/robot2lidar/t: [0.0, 0.0, 0.0]
extrinsics/robot2lidar/r: [1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0 ]

extrinsics/robot2imu/t: [0.0, 0.0, 0.0]
extrinsics/robot2imu/r: [1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0 ]

#for map
# map/save_map_path: /home/agilex/humble_ws #do not put / at the end of line
# map/map_name: jfe
map/map_frame: map

62 changes: 62 additions & 0 deletions config/hesai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**:
ros__parameters:
#for odom
odom/debug: false
#topic names
odom/lidar_topic: /points_raw
odom/imu_topic: /imu/data #/imu_correct
odom/lidar_type: hesai # livox velodyne ouster hesai

#frames
odom/odom_frame: lio_odom
odom/robot_frame: base_link
odom/imu_frame: imu_link
odom/lidar_frame: hesai_lidar
odom/min_radius: 0.1
odom/max_radius: 150.0
odom/point_filter_num: 6
odom/time_scale: 1.0 # nclt: 0.001 other: 1000.0
odom/enable_ahrs_initalization: false
odom/enable_acc_correct: false

odom/scan_resolution: 0.2
odom/voxel_map_resolution: 0.5
odom/max_iterations: 10

odom/acc_cov: 0.1
odom/gyr_cov: 0.1
odom/ba_cov: 0.000001
odom/bg_cov: 0.000001
odom/init_ori_cov: 0.0001
odom/init_pos_cov: 0.0001
odom/init_vel_cov: 100.0
odom/init_ba_cov: 0.0001
odom/init_bg_cov: 0.0001
odom/gravity: 9.80665

odom/gicp_constraints_gain: 100.0
odom/point2plane_constraints_gain: 1000.0
odom/enable_undistort: true
odom/enable_outlier_rejection: true


#for extrinsics
extrinsics/imu2lidar/t: [ 0.1634, 0., 0.116 ]
extrinsics/imu2lidar/r: [ 0., -1., 0.,
1., 0., 0.,
0., 0., 1. ]

extrinsics/robot2lidar/t: [0.0, 0.0, 0.0]
extrinsics/robot2lidar/r: [1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0 ]

extrinsics/robot2imu/t: [0.0, 0.0, 0.0]
extrinsics/robot2imu/r: [1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0 ]

#for map
# map/save_map_path: /home/agilex/humble_ws #do not put / at the end of line
# map/map_name: jfe
map/map_frame: lio_odom
Loading