Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
HuaYuXiao committed Dec 23, 2024
1 parent 208beb1 commit b6640fd
Show file tree
Hide file tree
Showing 42 changed files with 205 additions and 1,193 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea
build
cmake-build-*

.DS_Store
.idea
.vscode
21 changes: 5 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0.2)
project(easondrone_mapping)

set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "-std=c++14")
set(CMAKE_CXX_FLAGS "-std=c++17")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g")
set(PYTHON_EXECUTABLE "/usr/bin/python3.8")

Expand All @@ -19,8 +19,8 @@ find_package(catkin REQUIRED COMPONENTS
sensor_msgs
geometry_msgs
nav_msgs
visualization_msgs
easondrone_msgs
tf2_ros
tf2_sensor_msgs
)

catkin_package(
Expand All @@ -41,19 +41,8 @@ include_directories(
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_executable(uav_octomapping
src/octomap/octomapping_node.cpp
src/octomap/octomapping.cpp
src/octomap/occupy_map.cpp
)
target_link_libraries(uav_octomapping
${catkin_LIBRARIES}
${PCL_LIBRARIES}
${OCTOMAP_LIBRARIES}
)

add_executable(pcl_merge src/merge_pcl/pcl_merge.cpp)
target_link_libraries(pcl_merge
add_executable(merge_pcl src/merge_pcl/merge_pcl.cpp)
target_link_libraries(merge_pcl
${catkin_LIBRARIES}
${PCL_LIBRARIES}
)
Expand Down
20 changes: 7 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![HitCount](https://img.shields.io/endpoint?url=https%3A%2F%2Fhits.dwyl.com%2FHuaYuXiao%2FEasonDrone_Mapping.json%3Fcolor%3Dpink)
![Static Badge](https://img.shields.io/badge/ROS-melodic-22314E?logo=ros)
![Static Badge](https://img.shields.io/badge/C%2B%2B-14-00599C?logo=cplusplus)
![Static Badge](https://img.shields.io/badge/C%2B%2B-17-00599C?logo=cplusplus)
![Static Badge](https://img.shields.io/badge/Python-3.8.10-3776AB?logo=python)
![Static Badge](https://img.shields.io/badge/Ubuntu-18.04.6-E95420?logo=ubuntu)

Expand All @@ -11,8 +11,8 @@ A ROS package for mapping via octomap.
## Installation

```bash
cd ~/EasonDrone
catkin_make --source Reconstruction/easondrone_mapping --build Reconstruction/easondrone_mapping/build
git clone https://github.com/HuaYuXiao/easondrone_mapping.git ~/easondrone_ws/reconstruct/easondrone_mapping
cd ~/easondrone_ws && catkin_make install --source reconstruct/easondrone_mapping --build reconstruct/easondrone_mapping/build
```

## 转发点云
Expand All @@ -37,7 +37,7 @@ roslaunch easondrone_mapping simulation.launch
控制无人机完成建图后,用以下指令保存.ot(或者.bt,相较于.ot体积更小)格式的地图文件

```bash
rosrun octomap_server octomap_saver -f ~/EasonDrone/Reconstruction/EasonDrone_Mapping/map.ot
rosrun octomap_server octomap_saver -f ~/easondrone_ws/reconstruct/easondrone_mapping/map.ot
```

![image](doc/log/2024-03-11/%E6%97%A0%E6%A0%87%E9%A2%98.png)
Expand All @@ -55,16 +55,16 @@ rosrun octomap_server octomap_saver -f ~/EasonDrone/Reconstruction/EasonDrone_Ma
也可以借助`octovis`工具查看

```bash
octovis ~/EasonDrone/Reconstruction/EasonDrone_Mapping/map.bt
octovis ~/easondrone_ws/reconstruct/easondrone_mapping/map.bt
```

### 方法2:rviz

一种方法是在`rviz`中查看

```bash
rosrun rviz rviz
rosrun octomap_server octomap_server_node ~/EasonDrone/Reconstruction/EasonDrone_Mapping/map.bt
rviz
rosrun octomap_server octomap_server_node ~/easondrone_ws/reconstruct/easondrone_mapping/map.bt
```

添加`OccupancyGrid`,话题选择`/octomap_binary`
Expand All @@ -80,9 +80,3 @@ rosrun octomap_server octomap_server_node ~/EasonDrone/Reconstruction/EasonDrone
参考:
-[how to use octomap_server?](https://answers.ros.org/question/361841/how-to-use-octomap_server/)
-[OctoMap/octomap_mapping](https://github.com/OctoMap/octomap_mapping/blob/kinetic-devel/octomap_server/launch/octomap_tracking_server.launch)

## Acknowledgement

Thanks for following packages:

- [global_planning](https://github.com/amov-lab/Prometheus/Modules/planning/global_planning)
92 changes: 76 additions & 16 deletions config/rviz_config.rviz → config/easondrone.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Panels:
Expanded:
- /State1
- /Sensor1
- /Sensor1/RGBD1
- /Sensor1/realsense_d435i1
- /Mapping1
Splitter Ratio: 0.43611112236976624
Tree Height: 786
Expand Down Expand Up @@ -64,6 +64,8 @@ Visualization Manager:
Value: true
base_link_frd:
Value: false
laser_livox:
Value: true
map:
Value: false
map_ned:
Expand All @@ -85,20 +87,22 @@ Visualization Manager:
Show Axes: true
Show Names: true
Tree:
base_link:
VLP16_link:
{}
base_link_frd:
{}
monocular_link:
{}
realsense_camera_frame:
{}
odom:
odom_ned:
{}
world:
map:
base_link:
VLP16_link:
{}
base_link_frd:
{}
laser_livox:
{}
monocular_link:
{}
realsense_camera_frame:
{}
map_ned:
{}
Update Interval: 0
Expand Down Expand Up @@ -180,11 +184,11 @@ Visualization Manager:
Color: 255; 255; 255
Color Transformer: AxisColor
Decay Time: 0
Enabled: true
Enabled: false
Invert Rainbow: false
Max Color: 255; 255; 255
Min Color: 0; 0; 0
Name: LaserScan
Name: velodyne_vlp16
Position Transformer: XYZ
Queue Size: 10
Selectable: true
Expand All @@ -195,7 +199,35 @@ Visualization Manager:
Unreliable: false
Use Fixed Frame: true
Use rainbow: true
Value: true
Value: false
- Alpha: 1
Autocompute Intensity Bounds: true
Autocompute Value Bounds:
Max Value: 4.867906093597412
Min Value: -0.20269186794757843
Value: true
Axis: Z
Channel Name: intensity
Class: rviz/PointCloud2
Color: 255; 255; 255
Color Transformer: AxisColor
Decay Time: 0
Enabled: false
Invert Rainbow: false
Max Color: 255; 255; 255
Min Color: 0; 0; 0
Name: livox_mid360
Position Transformer: XYZ
Queue Size: 10
Selectable: true
Size (Pixels): 3
Size (m): 0.05000000074505806
Style: Points
Topic: /livox/lidar
Unreliable: false
Use Fixed Frame: true
Use rainbow: true
Value: false
- Class: rviz/Group
Displays:
- Class: rviz/Image
Expand Down Expand Up @@ -241,7 +273,7 @@ Visualization Manager:
Decay Time: 0
Depth Map Topic: /realsense/depth_camera/depth/image_raw
Depth Map Transport Hint: raw
Enabled: true
Enabled: false
Invert Rainbow: false
Max Color: 255; 255; 255
Min Color: 0; 0; 0
Expand All @@ -257,9 +289,9 @@ Visualization Manager:
Topic Filter: true
Use Fixed Frame: true
Use rainbow: true
Value: true
Value: false
Enabled: true
Name: RGBD
Name: realsense_d435i
Enabled: true
Name: Sensor
- Class: rviz/Group
Expand Down Expand Up @@ -292,6 +324,34 @@ Visualization Manager:
Use Fixed Frame: true
Use rainbow: true
Value: true
- Alpha: 1
Autocompute Intensity Bounds: true
Autocompute Value Bounds:
Max Value: 4.96946907043457
Min Value: -0.4458925724029541
Value: true
Axis: Z
Channel Name: intensity
Class: rviz/PointCloud2
Color: 255; 0; 0
Color Transformer: FlatColor
Decay Time: 0
Enabled: true
Invert Rainbow: false
Max Color: 255; 255; 255
Min Color: 0; 0; 0
Name: merge_pcl
Position Transformer: XYZ
Queue Size: 10
Selectable: true
Size (Pixels): 3
Size (m): 0.009999999776482582
Style: Points
Topic: /sensor/pcl2_out
Unreliable: false
Use Fixed Frame: true
Use rainbow: true
Value: true
Enabled: true
Name: Mapping
Enabled: true
Expand Down
6 changes: 6 additions & 0 deletions config/merge_pcl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pcl2_source_num: 2
pcl2_topic_0: /livox/lidar
pcl2_frame_0: laser_livox
pcl2_topic_1: /realsense/depth_camera/depth/points
pcl2_frame_0: realsense_camera_frame
pcl2_topic_out: /sensor/pcl2_out
Binary file not shown.
Binary file removed doc/A2D4DC183292848C6C6F3BBF864275E8.png
Binary file not shown.
Binary file removed doc/D6E40B6520659FDAE5DA75590E3FF88A.png
Binary file not shown.
78 changes: 0 additions & 78 deletions doc/Untitled Diagram.drawio

This file was deleted.

Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_16-40-57.png
Binary file not shown.
Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_19-09-55.png
Binary file not shown.
Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_19-10-22.png
Binary file not shown.
Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_19-10-47.png
Binary file not shown.
Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_19-11-03.png
Binary file not shown.
Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_19-11-14.png
Binary file not shown.
Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_20-04-05.png
Binary file not shown.
Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_20-04-16.png
Binary file not shown.
Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_20-04-41.png
Binary file not shown.
Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_20-06-19.png
Binary file not shown.
Binary file removed doc/log/2024-03-05/Snipaste_2024-03-05_20-07-30.png
Binary file not shown.
Loading

0 comments on commit b6640fd

Please sign in to comment.