diff --git a/hironx_ros_bridge/robot/hrpiob/CMakeLists.txt b/hironx_ros_bridge/robot/hrpiob/CMakeLists.txt index 7077046e..c67388d4 100644 --- a/hironx_ros_bridge/robot/hrpiob/CMakeLists.txt +++ b/hironx_ros_bridge/robot/hrpiob/CMakeLists.txt @@ -39,14 +39,25 @@ link_directories(/opt/jsk/lib /usr/pkg/lib) #endif() # hrpsys-base -#include(FindPkgConfig) +include(FindPkgConfig) execute_process( COMMAND pkg-config --cflags-only-I hrpsys-base OUTPUT_VARIABLE HRPSYSBASE_CXX_FLAGS RESULT_VARIABLE RESULT) +execute_process( + COMMAND pkg-config --modversion hrpsys-base + OUTPUT_VARIABLE HRPSYSBASE_VERSION + RESULT_VARIABLE RESULT) + message("HRPSYSBASE_CXX_FLAGS: ${HRPSYSBASE_CXX_FLAGS}") +message("HRPSYSBASE_VERSION: ${HRPSYSBASE_VERSION}") +if(NOT "${HRPSYSBASE_VERSION}" VERSION_LESS "315.4.0") + add_definitions(-DROBOT_IOB_VERSION=2) + message(STATUS "USE VERSION 2 OF IOB") + message(STATUS "ADD DEFINITION -DROBOT_IOB_VERSION=2") +endif() add_definitions(${HRPSYSBASE_CXX_FLAGS}) diff --git a/hironx_ros_bridge/robot/hrpiob/iob.cpp b/hironx_ros_bridge/robot/hrpiob/iob.cpp index 138b5e2e..9911f37e 100644 --- a/hironx_ros_bridge/robot/hrpiob/iob.cpp +++ b/hironx_ros_bridge/robot/hrpiob/iob.cpp @@ -733,3 +733,35 @@ int read_digital_output(char *doutput) else return FALSE; } + +#ifndef defined(ROBOT_IOB_VERSION) && ROBOT_IOB_VERSION >= 2 +/** + * @brief Needed for hrpsys 315.4.0 onward (added at https://github.com/fkanehiro/hrpsys-base/pull/598). + * TODO Implement if we want to utilize this. + */ +int number_of_thermometers(void) +{ + std::fprintf(stdout, "number_of_thermometers not implemented. See https://github.com/start-jsk/rtmros_hironx/pull/481\n"); + return 0; +} + +/** + * @brief Needed for hrpsys 315.4.0 onward (added at https://github.com/fkanehiro/hrpsys-base/pull/598). + * TODO Implement if we want to utilize this. + */ +int number_of_batteries(void) +{ + std::fprintf(stdout, "number_of_batteries not implemented. See https://github.com/start-jsk/rtmros_hironx/pull/481\n"); + return 0; +} + +/** + * @brief Needed for hrpsys 315.4.0 onward (added at https://github.com/fkanehiro/hrpsys-base/pull/598). + * TODO Implement if we want to utilize this. + */ +int read_battery(char *battery) +{ + std::fprintf(stdout, "read_battery not implemented. See https://github.com/start-jsk/rtmros_hironx/pull/481\n"); + return 0; +} ++#endif diff --git a/hironx_ros_bridge/robot/hrpiob/nextage-open.hpp b/hironx_ros_bridge/robot/hrpiob/nextage-open.hpp index 2e9a434d..6631bba2 100644 --- a/hironx_ros_bridge/robot/hrpiob/nextage-open.hpp +++ b/hironx_ros_bridge/robot/hrpiob/nextage-open.hpp @@ -60,7 +60,6 @@ namespace NEXTAGE_OPEN virtual int wait_for_iob_signal(void) = 0; virtual long get_signal_period(void) = 0; - virtual int initializeJointAngle(const char *name, const char *option) = 0; virtual int read_digital_input(char *dIn) = 0; virtual int length_digital_input(void) = 0;