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

Fix for oldubuntu compile #854

Merged
merged 2 commits into from
Oct 12, 2015
Merged
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
5 changes: 4 additions & 1 deletion python/rtm.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ def getManagerDirectly(hostname, mgr=None):
mgr = None
return mgr

import CORBA
try:
import CORBA
except:
print('import CORBA failed in findRTCmanager and neglect it for old python environment.')
# fqdn
mgr = None
hostnames = [hostname, hostname.split(".")[0],
Expand Down
15 changes: 15 additions & 0 deletions rtc/ServoController/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
set(comp_sources ServoController.cpp ServoControllerService_impl.cpp)
set(libs hrpModel-3.1 hrpCollision-3.1 hrpUtil-3.1 hrpsysBaseStub)
if (CMAKE_COMPILER_IS_GNUCC)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS
${GCC_VERSION})
list(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR)
list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR)
if (GCC_VERSION VERSION_LESS 4.3)
message(STATUS "GCC version (${GCC_MAJOR}.${GCC_MINOR}) must be at least 4.3 for binary format in ServoSerial.h!")
# else()
# message(STATUS "HOGE GCC version must be at least 4.3 for binary format in ServoSerial.h! ${GCC_MAJOR} ${GCC_MINOR}")
endif()
add_definitions(-DDONOT_USE_BINARY_FORMAT)
endif()

add_library(ServoController SHARED ${comp_sources})
target_link_libraries(ServoController ${libs})
set_target_properties(ServoController PROPERTIES PREFIX "")
Expand Down
16 changes: 16 additions & 0 deletions rtc/ServoController/ServoSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,22 +290,38 @@ class ServoSerial {
ret = -1;
}

#ifdef DONOT_USE_BINARY_FORMAT
if ( flags & 0x0002 ) {
#else
if ( flags & 0b00000010 ) {
#endif
fprintf(stderr, "[ServoSerial] Failed to receive packet from servo(id:%d) Fail to process received packet\n", id);
ret = -1;
}

#ifdef DONOT_USE_BINARY_FORMAT
if ( flags & 0x0008 ) {
#else
if ( flags & 0b00001000 ) {
#endif
fprintf(stderr, "[ServoSerial] Failed to receive packet from servo(id:%d) fail to write Flash ROM\n", id);
ret = -1;
}

#ifdef DONOT_USE_BINARY_FORMAT
if ( flags & 0x0020 ) {
#else
if ( flags & 0b00100000 ) {
#endif
fprintf(stderr, "[ServoSerial] Failed to receive packet from servo(id:%d) temperature limit warning\n", id);
ret = -1;
}

#ifdef DONOT_USE_BINARY_FORMAT
if ( flags & 0x0080 ) {
#else
if ( flags & 0b10000000 ) {
#endif
fprintf(stderr, "[ServoSerial] Failed to receive packet from servo(id:%d) Temperature limit error\n", id);
ret = -1;
}
Expand Down