Skip to content

Commit

Permalink
第四周作业,使用PCL先进行地面分割,然后再使用欧式聚类 aiimooc_syz4是ROS实现地面滤除
Browse files Browse the repository at this point in the history
  • Loading branch information
suyunzzz committed May 21, 2020
1 parent c7b16e1 commit c880ae1
Show file tree
Hide file tree
Showing 8 changed files with 681 additions and 0 deletions.
121 changes: 121 additions & 0 deletions aiimooc_syz4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# cmake_minimum_required(VERSION 2.8.3)
# project(aiimooc_syz4)

# add_compile_options(-std=c++11)


# find_package(catkin REQUIRED COMPONENTS
# pcl_ros
# roscpp
# sensor_msgs
# )

# ## Generate dynamic reconfigure parameters in the 'cfg' folder
# # generate_dynamic_reconfigure_options(
# # cfg/RangeImage.cfg
# ## cfg/DynReconf2.cfg
# # )


# find_package(PCL 1.9 REQUIRED)



# catkin_package(
# INCLUDE_DIRS include
# CATKIN_DEPENDS roscpp sensor_msgs pcl_ros
# DEPENDS PCL
# )


# include_directories(
# include ${catkin_INCLUDE_DIRS}
# include
# ${catkin_INCLUDE_DIRS}
# ${PCL_INCLUDE_DIRS}
# # ${OpenCV_INCLUDE_DIRS}
# )
# link_directories(${PCL_LIBRARY_DIRS})
# # link_directories(${OpenCV_LIBRARY_DIRS})


# add_executable(${PROJECT_NAME}_node
# #src/pt2image_core.cpp
# src/pcl_node.cpp
# )

# # add_dependencies(${PROJECT_NAME}_node ${PROJECT_NAME}_gencfg) # dynamic reconfigure 新加的依赖


# target_link_libraries(${PROJECT_NAME}_node
# ${catkin_LIBRARIES}
# ${PCL_LIBRARIES}
# # ${OpenVC_LIBRARIES}
# )

cmake_minimum_required(VERSION 2.8.3)
project(aiimooc_syz4)

add_compile_options(-std=c++11)


find_package(catkin REQUIRED COMPONENTS
pcl_ros
roscpp
sensor_msgs
# Eigen3

)

## Generate dynamic reconfigure parameters in the 'cfg' folder
generate_dynamic_reconfigure_options(
cfg/FitPlane.cfg
# cfg/DynReconf2.cfg
)

# set(PCL_DIR /home/s/pcl/release)
# set(PCL_DIR /usr/share/pcl-1.9)
find_package(PCL 1.9 REQUIRED)
# find_package(OpenCV REQUIRED)

message(STATUS "PCL_DIR = ${PCL_DIR}")
message(STATUS "PCL_INCLUDE_DIRS = ${PCL_INCLUDE_DIRS}")
message(STATUS "PCL_LIBS = ${PCL_LIBRARIES}")


catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp sensor_msgs pcl_ros
DEPENDS PCL
)


