From 7cfce2a72e54bdc74ea067b7bbdb2638fd4be553 Mon Sep 17 00:00:00 2001 From: Shun Hasegawa Date: Mon, 18 Jun 2018 20:33:20 +0900 Subject: [PATCH 1/8] Add idl for old impedance controller --- .../idl/AbsoluteForceSensorService.idl | 31 +++++++++ .../idl/ImpedanceControllerService.idl | 66 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 hironx_ros_bridge/idl/AbsoluteForceSensorService.idl create mode 100644 hironx_ros_bridge/idl/ImpedanceControllerService.idl diff --git a/hironx_ros_bridge/idl/AbsoluteForceSensorService.idl b/hironx_ros_bridge/idl/AbsoluteForceSensorService.idl new file mode 100644 index 00000000..227fe601 --- /dev/null +++ b/hironx_ros_bridge/idl/AbsoluteForceSensorService.idl @@ -0,0 +1,31 @@ +/** + * @file AbsoluteForceSensorService.idl + * @brief Services for the absolute force sensor interface + */ +module OpenHRP +{ + interface AbsoluteForceSensorService + { + typedef sequence DblSequence3; + struct forcemomentOffsetParam { + DblSequence3 force_offset; + DblSequence3 moment_offset; + DblSequence3 link_offset_centroid; + double link_offset_mass; + }; + + /** + * @brief set offset parameters. + * @param i_param new offset parameters + * @return true if set successfully, false otherwise + */ + boolean setForceMomentOffsetParam(in string name, in forcemomentOffsetParam i_param); + + /** + * @brief get offset parameters. + * @param name is name of the offset parameter set and i_param output offset parameters + * @return true if set successfully, false otherwise + */ + boolean getForceMomentOffsetParam(in string name, out forcemomentOffsetParam i_param); + }; +}; diff --git a/hironx_ros_bridge/idl/ImpedanceControllerService.idl b/hironx_ros_bridge/idl/ImpedanceControllerService.idl new file mode 100644 index 00000000..009e7e9e --- /dev/null +++ b/hironx_ros_bridge/idl/ImpedanceControllerService.idl @@ -0,0 +1,66 @@ +/** + * @file ImpedanceControllerService.idl + * @brief Services for the impedance interface + */ +module OpenHRP +{ + + interface ImpedanceControllerService + { + typedef sequence DblSequence3; + + struct impedanceParam { + string name; + string base_name; + string target_name; + double M_p; + double D_p; + double K_p; + double M_r; + double D_r; + double K_r; + DblSequence3 ref_force; + DblSequence3 force_gain; + DblSequence3 ref_moment; + DblSequence3 moment_gain; + double sr_gain; + double avoid_gain; + double reference_gain; + double manipulability_limit; + }; + + /** + * @brief set impedance parameters. + * @param i_param new impedance parameters + * @return true if set successfully, false otherwise + */ + boolean setImpedanceControllerParam(in impedanceParam i_param); + + /** + * @brief get impedance parameters. + * @param name is name of the impedance parameter set and i_param output impedance parameters + * @return true if set successfully, false otherwise + */ + boolean getImpedanceControllerParam(in string name, out impedanceParam i_param); + + /** + * @brief remove impedance parameters. + * @param name name of the impedance parameter set + * @return true if set successfully, false otherwise + */ + boolean deleteImpedanceController(in string name); + + /** + * @brief wait to finish deleting the impedance param object. + * @param name name of the impedance parameter set + */ + void waitDeletingImpedanceController(in string name); + + /** + * @brief remove impedance parameters and wait to finish deleting the impedance param object. + * @param name name of the impedance parameter set + * @return true if set successfully, false otherwise + */ + boolean deleteImpedanceControllerAndWait(in string name); + }; +}; From 5ddc329a7d46ce121896cc572f930494efd2f43f Mon Sep 17 00:00:00 2001 From: Shun Hasegawa Date: Tue, 19 Jun 2018 13:10:42 +0900 Subject: [PATCH 2/8] Add ros bridge generation from idl --- hironx_ros_bridge/CMakeLists.txt | 16 ++++++++++++++-- hironx_ros_bridge/package.xml | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/hironx_ros_bridge/CMakeLists.txt b/hironx_ros_bridge/CMakeLists.txt index 260dbb29..22d3be1f 100644 --- a/hironx_ros_bridge/CMakeLists.txt +++ b/hironx_ros_bridge/CMakeLists.txt @@ -1,15 +1,26 @@ cmake_minimum_required(VERSION 2.8.3) project(hironx_ros_bridge) -find_package(catkin REQUIRED COMPONENTS hrpsys_ros_bridge roslib roslint rostest) +find_package(catkin REQUIRED COMPONENTS hrpsys_ros_bridge roslib roslint rostest rtmbuild) find_package(Boost REQUIRED COMPONENTS system) +# catkin_python_setup() must be before generate_messages() included in rtmbuild_init() +catkin_python_setup() + +# initialize rtmbuild for old impedance controller +rtmbuild_init() + +# call catkin_package, after rtmbuild_init, before rtmbuild_gen* catkin_package( CATKIN_DEPENDS hrpsys_ros_bridge roslib # INCLUDE_DIRS include ) -catkin_python_setup() +# generate idl for old impedance controller +rtmbuild_genidl() + +# generate bridge for old impedance controller +rtmbuild_genbridge() add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/models/kawada-hironx.dae COMMAND ${catkin_EXTRAS_DIR}/test/download_checkmd5.py @@ -72,6 +83,7 @@ install(DIRECTORY conf DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} PATTERN " install(DIRECTORY models DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} PATTERN ".svn" EXCLUDE) install(DIRECTORY resource DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) install(DIRECTORY test DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} USE_SOURCE_PERMISSIONS PATTERN ".svn" EXCLUDE) +install(DIRECTORY idl DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} USE_SOURCE_PERMISSIONS) install(FILES rqt_plugin.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) install(CODE " diff --git a/hironx_ros_bridge/package.xml b/hironx_ros_bridge/package.xml index f4716c6b..087729dc 100644 --- a/hironx_ros_bridge/package.xml +++ b/hironx_ros_bridge/package.xml @@ -29,6 +29,7 @@ rosbash rosbuild roslang + rtmbuild unzip gnuplot From 1b9532a09749d7eb66b33a232ab564f5a3aac144 Mon Sep 17 00:00:00 2001 From: Shun Hasegawa Date: Tue, 19 Jun 2018 13:11:29 +0900 Subject: [PATCH 3/8] Add .gitignore for auto generated files --- hironx_ros_bridge/.gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 hironx_ros_bridge/.gitignore diff --git a/hironx_ros_bridge/.gitignore b/hironx_ros_bridge/.gitignore new file mode 100644 index 00000000..a6c00251 --- /dev/null +++ b/hironx_ros_bridge/.gitignore @@ -0,0 +1,9 @@ +# For rtmbuild +msg/OpenHRP_* +srv/OpenHRP_* +src_gen + +# For others +conf/*.conf +conf/*.xml +*.pyc From c59e4b0a855cd0507c1cf1ac32a2066a7a667679 Mon Sep 17 00:00:00 2001 From: Shun Hasegawa Date: Tue, 19 Jun 2018 13:13:02 +0900 Subject: [PATCH 4/8] Bring up impedance controller unique to hironx --- .../launch/hironx_ros_bridge.launch | 10 +++++++- .../launch/impedance_controller.launch | 23 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 hironx_ros_bridge/launch/impedance_controller.launch diff --git a/hironx_ros_bridge/launch/hironx_ros_bridge.launch b/hironx_ros_bridge/launch/hironx_ros_bridge.launch index d1efed4a..80b6548a 100644 --- a/hironx_ros_bridge/launch/hironx_ros_bridge.launch +++ b/hironx_ros_bridge/launch/hironx_ros_bridge.launch @@ -34,12 +34,20 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 589e7f3096b97cd6d5c8a184e78c84838cdb5d8c Mon Sep 17 00:00:00 2001 From: Shun Hasegawa Date: Wed, 20 Jun 2018 20:05:54 +0900 Subject: [PATCH 5/8] Don't generate python from idl to avoid error Error cause: generated python module 'OpenHRP' conflicts openhrp3 pkg --- hironx_ros_bridge/CMakeLists.txt | 7 +- .../cmake/rtmbuild_customed.cmake | 143 ++++++++++++++++++ 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 hironx_ros_bridge/cmake/rtmbuild_customed.cmake diff --git a/hironx_ros_bridge/CMakeLists.txt b/hironx_ros_bridge/CMakeLists.txt index 22d3be1f..9101531a 100644 --- a/hironx_ros_bridge/CMakeLists.txt +++ b/hironx_ros_bridge/CMakeLists.txt @@ -7,6 +7,9 @@ find_package(Boost REQUIRED COMPONENTS system) # catkin_python_setup() must be before generate_messages() included in rtmbuild_init() catkin_python_setup() +# for generating bridge for old impedance controller +include(${PROJECT_SOURCE_DIR}/cmake/rtmbuild_customed.cmake) + # initialize rtmbuild for old impedance controller rtmbuild_init() @@ -14,10 +17,11 @@ rtmbuild_init() catkin_package( CATKIN_DEPENDS hrpsys_ros_bridge roslib # INCLUDE_DIRS include + CFG_EXTRAS rtmbuild_customed.cmake ) # generate idl for old impedance controller -rtmbuild_genidl() +rtmbuild_genidl_no_py() # generate bridge for old impedance controller rtmbuild_genbridge() @@ -84,6 +88,7 @@ install(DIRECTORY models DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} PATTERN install(DIRECTORY resource DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) install(DIRECTORY test DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} USE_SOURCE_PERMISSIONS PATTERN ".svn" EXCLUDE) install(DIRECTORY idl DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} USE_SOURCE_PERMISSIONS) +install(DIRECTORY cmake DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} USE_SOURCE_PERMISSIONS) install(FILES rqt_plugin.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) install(CODE " diff --git a/hironx_ros_bridge/cmake/rtmbuild_customed.cmake b/hironx_ros_bridge/cmake/rtmbuild_customed.cmake new file mode 100644 index 00000000..93e23774 --- /dev/null +++ b/hironx_ros_bridge/cmake/rtmbuild_customed.cmake @@ -0,0 +1,143 @@ +# Based on rtmbuild/cmake/rtmbuild.cmake +cmake_minimum_required(VERSION 2.8.3) + +#set(DEBUG_RTMBUILD_CMAKE TRUE) + +set(use_catkin TRUE) + +# for rosbuild +if(NOT COMMAND _rtmbuild_genbridge_init) + include(${rtmbuild_PACKAGE_PATH}/cmake/servicebridge.cmake) + set(use_catkin FALSE) +endif() + + +## +## See rtmbuild/cmake/rtmbuild.cmake for GLOBAL VARIABLES +## + +# add_custom_command to compile idl/*.idl file into c++ +# don't generate python +macro(rtmbuild_genidl_no_py) + message("[rtmbuild_genidl_no_py] add_custom_command for idl files in package ${PROJECT_NAME}") + + set(_autogen "") + + if (use_catkin) + set(_output_cpp_dir ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_INCLUDE_DESTINATION}) + set(_output_lib_dir ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}) + # don't generate python + # set(_output_python_dir ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}/${PROJECT_NAME}) + unset(_output_python_dir) + else() + set(_output_dir ${PROJECT_SOURCE_DIR}/idl_gen) + set(_output_cpp_dir ${PROJECT_SOURCE_DIR}/idl_gen/cpp/${PROJECT_NAME}) + set(_output_lib_dir ${PROJECT_SOURCE_DIR}/idl_gen/lib) + # don't generate python + # set(_output_python_dir ${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}) + unset(_output_python_dir) + include_directories(${PROJECT_SOURCE_DIR}/idl_gen/cpp/) + endif() + + # don't generate python + # set(_output_idl_py_files "") + unset(_output_idl_py_files) + set(_output_idl_hh_files "") + file(MAKE_DIRECTORY ${_output_cpp_dir}/idl) + file(MAKE_DIRECTORY ${_output_lib_dir}) + link_directories(${_output_lib_dir}) + + message("[rtmbuild_genidl_no_py] - _output_cpp_dir : ${_output_cpp_dir}") + message("[rtmbuild_genidl_no_py] - _output_lib_dir : ${_output_lib_dir}") + # don't generate python + # message("[rtmbuild_genidl] - _output_python_dir : ${_output_python_dir}") + + ## RTMBUILD_${PROJECT_NAME}_genrpc) depends on each RTMBUILD_${PROJECT_NAME}_${_idl_name}_genrpc) + add_custom_target(RTMBUILD_${PROJECT_NAME}_genrpc) + if(NOT ${PROJECT_NAME}_idl_files) + message(AUTHOR_WARNING "[rtmbuild_genidl_no_py] - no idl file is defined") + endif() + foreach(_idl_file ${${PROJECT_NAME}_idl_files}) + get_filename_component(_idl_name ${_idl_file} NAME_WE) + message("[rtmbuild_genidl_no_py] - _idl_file : ${_idl_file}") + message("[rtmbuild_genidl_no_py] - _idl_name : ${_idl_name}") + + # set(_input_idl ${PROJECT_SOURCE_DIR}/idl/${_idl}) + + set(_output_idl_hh ${_output_cpp_dir}/idl/${_idl_name}.hh) + # don't generate python + # set(_output_idl_py ${_output_python_dir}/${_idl_name}_idl.py) + unset(_output_idl_py) + set(_output_stub_h ${_output_cpp_dir}/idl/${_idl_name}Stub.h) + set(_output_skel_h ${_output_cpp_dir}/idl/${_idl_name}Skel.h) + set(_output_stub_cpp ${_output_cpp_dir}/idl/${_idl_name}Stub.cpp) + set(_output_skel_cpp ${_output_cpp_dir}/idl/${_idl_name}Skel.cpp) + set(_output_stub_lib ${_output_lib_dir}/lib${_idl_name}Stub.so) + set(_output_skel_lib ${_output_lib_dir}/lib${_idl_name}Skel.so) + list(APPEND ${PROJECT_NAME}_IDLLIBRARY_DIRS lib${_idl_name}Stub.so lib${_idl_name}Skel.so) + # call the rule to compile idl + if(DEBUG_RTMBUILD_CMAKE) + message("[rtmbuild_genidl_no_py] ${_output_idl_hh}\n -> ${_idl_file} ${${_idl}_depends}") + message("[rtmbuild_genidl_no_py] ${_output_stub_cpp} ${_output_skel_cpp} ${_output_stub_h} ${_output_skel_h}\n -> ${_output_idl_hh}") + message("[rtmbuild_genidl_no_py] ${_output_stub_lib} ${_output_skel_lib}\n -> ${_output_stub_cpp} ${_output_stub_h} ${_output_skel_cpp} ${_output_skel_h}") + endif() + # cpp + add_custom_command(OUTPUT ${_output_idl_hh} + COMMAND ${rtm_idlc} ${rtm_idlflags} -C${_output_cpp_dir}/idl ${_idl_file} + DEPENDS ${_idl_file}) + add_custom_command(OUTPUT ${_output_stub_cpp} ${_output_skel_cpp} ${_output_stub_h} ${_output_skel_h} + COMMAND cp ${_idl_file} ${_output_cpp_dir}/idl + COMMAND rm -f ${_output_stub_cpp} ${_output_skel_cpp} ${_output_stub_h} ${_output_skel_h} + COMMAND ${rtmskel_EXECUTABLE} --include-dir="" --skel-suffix=Skel --stub-suffix=Stub --idl-file=${_idl_file} + WORKING_DIRECTORY ${_output_cpp_dir}/idl + DEPENDS ${_output_idl_hh}) + add_custom_command(OUTPUT ${_output_stub_lib} ${_output_skel_lib} + COMMAND ${rtm_cxx} ${rtm_cflags} -I. -shared -o ${_output_stub_lib} ${_output_stub_cpp} ${rtm_libs} + COMMAND ${rtm_cxx} ${rtm_cflags} -I. -shared -o ${_output_skel_lib} ${_output_skel_cpp} ${rtm_libs} + DEPENDS ${_output_stub_cpp} ${_output_stub_h} ${_output_skel_cpp} ${_output_skel_h}) + list(APPEND ${PROJECT_NAME}_IDLLIBRARY_DIRS ${_output_stub_lib} ${_output_skel_lib}) + if(use_catkin) + install(PROGRAMS ${_output_stub_lib} ${_output_skel_lib} DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}) + endif() + # python + # don't generate python + # list(APPEND _output_idl_py_files ${_output_idl_py}) + # cpp + list(APPEND _output_idl_hh_files ${_output_idl_hh}) + # + # don't generate python + # list(APPEND _autogen ${_output_stub_lib} ${_output_skel_lib} ${_output_idl_py}) + list(APPEND _autogen ${_output_stub_lib} ${_output_skel_lib}) + + # add custom target + add_custom_target(RTMBUILD_${PROJECT_NAME}_${_idl_name}_genrpc DEPENDS ${_output_stub_lib} ${_output_skel_lib}) + add_dependencies(RTMBUILD_${PROJECT_NAME}_genrpc RTMBUILD_${PROJECT_NAME}_${_idl_name}_genrpc) + # genrpc may depends on any idl (generate all .hh filesbefore compiling rpc https://github.com/fkanehiro/hrpsys-base/pull/886) + add_dependencies(RTMBUILD_${PROJECT_NAME}_${_idl_name}_genrpc RTMBUILD_${PROJECT_NAME}_genhh) + + endforeach(_idl_file) + # python + # don't generate python + # add_custom_target(RTMBUILD_${PROJECT_NAME}_genpy DEPENDS ${_output_idl_py_files}) + # add_custom_command(OUTPUT ${_output_idl_py_files} + # COMMAND mkdir -p ${_output_python_dir} + # COMMAND echo \"${rtm_idlc} -bpython -I${rtm_idldir} -C${_output_python_dir} ${${PROJECT_NAME}_idl_files}\" + # COMMAND ${rtm_idlc} -bpython -I${rtm_idldir} -C${_output_python_dir} ${${PROJECT_NAME}_idl_files} + # COMMENT "Generating python/idl from ${${PROJECT_NAME}_idl_files}" + # DEPENDS ${${PROJECT_NAME}_idl_files}) + # add_dependencies(RTMBUILD_${PROJECT_NAME}_genrpc RTMBUILD_${PROJECT_NAME}_genpy) + # cpp (generate all .hh filesbefore compiling rpc https://github.com/fkanehiro/hrpsys-base/pull/886) + add_custom_target(RTMBUILD_${PROJECT_NAME}_genhh DEPENDS ${_output_idl_hh_files}) + add_dependencies(RTMBUILD_${PROJECT_NAME}_genrpc RTMBUILD_${PROJECT_NAME}_genhh) + ## + + if(_autogen) + if(DEBUG_RTMBUILD_CMAKE) + message("[rtmbuild_genidl_no_py] ADDITIONAL_MAKE_CLEAN_FILES : ${_autogen}") + endif() + # Also set up to clean the srv_gen directory + get_directory_property(_old_clean_files ADDITIONAL_MAKE_CLEAN_FILES) + list(APPEND _old_clean_files ${_autogen}) + set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${_old_clean_files}") + endif(_autogen) +endmacro(rtmbuild_genidl_no_py) From ce2c9995d789a7b320e9af69d6071c461bdb90cb Mon Sep 17 00:00:00 2001 From: Shun Hasegawa Date: Thu, 21 Jun 2018 13:20:01 +0900 Subject: [PATCH 6/8] Enable impedance ros bridge by default in real robot --- hironx_ros_bridge/launch/hironx_ros_bridge_real.launch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hironx_ros_bridge/launch/hironx_ros_bridge_real.launch b/hironx_ros_bridge/launch/hironx_ros_bridge_real.launch index b6c7d1bf..b77edf61 100644 --- a/hironx_ros_bridge/launch/hironx_ros_bridge_real.launch +++ b/hironx_ros_bridge/launch/hironx_ros_bridge_real.launch @@ -7,7 +7,7 @@ - + From 0a9bc49cb2df433a85afa14851f7f15016d68f3b Mon Sep 17 00:00:00 2001 From: Shun Hasegawa Date: Fri, 22 Jun 2018 18:59:10 +0900 Subject: [PATCH 7/8] Avoid compile error in other pkgs including idl --- hironx_ros_bridge/CMakeLists.txt | 2 +- .../cmake/rtmbuild_customed.cmake | 36 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/hironx_ros_bridge/CMakeLists.txt b/hironx_ros_bridge/CMakeLists.txt index 9101531a..b4790c7f 100644 --- a/hironx_ros_bridge/CMakeLists.txt +++ b/hironx_ros_bridge/CMakeLists.txt @@ -21,7 +21,7 @@ catkin_package( ) # generate idl for old impedance controller -rtmbuild_genidl_no_py() +rtmbuild_genidl_customed() # generate bridge for old impedance controller rtmbuild_genbridge() diff --git a/hironx_ros_bridge/cmake/rtmbuild_customed.cmake b/hironx_ros_bridge/cmake/rtmbuild_customed.cmake index 93e23774..1dc51c59 100644 --- a/hironx_ros_bridge/cmake/rtmbuild_customed.cmake +++ b/hironx_ros_bridge/cmake/rtmbuild_customed.cmake @@ -17,15 +17,19 @@ endif() ## # add_custom_command to compile idl/*.idl file into c++ -# don't generate python -macro(rtmbuild_genidl_no_py) - message("[rtmbuild_genidl_no_py] add_custom_command for idl files in package ${PROJECT_NAME}") +# Change points from original rtmbuild_genidl: +# - don't generate python +# - don't overwrite lib of CORBA skeleton and stub from other pkgs to avoid compile error in those pkgs +macro(rtmbuild_genidl_customed) + message("[rtmbuild_genidl_customed] add_custom_command for idl files in package ${PROJECT_NAME}") set(_autogen "") if (use_catkin) set(_output_cpp_dir ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_INCLUDE_DESTINATION}) - set(_output_lib_dir ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}) + # don't overwrite lib of CORBA skeleton and stub from other pkgs to avoid compile error in those pkgs + # set(_output_lib_dir ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}) + set(_output_lib_dir ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}/${PROJECT_NAME}) # don't generate python # set(_output_python_dir ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_PYTHON_DESTINATION}/${PROJECT_NAME}) unset(_output_python_dir) @@ -47,20 +51,20 @@ macro(rtmbuild_genidl_no_py) file(MAKE_DIRECTORY ${_output_lib_dir}) link_directories(${_output_lib_dir}) - message("[rtmbuild_genidl_no_py] - _output_cpp_dir : ${_output_cpp_dir}") - message("[rtmbuild_genidl_no_py] - _output_lib_dir : ${_output_lib_dir}") + message("[rtmbuild_genidl_customed] - _output_cpp_dir : ${_output_cpp_dir}") + message("[rtmbuild_genidl_customed] - _output_lib_dir : ${_output_lib_dir}") # don't generate python # message("[rtmbuild_genidl] - _output_python_dir : ${_output_python_dir}") ## RTMBUILD_${PROJECT_NAME}_genrpc) depends on each RTMBUILD_${PROJECT_NAME}_${_idl_name}_genrpc) add_custom_target(RTMBUILD_${PROJECT_NAME}_genrpc) if(NOT ${PROJECT_NAME}_idl_files) - message(AUTHOR_WARNING "[rtmbuild_genidl_no_py] - no idl file is defined") + message(AUTHOR_WARNING "[rtmbuild_genidl_customed] - no idl file is defined") endif() foreach(_idl_file ${${PROJECT_NAME}_idl_files}) get_filename_component(_idl_name ${_idl_file} NAME_WE) - message("[rtmbuild_genidl_no_py] - _idl_file : ${_idl_file}") - message("[rtmbuild_genidl_no_py] - _idl_name : ${_idl_name}") + message("[rtmbuild_genidl_customed] - _idl_file : ${_idl_file}") + message("[rtmbuild_genidl_customed] - _idl_name : ${_idl_name}") # set(_input_idl ${PROJECT_SOURCE_DIR}/idl/${_idl}) @@ -77,9 +81,9 @@ macro(rtmbuild_genidl_no_py) list(APPEND ${PROJECT_NAME}_IDLLIBRARY_DIRS lib${_idl_name}Stub.so lib${_idl_name}Skel.so) # call the rule to compile idl if(DEBUG_RTMBUILD_CMAKE) - message("[rtmbuild_genidl_no_py] ${_output_idl_hh}\n -> ${_idl_file} ${${_idl}_depends}") - message("[rtmbuild_genidl_no_py] ${_output_stub_cpp} ${_output_skel_cpp} ${_output_stub_h} ${_output_skel_h}\n -> ${_output_idl_hh}") - message("[rtmbuild_genidl_no_py] ${_output_stub_lib} ${_output_skel_lib}\n -> ${_output_stub_cpp} ${_output_stub_h} ${_output_skel_cpp} ${_output_skel_h}") + message("[rtmbuild_genidl_customed] ${_output_idl_hh}\n -> ${_idl_file} ${${_idl}_depends}") + message("[rtmbuild_genidl_customed] ${_output_stub_cpp} ${_output_skel_cpp} ${_output_stub_h} ${_output_skel_h}\n -> ${_output_idl_hh}") + message("[rtmbuild_genidl_customed] ${_output_stub_lib} ${_output_skel_lib}\n -> ${_output_stub_cpp} ${_output_stub_h} ${_output_skel_cpp} ${_output_skel_h}") endif() # cpp add_custom_command(OUTPUT ${_output_idl_hh} @@ -97,7 +101,9 @@ macro(rtmbuild_genidl_no_py) DEPENDS ${_output_stub_cpp} ${_output_stub_h} ${_output_skel_cpp} ${_output_skel_h}) list(APPEND ${PROJECT_NAME}_IDLLIBRARY_DIRS ${_output_stub_lib} ${_output_skel_lib}) if(use_catkin) - install(PROGRAMS ${_output_stub_lib} ${_output_skel_lib} DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}) + # don't overwrite lib of CORBA skeleton and stub from other pkgs to avoid compile error in those pkgs + # install(PROGRAMS ${_output_stub_lib} ${_output_skel_lib} DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}) + install(PROGRAMS ${_output_stub_lib} ${_output_skel_lib} DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}/${PROJECT_NAME}) endif() # python # don't generate python @@ -133,11 +139,11 @@ macro(rtmbuild_genidl_no_py) if(_autogen) if(DEBUG_RTMBUILD_CMAKE) - message("[rtmbuild_genidl_no_py] ADDITIONAL_MAKE_CLEAN_FILES : ${_autogen}") + message("[rtmbuild_genidl_customed] ADDITIONAL_MAKE_CLEAN_FILES : ${_autogen}") endif() # Also set up to clean the srv_gen directory get_directory_property(_old_clean_files ADDITIONAL_MAKE_CLEAN_FILES) list(APPEND _old_clean_files ${_autogen}) set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${_old_clean_files}") endif(_autogen) -endmacro(rtmbuild_genidl_no_py) +endmacro(rtmbuild_genidl_customed) From dcb20d39774037685b0302638014d3f4c4e08d53 Mon Sep 17 00:00:00 2001 From: Takayuki Murooka Date: Sat, 13 Apr 2019 16:51:38 +0900 Subject: [PATCH 8/8] add build_depend of message_generation for genjava --- hironx_ros_bridge/package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/hironx_ros_bridge/package.xml b/hironx_ros_bridge/package.xml index 087729dc..27c6d054 100644 --- a/hironx_ros_bridge/package.xml +++ b/hironx_ros_bridge/package.xml @@ -32,6 +32,7 @@ rtmbuild unzip gnuplot + message_generation gnuplot moveit_commander