Skip to content

Commit 3ed8b01

Browse files
committed
add dcsam
1 parent b0298c0 commit 3ed8b01

File tree

4 files changed

+197
-359
lines changed

4 files changed

+197
-359
lines changed

LeGO-LOAM/CMakeLists.txt

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
cmake_minimum_required(VERSION 2.8.3)
22
project(lego_loam)
33

4-
set(CMAKE_CXX_STANDARD 14)
5-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -O3")
4+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3")
65

76
find_package(catkin REQUIRED COMPONENTS
87
tf
@@ -21,12 +20,17 @@ find_package(catkin REQUIRED COMPONENTS
2120
cloud_msgs
2221
)
2322

24-
find_package(OpenMP REQUIRED)
23+
find_package(GTSAM REQUIRED QUIET)
2524
find_package(PCL REQUIRED QUIET)
2625
find_package(OpenCV REQUIRED QUIET)
27-
find_package(GTSAM REQUIRED QUIET)
28-
find_package(Eigen3 REQUIRED)
29-
find_package(libnabo REQUIRED)
26+
27+
#add DCSAM
28+
#set your own path to dcsam
29+
set(DCSAM_PATH "/home/yewei/dcsam/dcsam")
30+
31+
include_directories(${DCSAM_PATH}/include)
32+
add_library(DCSAM STATIC IMPORTED)
33+
set_property(TARGET DCSAM PROPERTY IMPORTED_LOCATION ${DCSAM_PATH}/build/libdcsam.a)
3034

3135
catkin_package(
3236
INCLUDE_DIRS include
@@ -40,8 +44,6 @@ include_directories(
4044
${PCL_INCLUDE_DIRS}
4145
${OpenCV_INCLUDE_DIRS}
4246
${GTSAM_INCLUDE_DIR}
43-
/home/yewei/catkin_ws/src/LIO-SAM-3/src/DiSCo-SLAM/third_parties
44-
4547
)
4648

4749
link_directories(
@@ -60,12 +62,7 @@ add_dependencies(featureAssociation ${catkin_EXPORTED_TARGETS} cloud_msgs_gencpp
6062
target_link_libraries(featureAssociation ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES})
6163

6264
add_executable(mapOptmization src/mapOptmization.cpp)
63-
target_link_libraries(mapOptmization ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} gtsam)
65+
target_link_libraries(mapOptmization ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} gtsam DCSAM)
6466

6567
add_executable(transformFusion src/transformFusion.cpp)
66-
target_link_libraries(transformFusion ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES})
67-
68-
# Map Fushion
69-
add_executable(${PROJECT_NAME}_mapFusion src/Fusion/mapFusion.cpp src/Fusion/writeMHg2o.cpp)
70-
add_dependencies(${PROJECT_NAME}_mapFusion ${catkin_EXPORTED_TARGETS} lio_sam_generate_messages_cpp)
71-
target_link_libraries(${PROJECT_NAME}_mapFusion ${catkin_LIBRARIES} ${PCL_LIBRARIES} libnabo::nabo gtsam fast_max-clique_finder scan_context)
68+
target_link_libraries(transformFusion ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES})

LeGO-LOAM/include/utility.h

+13-25
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,22 @@ using namespace std;
5050

5151
typedef pcl::PointXYZI PointType;
5252

53-
extern const string pointCloudTopic = "velodyne_points";
54-
// extern const string imuTopic = "imu/data";
55-
56-
// extern const string pointCloudTopic = "points_raw";
57-
extern const string imuTopic = "imu/correct";
53+
extern const string pointCloudTopic = "/velodyne_points";
54+
extern const string imuTopic = "/imu/data";
5855

5956
// Save pcd
6057
extern const string fileDirectory = "/tmp/";
6158

6259
// Using velodyne cloud "ring" channel for image projection (other lidar may have different name for this channel, change "PointXYZIR" below)
6360
extern const bool useCloudRing = true; // if true, ang_res_y and ang_bottom are not used
6461

65-
66-
// VLP-64
67-
// extern const int N_SCAN = 64;
68-
// extern const int Horizon_SCAN = 1800;
69-
// extern const float ang_res_x = 0.2;
70-
// extern const float ang_res_y = 0.427;
71-
// extern const float ang_bottom = 24.9;
72-
// extern const int groundScanInd = 50;
73-
7462
// VLP-16
75-
extern const int N_SCAN = 16;
76-
extern const int Horizon_SCAN = 1800;
77-
extern const float ang_res_x = 0.2;
78-
extern const float ang_res_y = 2.0;
79-
extern const float ang_bottom = 15.0+0.1;
80-
extern const int groundScanInd = 7;
63+
extern const int N_SCAN = 16;
64+
extern const int Horizon_SCAN = 1800;
65+
extern const float ang_res_x = 0.2;
66+
extern const float ang_res_y = 2.0;
67+
extern const float ang_bottom = 15.0+0.1;
68+
extern const int groundScanInd = 7;
8169

8270
// HDL-32E
8371
// extern const int N_SCAN = 32;
@@ -138,14 +126,14 @@ extern const float nearestFeatureSearchSqDist = 25;
138126

139127

