Skip to content

Commit

Permalink
[hrpiob] Upgrade for hrpsys 315.4.0 onward.
Browse files Browse the repository at this point in the history
  • Loading branch information
130s committed Jan 11, 2017
1 parent f3b8657 commit 26ec16b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
13 changes: 12 additions & 1 deletion hironx_ros_bridge/robot/hrpiob/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
32 changes: 32 additions & 0 deletions hironx_ros_bridge/robot/hrpiob/iob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion hironx_ros_bridge/robot/hrpiob/nextage-open.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 26ec16b

Please sign in to comment.