IT 개발/LiDAR-SLAM

LeGO-LOAM 코드 분석하기 (1)

KimDol2 2023. 8. 17. 14:34

 

 

LeGO-LOAM 의 설치 및 실행에 대해 이전 포스팅에서 살펴봤다. 이번에는 LeGO-LOAM 의 코드를 분석해 보자. 본격적인 분석에 앞서 LeGO-LOAM 을 실행했을 때  rqt_graph 에서 ROS 의 노드와 메세지가 어떻게 구성이 되는지 확인해 보자. 아래 그림은 LeGO-LOAM 의 rqt_graph 이다.

 

 

LeGO-LOAM 은 크게 네 개의 노드로 구성된다.

/imageProjection        ∨

/featureAssociation    ∨

/mapOptimization      ∨

/transformFusion

 

그 중에 위에 체크 표시한 3개의 노드를 먼저 살펴보자. 먼저 imageProjection 노드는 /velodyne_points 토픽명의 메세지를 수신한다. 수신한 라이다 데이터는 LeGO-LOAM 에서 제안한 방식대로 ground points 에 대해 segmentation 을 수행하고 다음 세 개의 메세지 토픽으로 /featureAssociation 노드에 전달하는데, 전달하는 메세지는 아래와 같다.

/segmented_cloud_info

/outlier_cloud

/segmented_cloud

 

/segmented_cloud_info 메세지는 LeGO-LOAM 에서 사전에 정의한 cloud_msgs 메세지로 cloud_info.msg 파일에 아래와 같이 정의되어 있다.

 

Header header 

int32[] startRingIndex
int32[] endRingIndex

float32 startOrientation
float32 endOrientation
float32 orientationDiff

bool[]    segmentedCloudGroundFlag # true - ground point, false - other points
uint32[]  segmentedCloudColInd # point column index in range image
float32[] segmentedCloudRange # point range

 

/imageProjection 노드에서 publish 하는 위의 세 가지 메세지는 /featureAssociation 노드에서 subscribe 하여 처리한다. /featureAssociation 노드는 LeGO-LOAM LOAM 에서 제안한 Surface points 와 Edge points 를 /imageProjection 에서 제공한 segmentation 정보를 이용해 ground 정보를 따로 뽑아서 처리한다. 

 

다음 포스팅에서는 /featureAssociation 노드에서 최적화에 사용할 feature 데이터를 어떻게 처리하는지 알아보자.

 

 

반응형