diff --git a/jsk_mbzirc_common/CMakeLists.txt b/jsk_mbzirc_common/CMakeLists.txt index 74b8d1c..a06e2b5 100644 --- a/jsk_mbzirc_common/CMakeLists.txt +++ b/jsk_mbzirc_common/CMakeLists.txt @@ -4,62 +4,71 @@ project(jsk_mbzirc_common) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) ## is used, also find other catkin packages -find_package(catkin REQUIRED COMPONENTS gazebo_ros std_msgs geometry_msgs) +find_package(gazebo_ros QUIET) -# Depend on system install of Gazebo and SDFormat -find_package(gazebo REQUIRED) -find_package(Boost REQUIRED COMPONENTS thread random) +if(NOT gazebo_ros_FOUND) + message(WARNING "gazebo_ros IS NOT FOUND, so copmile ${PROJECT_NAME} +without gazebo") +endif() + +if(gazebo_ros_FOUND) + + find_package(catkin REQUIRED COMPONENTS std_msgs geometry_msgs) + # Depend on system install of Gazebo and SDFormat + find_package(gazebo REQUIRED) + find_package(Boost REQUIRED COMPONENTS thread random) -################################### -## catkin specific configuration ## -################################### -catkin_package( + ################################### + ## catkin specific configuration ## + ################################### + catkin_package( CATKIN_DEPENDS -) + ) -# build plugins -include_directories(include ${Boost_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS}) + # build plugins + include_directories(include ${Boost_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS}) -add_library(mbzirc_gazebo_truck_plugin src/mbzirc_gazebo_truck_plugin.cpp) -target_link_libraries(mbzirc_gazebo_truck_plugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + add_library(mbzirc_gazebo_truck_plugin src/mbzirc_gazebo_truck_plugin.cpp) + target_link_libraries(mbzirc_gazebo_truck_plugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) -add_library(mbzirc_gazebo_panel_plugin src/mbzirc_gazebo_panel_plugin.cpp) -target_link_libraries(mbzirc_gazebo_panel_plugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + add_library(mbzirc_gazebo_panel_plugin src/mbzirc_gazebo_panel_plugin.cpp) + target_link_libraries(mbzirc_gazebo_panel_plugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) -add_library(mbzirc_gazebo_treasure_plugin src/mbzirc_gazebo_treasure_plugin.cpp) -target_link_libraries(mbzirc_gazebo_treasure_plugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + add_library(mbzirc_gazebo_treasure_plugin src/mbzirc_gazebo_treasure_plugin.cpp) + target_link_libraries(mbzirc_gazebo_treasure_plugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) -add_library(mbzirc_gazebo_uav_collision_rule_plugin src/mbzirc_gazebo_uav_collision_rule_plugin.cpp) -target_link_libraries(mbzirc_gazebo_uav_collision_rule_plugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) + add_library(mbzirc_gazebo_uav_collision_rule_plugin src/mbzirc_gazebo_uav_collision_rule_plugin.cpp) + target_link_libraries(mbzirc_gazebo_uav_collision_rule_plugin ${GAZEBO_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES}) -############# -## Install ## -############# -install(TARGETS - mbzirc_gazebo_truck_plugin mbzirc_gazebo_panel_plugin mbzirc_gazebo_treasure_plugin - mbzirc_gazebo_uav_collision_rule_plugin - DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} - LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} - ) + ############# + ## Install ## + ############# + install(TARGETS + mbzirc_gazebo_truck_plugin mbzirc_gazebo_panel_plugin mbzirc_gazebo_treasure_plugin + mbzirc_gazebo_uav_collision_rule_plugin + DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + ) -install(DIRECTORY launch gazebo_model - DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} - USE_SOURCE_PERMISSIONS) + install(DIRECTORY launch gazebo_model + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} + USE_SOURCE_PERMISSIONS) -############# -## Testing ## -############# -if(CATKIN_ENABLE_TESTING) - find_package(rostest REQUIRED) - find_package(roslaunch REQUIRED) - find_package(roslint REQUIRED) - roslint_cpp() - roslint_python() - roslint_add_test() - roslaunch_add_file_check(launch/mbzirc_arena.launch) - roslaunch_add_file_check(launch/mbzirc_arena_1.launch) - roslaunch_add_file_check(launch/mbzirc_arena_2.launch) - roslaunch_add_file_check(launch/mbzirc_arena_3.launch) + ############# + ## Testing ## + ############# + if(CATKIN_ENABLE_TESTING) + find_package(rostest REQUIRED) + find_package(roslaunch REQUIRED) + find_package(roslint REQUIRED) + roslint_cpp() + roslint_python() + roslint_add_test() + roslaunch_add_file_check(launch/mbzirc_arena.launch) + roslaunch_add_file_check(launch/mbzirc_arena_1.launch) + roslaunch_add_file_check(launch/mbzirc_arena_2.launch) + roslaunch_add_file_check(launch/mbzirc_arena_3.launch) + endif() endif() diff --git a/jsk_mbzirc_tasks/CMakeLists.txt b/jsk_mbzirc_tasks/CMakeLists.txt index 8228503..c135800 100644 --- a/jsk_mbzirc_tasks/CMakeLists.txt +++ b/jsk_mbzirc_tasks/CMakeLists.txt @@ -4,10 +4,11 @@ project(jsk_mbzirc_tasks) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) ## is used, also find other catkin packages -find_package(catkin REQUIRED COMPONENTS roscpp gazebo_ros) +find_package(catkin REQUIRED COMPONENTS roscpp) # Depend on system install of Gazebo and SDFormat -find_package(gazebo REQUIRED) +find_package(gazebo_ros QUIET) + ################################### ## catkin specific configuration ## diff --git a/mbzirc.rosinstall b/mbzirc.rosinstall index 3e49ad8..253a89c 100644 --- a/mbzirc.rosinstall +++ b/mbzirc.rosinstall @@ -19,5 +19,5 @@ # https://github.com/ros-simulation/gazebo_ros_pkgs/pull/460 - git: local-name: gazebo_ros_pkgs - uri: https://github.com/furushchev/gazebo_ros_pkgs.git - version: fix-camera-util + uri: https://github.com/ros-simulation/gazebo_ros_pkgs.git + version: indigo-devel