URL_1

14:00 ~ 18:30

Task #1

LiDAR-based SLAM에서 누적되는 오차를 보정해야함. Loop-closure 방식은 드론의 급격한 기동이 발생하여 안정성이 떨어져 사용 X

Iterative Closest Point나 Normal Distribution Transform을 사용하여 error를 transform하여 기체가 기존 reference trajectory로 가도록 하고자 함.

planning은 global planning으로 진행되며, SLAM을 통해 static map이 있고 dynamic obstacle이 크게 없는 환경이므로 별도의 local planning은 X

  1. 환경 구축 iris + Livox Mid-360 모델을 가지고 환경 구성
  2. pointcloud publish gazebo Ground Truth를 가지고 pointcloud를 보정하여 누적시키고 이를 voxelization하여 publish
    • 추후 Fast-LIO + Adaptive 방식을 사용한 Ada-LIO로 맵(ikd-tree)을 생성할 예정
  3. quadrotor control Dual Shock4로 joystick control

Troubleshooting livox laser simultation에서 mid-360 모델을 가져오려고 하는데, .xacro 형식으로 되어 있음.

우선 빌드에서 생긴 이슈

  1. ignition/math4 ignition/math6
fatal error: ignition/math4/ignition/math.hh: No such file or directory
   15 | #include <ignition/math4/ignition/math.hh>
 

Noetic, gazebo(=11.13.0) 이고 ignition/math6를 사용한다. 자세한 건 다음 링크 따라서 livox_laser_simulation/include/livox_laser_simulation/livox_ode_multiray_shape.h livox_laser_simulation/src/livox_ode_multiray_shape.cpp에 있는 math4를 math6로 수정한다.

  1. C++11 C++17
# Before
## Compile as C++11, supported in ROS Kinetic and newer|
add_compile_options(-std=c++11)
 
# After
## Compile as C++17, supported in ROS Kinetic and newer|
add_compile_options(-std=c++17)

참고링크

mid 360 CAD 파일 mid-360 3D CAD model 이를 .dae 파일로 변환하여 gazebo mesh로 활용함.

xacro를 sdf로 변환하기

rosrun xacro xacro livox_mid360.xacro > livox_mid360.urdf
gz sdf -p livox_mid360.urdf > livox_mid360.sdf

문제는 바꿔준 sdf 파일이 데이터베이스에서 불러지지 않아 계속 에러가 남. 우선 mesh파일이 다른 패키지로 되어 있어서 이를 수정해줌(models/meshes 안에 넣어줌)

Launch file 이후에는 센서 위치 조정과 tf publisher를 추가해주었다. 문제는 livox_base 프레임이름이 iris::livox_mid360::livox_base 와 같이 나온다. 이는 소스코드를 건드려야 할 것 같다.

CMakeLists 그리고 PointCloud2 형식으로 토픽을 publish하기 위해 코드를 수정하고 pcl을 포함하도록 CMakeLists.txt를 수정함

cmake_minimum_required(VERSION 2.8.3)
project(livox_laser_simulation)
 
## Compile as C++17, supported in ROS Kinetic and newer
add_compile_options(-std=c++17)
 
find_package(catkin REQUIRED COMPONENTS
	roscpp
	tf
)
 
find_package(gazebo REQUIRED)
include_directories(${GAZEBO_INCLUDE_DIRS})
 
#To solve the error which gazebo does not handle the include file well, we must add this line.
 
include_directories(/usr/include/gazebo-7/gazebo)
link_directories(${GAZEBO_LIBRARY_DIRS})
 
#This is designed for whose proto installed in system is not 2.6. We can install the version of proto in local dir
 
#include_directories(/home/lfc/proto/include/)
 
#link_directories(/home/lfc/proto/lib/)
 
find_package(PCL REQUIRED)
include_directories(
	include
	${catkin_INCLUDE_DIRS}
	include ${PCL_INCLUDE_DIRS}
)
 
catkin_package(
	INCLUDE_DIRS include
	LIBRARIES livox_laser_simulation
	CATKIN_DEPENDS tf
)
 
add_library(livox_laser_simulation SHARED src/livox_points_plugin.cpp src/livox_ode_multiray_shape.cpp)
 
target_link_libraries(livox_laser_simulation ${catkin_LIBRARIES} RayPlugin)
 
  
target_link_libraries(livox_laser_simulation libprotobuf.so.9)

Done

livox_mid360.sdf을 직접 iris.sdf에 붙여서 사용하고 이를 posix_sitl.launch에 넣을 때는 PointCloud2가 2차원적으로만 나오게 됌.

그러나 livox_laser_simulation에서 mid360만 구동할 때는 3차원으로 잘 나옴.

해결 주변에 물체가 없어 바닥 부분만 intensity가 잡히는 거였고, 3차원 물체가 인식되면 잘 나타남.