cleaned up the code.

This commit is contained in:
Kayman 2017-06-08 09:24:57 +09:00
parent 50378f052f
commit e8ead30ee7
2 changed files with 27 additions and 109 deletions

View File

@ -1,9 +1,12 @@
################################################################################
# CMake
################################################################################
cmake_minimum_required(VERSION 2.8.3)
project(ball_detector)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
################################################################################
# Packages
################################################################################
find_package(catkin REQUIRED COMPONENTS
cv_bridge
geometry_msgs
@ -15,121 +18,55 @@ find_package(catkin REQUIRED COMPONENTS
message_generation
)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
################################################
## Declare ROS messages, services and actions ##
################################################
## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependencies might have been
## pulled in transitively but can be declared for certainty nonetheless:
## * add a build_depend tag for "message_generation"
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
## Generate messages in the 'msg' folder
################################################################################
# Declare ROS messages, services and actions
################################################################################
add_message_files(
FILES
circleSetStamped.msg
)
## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
geometry_msgs std_msgs
)
#dynamic reconfigure cfg file
################################################################################
# Declare ROS dynamic reconfigure parameters
################################################################################
generate_dynamic_reconfigure_options(cfg/detector_params.cfg)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
################################################################################
# Catkin specific configuration
################################################################################
catkin_package(
INCLUDE_DIRS include
# LIBRARIES ball_detector
CATKIN_DEPENDS cv_bridge geometry_msgs image_transport roscpp rospy std_msgs dynamic_reconfigure
# DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
################################################################################
# Build
################################################################################
include_directories(
include
${catkin_INCLUDE_DIRS}
)
## Declare a cpp library
#add_library(ball_detector
# src/BallDetector.cpp
# src/${PROJECT_NAME}/BallDetector.cpp
#)
## Declare a cpp executable
add_executable(ball_detector_node
src/ball_detector.cpp
src/ball_detector_node.cpp)
## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
# add_dependencies(ball_detector_node ball_detector_generate_messages_cpp)
add_dependencies(ball_detector_node ${PROJECT_NAME}_gencfg)
## Specify libraries to link a library or executable target against
target_link_libraries(ball_detector_node
${catkin_LIBRARIES}
yaml-cpp
)
#############
## Install ##
#############
################################################################################
# Install
################################################################################
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
@ -162,15 +99,7 @@ target_link_libraries(ball_detector_node
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_ball_detector.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
################################################################################
# Test
################################################################################

View File

@ -7,17 +7,11 @@
It requires and input image and publish, at frame rate, a marked image
and a stamped array of circle centers and radius.
</description>
<maintainer email="kmjung@robotis.com">kayman</maintainer>
<license>BSD</license>
<!-- <url type="website">http://wiki.ros.org/ball_detector</url> -->
<author email="kmjung@robotis.com">kayman</author>
<maintainer email="pyo@robotis.com">Pyo</maintainer>
<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>cv_bridge</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>image_transport</build_depend>
@ -26,7 +20,6 @@
<build_depend>std_msgs</build_depend>
<build_depend>dynamic_reconfigure</build_depend>
<build_depend>message_generation</build_depend>
<run_depend>cv_bridge</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>image_transport</run_depend>
@ -35,8 +28,4 @@
<run_depend>std_msgs</run_depend>
<run_depend>dynamic_reconfigure</run_depend>
<run_depend>message_runtime</run_depend>
<export>
</export>
</package>