Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hrpiob] Upgrade for hrpsys 315.4.0 onward. #481

Open
wants to merge 4 commits into
base: indigo-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 6 additions & 1 deletion hironx_ros_bridge/robot/hrpiob/nextage-open.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,19 @@ 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;
virtual int write_digital_output(const char *doutput) = 0;
virtual int write_digital_output_with_mask(const char *doutput, const char *mask) = 0;
virtual int length_digital_output(void) = 0;
virtual int read_digital_output(char *doutput) = 0;

#if defined(ROBOT_IOB_VERSION) && ROBOT_IOB_VERSION >= 2
virtual int number_of_thermometers(void) = 0;
virtual int number_of_batteries(void) = 0;
virtual int read_battery(char *battery) = 0;
#endif
};

}
Expand Down
12 changes: 12 additions & 0 deletions hironx_ros_bridge/robot/hrpiob/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<package format="2">
<name>hrpiob</name>
<version>1.0.1</version>
<description>Hardware I/O interface definition for hrpsys-based robots specific to Kawada's NEXTAGE robot.
</description>
<author>Kawada Industries Inc.</author>
<author>Kawada Robotics Corporation</author>
<maintainer email="[email protected]">TORK</maintainer>
<license>CC BY-NC 4.0</license>
<buildtool_depend>cmake</buildtool_depend>
<depend>hrpsys</depend>
</package>