Skip to content

Commit 459c35d

Browse files
committed
first release
1 parent 447ee30 commit 459c35d

File tree

7 files changed

+975
-2
lines changed

7 files changed

+975
-2
lines changed

CMakeLists.txt

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(convexhull_demo)
3+
4+
## Compile as C++11, supported in ROS Kinetic and newer
5+
add_compile_options(-std=c++11)
6+
7+
## Find catkin macros and libraries
8+
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
9+
## is used, also find other catkin packages
10+
find_package(catkin REQUIRED COMPONENTS
11+
roscpp
12+
sensor_msgs
13+
geometry_msgs
14+
visualization_msgs
15+
)
16+
17+
18+
19+
## System dependencies are found with CMake's conventions
20+
# find_package(Boost REQUIRED COMPONENTS system)
21+
22+
23+
## Uncomment this if the package has a setup.py. This macro ensures
24+
## modules and global scripts declared therein get installed
25+
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
26+
# catkin_python_setup()
27+
28+
################################################
29+
## Declare ROS messages, services and actions ##
30+
################################################
31+
32+
## To declare and build messages, services or actions from within this
33+
## package, follow these steps:
34+
## * Let MSG_DEP_SET be the set of packages whose message types you use in
35+
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
36+
## * In the file package.xml:
37+
## * add a build_depend tag for "message_generation"
38+
## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
39+
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
40+
## but can be declared for certainty nonetheless:
41+
## * add a exec_depend tag for "message_runtime"
42+
## * In this file (CMakeLists.txt):
43+
## * add "message_generation" and every package in MSG_DEP_SET to
44+
## find_package(catkin REQUIRED COMPONENTS ...)
45+
## * add "message_runtime" and every package in MSG_DEP_SET to
46+
## catkin_package(CATKIN_DEPENDS ...)
47+
## * uncomment the add_*_files sections below as needed
48+
## and list every .msg/.srv/.action file to be processed
49+
## * uncomment the generate_messages entry below
50+
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
51+
52+
## Generate messages in the 'msg' folder
53+
# add_message_files(
54+
# FILES
55+
# Message1.msg
56+
# Message2.msg
57+
# )
58+
59+
## Generate services in the 'srv' folder
60+
# add_service_files(
61+
# FILES
62+
# Service1.srv
63+
# Service2.srv
64+
# )
65+
66+
## Generate actions in the 'action' folder
67+
# add_action_files(
68+
# FILES
69+
# Action1.action
70+
# Action2.action
71+
# )
72+
73+
## Generate added messages and services with any dependencies listed here
74+
# generate_messages(
75+
# DEPENDENCIES
76+
# sensor_msgs
77+
# )
78+
79+
################################################
80+
## Declare ROS dynamic reconfigure parameters ##
81+
################################################
82+
83+
## To declare and build dynamic reconfigure parameters within this
84+
## package, follow these steps:
85+
## * In the file package.xml:
86+
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
87+
## * In this file (CMakeLists.txt):
88+
## * add "dynamic_reconfigure" to
89+
## find_package(catkin REQUIRED COMPONENTS ...)
90+
## * uncomment the "generate_dynamic_reconfigure_options" section below
91+
## and list every .cfg file to be processed
92+
93+
## Generate dynamic reconfigure parameters in the 'cfg' folder
94+
# generate_dynamic_reconfigure_options(
95+
# cfg/DynReconf1.cfg
96+
# cfg/DynReconf2.cfg
97+
# )
98+
99+
###################################
100+
## catkin specific configuration ##
101+
###################################
102+
## The catkin_package macro generates cmake config files for your package
103+
## Declare things to be passed to dependent projects
104+
## INCLUDE_DIRS: uncomment this if your package contains header files
105+
## LIBRARIES: libraries you create in this project that dependent projects also need
106+
## CATKIN_DEPENDS: catkin_packages dependent projects also need
107+
## DEPENDS: system dependencies of this project that dependent projects also need
108+
catkin_package(
109+
LIBRARIES exploration
110+
CATKIN_DEPENDS roscpp sensor_msgs geometry_msgs visualization_msgs
111+
)
112+
113+
###########
114+
## Build ##
115+
###########
116+
117+
## Specify additional locations of header files
118+
## Your package locations should be listed before other locations
119+
include_directories(
120+
include
121+
${catkin_INCLUDE_DIRS}
122+
)
123+
124+
## Declare a C++ library
125+
# add_library(${PROJECT_NAME}
126+
# src/${PROJECT_NAME}/lidar_process.cpp
127+
# )
128+
129+
## Depedent cpp files
130+
set(SOURCES ${SOURCES}
131+
src/convexhull.cpp
132+
)
133+
134+
## Add cmake target dependencies of the library
135+
## as an example, code may need to be generated before libraries
136+
## either from message generation or dynamic reconfigure
137+
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
138+
139+
## Declare a C++ executable
140+
## With catkin_make all packages are built within a single CMake context
141+
## The recommended prefix ensures that target names across packages don't collide
142+
# add_executable(${PROJECT_NAME}_node src/lidar_process_node.cpp)
143+
add_executable(convex_node src/demo.cpp ${SOURCES})
144+
target_link_libraries(convex_node ${catkin_LIBRARIES})
145+
146+
147+
## Rename C++ executable without prefix
148+
## The above recommended prefix causes long target names, the following renames the
149+
## target back to the shorter version for ease of user use
150+
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
151+
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
152+
153+
## Add cmake target dependencies of the executable
154+
## same as for the library above
155+
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
156+
157+
## Specify libraries to link a library or executable target against
158+
# target_link_libraries(${PROJECT_NAME}_node
159+
# ${catkin_LIBRARIES}
160+
# )
161+
162+
#############
163+
## Install ##
164+
#############
165+
166+
# all install targets should use catkin DESTINATION variables
167+
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
168+
169+
## Mark executable scripts (Python etc.) for installation
170+
## in contrast to setup.py, you can choose the destination
171+
# install(PROGRAMS
172+
# scripts/my_python_script
173+
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
174+
# )
175+
176+
## Mark executables for installation
177+
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
178+
# install(TARGETS ${PROJECT_NAME}_node
179+
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
180+
# )
181+
182+
## Mark libraries for installation
183+
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
184+
# install(TARGETS ${PROJECT_NAME}
185+
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
186+
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
187+
# RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
188+
# )
189+
190+
## Mark cpp header files for installation
191+
# install(DIRECTORY include/${PROJECT_NAME}/
192+
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
193+
# FILES_MATCHING PATTERN "*.h"
194+
# PATTERN ".svn" EXCLUDE
195+
# )
196+
197+
## Mark other files for installation (e.g. launch and bag files, etc.)
198+
# install(FILES
199+
# # myfile1
200+
# # myfile2
201+
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
202+
# )
203+
204+
#############
205+
## Testing ##
206+
#############
207+
208+
## Add gtest based cpp test target and link libraries
209+
# catkin_add_gtest(${PROJECT_NAME}-test test/test_lidar_process.cpp)
210+
# if(TARGET ${PROJECT_NAME}-test)
211+
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
212+
# endif()
213+
214+
## Add folders to be run by python nosetests
215+
# catkin_add_nosetests(test)
216+