include_directories(
include
${catkin_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
/usr/lib/cmake/eigen3
# ${OpenCV_INCLUDE_DIRS}
)
link_directories(${PCL_LIBRARY_DIRS})
# link_directories(${OpenCV_LIBRARY_DIRS})


add_executable(${PROJECT_NAME}_node
src/pcl_node.cpp
)

# add_dependencies(${PROJECT_NAME}_node ${PROJECT_NAME}_gencfg) # dynamic reconfigure 新加的依赖


target_link_libraries(${PROJECT_NAME}_node
${catkin_LIBRARIES}
${PCL_LIBRARIES}
# ${OpenVC_LIBRARIES}
)






15 changes: 15 additions & 0 deletions aiimooc_syz4/cfg/FitPlane.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python

PACKAGE = "aiimooc_syz4"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("sensor_height", double_t, 0, "height of lidar", 1.2, 1.0, 2.5)
gen.add("num_iter", int_t, 0, "number of iter", 6, 3, 10)
gen.add("num_lpr", int_t, 0, "number of intial seeds points", 20, 10, 200)
gen.add("th_seeds", double_t, 0, "threshold of get seeds", 0.2, 0, 0.5)
gen.add("th_dist",double_t,0,"threshold of get plane",0.3,0,0.5)

exit(gen.generate(PACKAGE, "lidar_pcl", "FitPlane"))
4 changes: 4 additions & 0 deletions aiimooc_syz4/cfg/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
width_range: 180.
height_range: 180.
res_x: 1.0
res_y: 1.0
9 changes: 9 additions & 0 deletions aiimooc_syz4/launch/pcl_node.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<launch>
<node name="lidar_pcl" type="aiimooc_syz4_node" pkg="aiimooc_syz4" output="screen" respawn="false">

</node>

<node name="rviz" pkg="rviz" type="rviz" args="-d $(find aiimooc_syz4)/rviz/rslidar.rviz" required="true" />
<!--node name="rviz" pkg="rviz" type="rviz" required="true" /-->
</launch>
47 changes: 47 additions & 0 deletions aiimooc_syz4/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0"?>
<package format="2">
<name>aiimooc_syz4</name>
<version>0.0.0</version>
<description>tree filter segmentation in ROS</description>

<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="suyun_zheng@163.com">s</maintainer>


<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>TODO</license>



<buildtool_depend>catkin</buildtool_depend>
<build_depend>pcl_ros</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>ros_bridge</build_depend>




<!--build_export_depend>pcl_ros</build_export_depend-->
<!--build_export_depend>roscpp</build_export_depend-->
<!--build_export_depend>sensor_msgs</build_export_depend-->
<!--build_export_depend>ros_bridge</build_export_depend-->


<exec_depend>pcl_ros</exec_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>ros_bridge</exec_depend>



<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->

</export>
</package>
177 changes: 177 additions & 0 deletions aiimooc_syz4/rviz/rslidar.rviz
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
Panels:
- Class: rviz/Displays
Help Height: 78
Name: Displays
Property Tree Widget:
Expanded:
- /Global Options1
- /Status1
- /PointCloud21
- /PointCloud22
Splitter Ratio: 0.5
Tree Height: 565
- Class: rviz/Selection
Name: Selection
- Class: rviz/Tool Properties
Expanded:
- /2D Pose Estimate1
- /2D Nav Goal1
- /Publish Point1
Name: Tool Properties
Splitter Ratio: 0.588679016
- Class: rviz/Views
Expanded:
- /Current View1
Name: Views
Splitter Ratio: 0.5
- Class: rviz/Time
Experimental: false
Name: Time
SyncMode: 0
SyncSource: PointCloud2
Toolbars:
toolButtonStyle: 2
Visualization Manager:
Class: ""
Displays:
- Alpha: 0.5
Cell Size: 1
Class: rviz/Grid
Color: 160; 160; 164
Enabled: true
Line Style:
Line Width: 0.0299999993
Value: Lines
Name: Grid
Normal Cell Count: 0
Offset:
X: 0
Y: 0
Z: 0
Plane: XY
Plane Cell Count: 10
Reference Frame: <Fixed Frame>
Value: true
- Alpha: 1
Autocompute Intensity Bounds: true
Autocompute Value Bounds:
Max Value: 23.3599739
Min Value: -2.84932828
Value: true
Axis: Z
Channel Name: intensity
Class: rviz/PointCloud2
Color: 255; 255; 255
Color Transformer: AxisColor
Decay Time: 0
Enabled: true
Invert Rainbow: false
Max Color: 255; 255; 255
Max Intensity: 26.0100002
Min Color: 0; 0; 0
Min Intensity: 0.0545785241
Name: PointCloud2
Position Transformer: XYZ
Queue Size: 10
Selectable: true
Size (Pixels): 3
Size (m): 0.0299999993
Style: Flat Squares
Topic: /no_ground_points
Unreliable: false
Use Fixed Frame: true
Use rainbow: true
Value: true
- Alpha: 1
Autocompute Intensity Bounds: true
Autocompute Value Bounds:
Max Value: 10
Min Value: -10
Value: true
Axis: Z
Channel Name: intensity
Class: rviz/PointCloud2
Color: 255; 255; 255
Color Transformer: Intensity
Decay Time: 0
Enabled: true
Invert Rainbow: false
Max Color: 255; 255; 255
Max Intensity: 4096
Min Color: 0; 0; 0
Min Intensity: 0
Name: PointCloud2
Position Transformer: XYZ
Queue Size: 10
Selectable: true
Size (Pixels): 3
Size (m): 0.0299999993
Style: Flat Squares
Topic: /ground_points
Unreliable: false
Use Fixed Frame: true
Use rainbow: true
Value: true
Enabled: true
Global Options:
Background Color: 48; 48; 48
Default Light: true
Fixed Frame: rslidar
Frame Rate: 30
Name: root
Tools:
- Class: rviz/Interact
Hide Inactive Objects: true
- Class: rviz/MoveCamera
- Class: rviz/Select
- Class: rviz/FocusCamera
- Class: rviz/Measure
- Class: rviz/SetInitialPose
Topic: /initialpose
- Class: rviz/SetGoal
Topic: /move_base_simple/goal
- Class: rviz/PublishPoint
Single click: true
Topic: /clicked_point
Value: true
Views:
Current:
Class: rviz/Orbit
Distance: 112.951912
Enable Stereo Rendering:
Stereo Eye Separation: 0.0599999987
Stereo Focal Distance: 1
Swap Stereo Eyes: false
Value: false
Focal Point:
X: 0
Y: 0
Z: 0
Focal Shape Fixed Size: true
Focal Shape Size: 0.0500000007
Invert Z Axis: false
Name: Current View
Near Clip Distance: 0.00999999978
Pitch: 1.20539939
Target Frame: <Fixed Frame>
Value: Orbit (rviz)
Yaw: 2.97040224
Saved: ~
Window Geometry:
Displays:
collapsed: false
Height: 846
Hide Left Dock: false
Hide Right Dock: false
QMainWindow State: 000000ff00000000fd00000004000000000000016a000002c4fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006100fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c0061007900730100000028000002c4000000d700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f000002c4fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a005600690065007700730100000028000002c4000000ad00fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004b00000003efc0100000002fb0000000800540069006d00650100000000000004b00000030000fffffffb0000000800540069006d006501000000000000045000000000000000000000022b000002c400000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
Selection:
collapsed: false
Time:
collapsed: false
Tool Properties:
collapsed: false
Views:
collapsed: false
Width: 1200
X: 65
Y: 60
Loading

0 comments on commit c880ae1

Please sign in to comment.