140128
// Mapping Params
141-
extern const float surroundingKeyframeSearchRadius = 250.0; // key frame that is within n meters from current pose will be considerd for scan-to-map optimization (when loop closure disabled)
129+
extern const float surroundingKeyframeSearchRadius = 50.0; // key frame that is within n meters from current pose will be considerd for scan-to-map optimization (when loop closure disabled)
142130
extern const int surroundingKeyframeSearchNum = 50; // submap size (when loop closure enabled)
143131
// history key frames (history submap for loop closure)
144-
extern const float historyKeyframeSearchRadius = 30.0; // key frame that is within n meters from current pose will be considerd for loop closure
145-
extern const int historyKeyframeSearchNum = 30; // 2n+1 number of hostory key frames will be fused into a submap for loop closure
146-
extern const float historyKeyframeFitnessScore = 1.5; // the smaller the better alignment
132+
extern const float historyKeyframeSearchRadius = 7.0; // key frame that is within n meters from current pose will be considerd for loop closure
133+
extern const int historyKeyframeSearchNum = 25; // 2n+1 number of hostory key frames will be fused into a submap for loop closure
134+
extern const float historyKeyframeFitnessScore = 0.3; // the smaller the better alignment
147135

148-
extern const float globalMapVisualizationSearchRadius = 500.0; // key frames with in n meters will be visualized
136+
extern const float globalMapVisualizationSearchRadius = 100.0; // key frames with in n meters will be visualized
149137

150138

151139
struct smoothness_t{

LeGO-LOAM/launch/run.launch

+9-43
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,20 @@
11
<launch>
2-
3-
<arg name="project" default="lego_loam"/>
4-
<arg name="robot0" default="jackal0"/>
5-
<arg name="robot1" default="jackal1"/>
6-
<arg name="robot2" default="jackal2"/>
72

83
<!--- Sim Time -->
94
<param name="/use_sim_time" value="true" />
105

11-
<!-- Parameters -->
12-
<rosparam file="$(find lego_loam)/src/Fusion/config/mapfusion.yaml" command="load" />
13-
146
<!--- Run Rviz-->
157
<node pkg="rviz" type="rviz" name="rviz" args="-d $(find lego_loam)/launch/test.rviz" />
168

179
<!--- TF -->
18-
<node pkg="tf" type="static_transform_publisher" name="odom_to_map" args="0 0 0 0 0 0 /map $(arg robot0)/odom 10" />
19-
<!-- <node pkg="tf" type="static_transform_publisher" name="odom_to_map2" args="0 0 0 0 0 0 /map $(arg robot1)/odom 10" /> -->
20-
21-
<!--- LOAM robot 0 -->
22-
<include file="$(find lego_loam)/launch/run_loam.launch" >
23-
<arg name="robot" value="$(arg robot0)"/>
24-
</include>
25-
26-
<!-- -LOAM robot 1 -->
27-
<!-- <include file="$(find lego_loam)/launch/run_loam.launch" > -->
28-
<!-- <arg name="robot" value="$(arg robot1)"/> -->
29-
<!-- </include> -->
30-
31-
<!-- -LOAM robot 2 -->
32-
<!-- <include file="$(find lego_loam)/launch/run_loam.launch" > -->
33-
<!-- <arg name="robot" value="$(arg robot2)"/> -->
34-
<!-- </include> -->
35-
36-
37-
<!-- <node pkg="rosbag" type="play" name="player" args="/media/yewei/extra/Yewei/data/KITTI/multi_Kitti/kitti00_3v2.bag -r 0.05 clock"/> -->
38-
<!-- <node pkg="rosbag" type="play" name="player" args="/media/yewei/extra/Yewei/data/stevens/multi.bag clock"/> -->
39-
40-
<!-- <node pkg="rosbag" type="record" name="recordtimestamp" output="screen" args="/jackal0/lio_sam/mapping/cloud_info
41-
/jackal1/lio_sam/mapping/cloud_info /jackal2/lio_sam/mapping/cloud_info /tf
42-
/jackal0/lio_sam/mapping/map_global /jackal0/lio_sam/mapping/path
43-
/jackal1/lio_sam/mapping/map_global /jackal1/lio_sam/mapping/path
44-
/jackal2/lio_sam/mapping/map_global /jackal2/lio_sam/mapping/path
45-
/jackal0/key_pose_origin /jackal0/laser_cloud_surround
46-
/jackal1/key_pose_origin /jackal1/laser_cloud_surround
47-
/jackal2/key_pose_origin /jackal2/laser_cloud_surround"/> -->
48-
49-
50-
51-
52-
10+
<node pkg="tf" type="static_transform_publisher" name="camera_init_to_map" args="0 0 0 1.570795 0 1.570795 /map /camera_init 10" />
11+
<node pkg="tf" type="static_transform_publisher" name="base_link_to_camera" args="0 0 0 -1.570795 -1.570795 0 /camera /base_link 10" />
12+
13+
<!--- LeGO-LOAM -->
14+
<node pkg="lego_loam" type="imageProjection" name="imageProjection" output="screen"/>
15+
<node pkg="lego_loam" type="featureAssociation" name="featureAssociation" output="screen"/>
16+
<node pkg="lego_loam" type="mapOptmization" name="mapOptmization" output="screen" launch-prefix="gdb -ex run --args"/>
17+
<!-- <node pkg="lego_loam" type="mapOptmization" name="mapOptmization" output="screen"/>-->
18+
<node pkg="lego_loam" type="transformFusion" name="transformFusion" output="screen"/>
5319

5420
</launch>

0 commit comments

Comments
 (0)