README.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,41 @@
1-
# Convexhull-3D
2-
c++ implementation of 3D incremental convell hull algorthim
1+
## Incremental 3D-Convexhull algorithm
2+
This repository contains an C++ implementation of 3D-ConvexHull algorithm from the
3+
book [Computational Geometry in C by O'Rourke](http://crtl-i.com/PDF/comp_c.pdf). RVIZ is used for visualization but is
4+
not required to use this package. This code is implemented with C++11 STL conta-
5+
iners only. The files are well documented, feel free to poke around.
6+
7+
[!Example [video](https://media.giphy.com/media/hsV1GgRby1M4kDbAgm/giphy.gif)](https://youtu.be/DDgGc7_fEyU)
8+
9+
## Build and Run
10+
catkin_make
11+
source devel/setup.bash
12+
rosrun convexhull\_demo convex_node
13+
14+
## Example Usage
15+
Although in this example pcl pointcloud was used, the interface is a template
16+
function that takes any vector with points (expect to have field x, y and z)
17+
18+
func(pcl::PointCloud<pcl::PointXYZI>::Ptr PC, Point3D& p)
19+
{
20+
Convexhull ch(PC->points);
21+
if(ch.Contains(p)) // surface point is consider outside
22+
{
23+
//do something
24+
}
25+
auto vertices = ch.GetVertices();
26+
auto faces = ch.GetFaces();
27+
...
28+
}
29+
30+
## Who calls whom
31+
ConvexHull()
32+
--ConstructHull()
33+
-- BulildFirstHull()
34+
-- Colinear()
35+
-- Coplanar()
36+
-- AddOneFace()
37+
-- IncreHull()
38+
-- VolumeSign()
39+
-- AddOneFace()
40+
-- CleanUp()
41+
-- ExtractExteriorPoints()

package.xml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0"?>
2+
<package format="2">
3+
<name>convexhull_demo</name>
4+
<version>0.0.0</version>
5+
<description>package to demo 3D incremental convexhull algorithm</description>
6+
7+
<!-- One maintainer tag required, multiple allowed, one person per tag -->
8+
<!-- Example: -->
9+
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
10+
<maintainer email="dunghanlee@gmail.com">Dung-Han Lee</maintainer>
11+
12+
13+
<!-- One license tag required, multiple allowed, one license per tag -->
14+
<!-- Commonly used license strings: -->
15+
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
16+
<license>TODO</license>
17+
18+
19+
<!-- Url tags are optional, but multiple are allowed, one per tag -->
20+
<!-- Optional attribute type can be: website, bugtracker, or repository -->
21+
<!-- Example: -->
22+
<!-- <url type="website">http://wiki.ros.org/subT_exploration</url> -->
23+
24+
25+
<!-- Author tags are optional, multiple are allowed, one per tag -->
26+
<!-- Authors do not have to be maintainers, but could be -->
27+
<!-- Example: -->
28+
<!-- <author email="jane.doe@example.com">Jane Doe</author> -->
29+
30+
31+
<!-- The *depend tags are used to specify dependencies -->
32+
<!-- Dependencies can be catkin packages or system dependencies -->
33+
<!-- Examples: -->
34+
<!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
35+
<!-- <depend>roscpp</depend> -->
36+
<!-- Note that this is equivalent to the following: -->
37+
<!-- <build_depend>roscpp</build_depend> -->
38+
<!-- <exec_depend>roscpp</exec_depend> -->
39+
<!-- Use build_depend for packages you need at compile time: -->
40+
<!-- <build_depend>message_generation</build_depend> -->
41+
<!-- Use build_export_depend for packages you need in order to build against this package: -->
42+
<!-- <build_export_depend>message_generation</build_export_depend> -->
43+
<!-- Use buildtool_depend for build tool packages: -->
44+
<!-- <buildtool_depend>catkin</buildtool_depend> -->
45+
<!-- Use exec_depend for packages you need at runtime: -->
46+
<!-- <exec_depend>message_runtime</exec_depend> -->
47+
<!-- Use test_depend for packages you need only for testing: -->
48+
<!-- <test_depend>gtest</test_depend> -->
49+
<!-- Use doc_depend for packages you need only for building documentation: -->
50+
<!-- <doc_depend>doxygen</doc_depend> -->
51+
<buildtool_depend>catkin</buildtool_depend>
52+
<build_depend>roscpp</build_depend>
53+
<build_depend>sensor_msgs</build_depend>
54+
<build_depend>geometry_msgs</build_depend>
55+
<build_depend>visualization_msgs</build_depend>
56+
<build_export_depend>roscpp</build_export_depend>
57+
<build_export_depend>sensor_msgs</build_export_depend>
58+
<build_export_depend>geometry_msgs</build_export_depend>
59+
<build_export_depend>visualization_msgs</build_export_depend>
60+
<exec_depend>roscpp</exec_depend>
61+
<exec_depend>sensor_msgs</exec_depend>
62+
<exec_depend>geometry_msgs</exec_depend>
63+
<exec_depend>visualization_msgs</exec_depend>
64+
<build_depend>libpcl-all-dev</build_depend>
65+
<exec_depend>libpcl-all</exec_depend>
66+
67+
<!-- The export tag contains other, unspecified, tags -->
68+
<export>
69+
<!-- Other tools can request additional information be placed here -->
70+
71+
</export>
72+
</package>

0 commit comments

Comments
 (0)