Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ishiguroJSK committed Aug 29, 2019
2 parents 6f6e5d1 + b24e954 commit 6fc8b35
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 22 deletions.
8 changes: 8 additions & 0 deletions .travis.rosinstall.kinetic
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- git:
uri: https://github.com/tork-a/openhrp3-release
version: release/kinetic/openhrp3
local-name: openhrp3
- git:
uri: https://github.com/tork-a/hrpsys-release
version: release/kinetic/hrpsys
local-name: hrpsys
17 changes: 17 additions & 0 deletions .travis.rosinstall.melodic
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- git:
uri: https://github.com/tork-a/openhrp3-release
version: release/kinetic/openhrp3
local-name: openhrp3
- git:
uri: https://github.com/fkanehiro/hrpsys-base
version: master
local-name: hrpsys
- git:
uri: https://github.com/tork-a/rtshell-release
local-name: rtshell
- git:
uri: https://github.com/tork-a/rtsprofile-release
local-name: rtsprofile
- git:
uri: https://github.com/tork-a/rtctree-release
local-name: rtctree
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@ env:
- USE_TRAVIS=true ROS_DISTRO=indigo USE_DEB=false NOT_TEST_INSTALL=true
- USE_TRAVIS=true ROS_DISTRO=indigo USE_DEB=true EXTRA_DEB="ros-indigo-hrpsys-ros-bridge ros-indigo-pr2eus" CATKIN_PARALLEL_JOBS='-p4' NOT_TEST_INSTALL=true IS_EUSLISP_TRAVIS_TEST="true"
- USE_JENKINS=true ROS_DISTRO=indigo USE_DEB=false EXTRA_DEB="ros-indigo-hrpsys-ros-bridge ros-indigo-pr2eus" ROS_PARALLEL_JOBS="-j1 -l1" NOT_TEST_INSTALL=true IS_EUSLISP_TRAVIS_TEST="true"
- USE_TRAVIS=true ROS_DISTRO=jade USE_DEB=true
- USE_TRAVIS=true TEST_TYPE=work_with_downstream TEST_PACKAGE=hironx-ros-bridge ROS_DISTRO=indigo EXTRA_DEB="ros-indigo-roslint"
- USE_TRAVIS=true TEST_TYPE=work_with_315_1_10 TEST_PACKAGE=hironx-ros-bridge ROS_DISTRO=indigo EXTRA_DEB="ros-indigo-roslint"
- USE_TRAVIS=true TEST_TYPE=work_with_downstream TEST_PACKAGE=hironx-ros-bridge ROS_DISTRO=jade EXTRA_DEB="ros-jade-roslint"
- USE_TRAVIS=true TEST_TYPE=work_with_315_1_10 TEST_PACKAGE=hironx-ros-bridge ROS_DISTRO=jade EXTRA_DEB="ros-jade-roslint"
- USE_JENKINS=true ROS_DISTRO=hydro USE_DEB=true EXTRA_DEB="ros-hydro-pr2eus"
- USE_JENKINS=true ROS_DISTRO=kinetic USE_DEB=true
- USE_JENKINS=true ROS_DISTRO=kinetic USE_DEB=false NOT_TEST_INSTALL=true
- USE_JENKINS=true ROS_DISTRO=melodic USE_DEB=true
- USE_JENKINS=true ROS_DISTRO=melodic USE_DEB=false NOT_TEST_INSTALL=true BEFORE_SCRIPT="pwd; sed -i \"35iadd_definitions(-Wno-deprecated)\" hrpsys/CMakeLists.txt openhrp3/CMakeLists.txt; (cd hrpsys; git diff)"
matrix:
allow_failures:
- env: USE_TRAVIS=true ROS_DISTRO=indigo USE_DEB=true EXTRA_DEB="ros-indigo-hrpsys-ros-bridge ros-indigo-pr2eus" CATKIN_PARALLEL_JOBS='-p4' NOT_TEST_INSTALL=true IS_EUSLISP_TRAVIS_TEST="true"
- env: USE_TRAVIS=true TEST_TYPE=work_with_downstream TEST_PACKAGE=hironx-ros-bridge ROS_DISTRO=jade EXTRA_DEB="ros-jade-roslint"
- env: USE_TRAVIS=true TEST_TYPE=work_with_315_1_10 TEST_PACKAGE=hironx-ros-bridge ROS_DISTRO=jade EXTRA_DEB="ros-jade-roslint"
- env: USE_JENKINS=true ROS_DISTRO=melodic USE_DEB=true
notifications:
email:
recipients:
Expand Down
1 change: 1 addition & 0 deletions .travis_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
sudo sh -c 'echo "deb http://packages.ros.org/ros-shadow-fixed/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update -qq
sudo apt-get install -y --force-yes -q -qq dpkg # https://github.com/travis-ci/travis-ci/issues/9361#issuecomment-408431262 dpkg-deb: error: archive has premature member 'control.tar.xz' before 'control.tar.gz' #9361
sudo apt-get install -qq -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin ros-$ROS_DISTRO-rosbash

if [ "$EXTRA_DEB" ]; then sudo apt-get install -qq -y $EXTRA_DEB; fi
Expand Down
19 changes: 19 additions & 0 deletions hrpsys_tools/test/test-pa10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python

import rostest, unittest, sys, os

import time
#time.sleep(10) # wait for launch

vars(__builtins__).update({'__IPYTHON__': "fake python as ipython to not to drop in shell"})
class TestInteractive(unittest.TestCase):
def test(self):
local_dict = locals() # https://stackoverflow.com/questions/34780235/pythons-execfile-variable-scope-issue
execfile(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../scripts", "hrpsys_tools_config.py"), globals(), local_dict)
hcf = local_dict['hcf']
hcf.setJointAngles([10,10,10,10,10,10,10,10,10], 1)
print hcf.getJointAngles()
self.assertTrue("OK")

if __name__ == '__main__':
rostest.rosrun("hrpsys_tools", "test_interactive", TestInteractive, sys.argv)
6 changes: 3 additions & 3 deletions hrpsys_tools/test/test-pa10.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<!-- need time.sleep(1): need this code for waiting for all component in serialization is actually activated.... -->
<test test-name="hrpsys_tool_config_interactive" pkg="hrpsys_tools"
type="hrpsys_tools_config.py" args='--host 127.0.0.1 --port 2809 -i PA10Controller\(Robot\)0 -c "import rostest, unittest" "import time" "time.sleep(10)" "hcf.setJointAngles([10,10,10,10,10,10,10,10,10], 1)" "print hcf.getJointAngles()" "rostest.rosrun(\"hrpsys_tools\", \"test_interactive\", unittest.TestCase)" "quit()"'
retry="4" />
type="test-pa10.py" args='--host 127.0.0.1 --port 2809 -i PA10Controller\(Robot\)0 -i'
retry="10" />

</launch>
</launch>
25 changes: 21 additions & 4 deletions rtmbuild/cmake/rtmbuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ macro(rtmbuild_init)
pkg_check_modules(rtmbuild rtmbuild REQUIRED)
set(idl2srv_EXECUTABLE ${rtmbuild_PREFIX}/share/rtmbuild/scripts/idl2srv.py)
endif()
# on melodic (18.04) omnniorb requries python3
if($ENV{ROS_DISTRO} STRGREATER "lunar")
set(idl2srv_EXECUTABLE "python3;${idl2srv_EXECUTABLE}")
endif()
message("[rtmbuild_init] - idl2srv_EXECUTABLE -> ${idl2srv_EXECUTABLE}")

execute_process(COMMAND pkg-config openrtm-aist --variable=prefix OUTPUT_VARIABLE rtm_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand Down Expand Up @@ -133,10 +137,15 @@ macro(rtmbuild_init)
rosbuild_gensrv()
endif()

# include_directories(${catkin_INCLUDE_DIRS} ${openrtm_aist_INCLUDE_DIRS} ${openhrp3_INCLUDE_DIRS})
# link_directories(${catkin_LIBRARY_DIRS} ${openrtm_aist_LIBRARY_DIRS} ${openhrp3_LIBRARY_DIRS})
include_directories( ${openhrp3_INCLUDE_DIRS} ${openrtm_aist_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
link_directories( ${openhrp3_LIBRARY_DIRS} ${openrtm_aist_LIBRARY_DIRS} ${catkin_LIBRARY_DIRS})
include_directories(${catkin_INCLUDE_DIRS} ${openrtm_aist_INCLUDE_DIRS} ${openhrp3_INCLUDE_DIRS})
# since catkin > 0.7.0, the CPATH is no longer being set by catkin, so rtmbuild manually add them
set(_cmake_prefix_path_tmp $ENV{CMAKE_PREFIX_PATH})
string(REPLACE ":" ";" _cmake_prefix_path_tmp ${_cmake_prefix_path_tmp})
foreach(_cmake_prefix_path ${_cmake_prefix_path_tmp})
include_directories(${_cmake_prefix_path}/include)
endforeach()

link_directories(${catkin_LIBRARY_DIRS} ${openrtm_aist_LIBRARY_DIRS} ${openhrp3_LIBRARY_DIRS})

endmacro(rtmbuild_init)

Expand Down Expand Up @@ -290,6 +299,14 @@ macro(rtmbuild_add_executable exe)
else()
rosbuild_add_executable(${ARGV})
endif()
## disable -Wdeprecated to shorten the log data
## ^~~~~
## /opt/ros/melodic/include/openrtm-1.1/rtm/PeriodicExecutionContext.h:633:7: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
## throw (CORBA::SystemException);
## ^~~~~
## The job exceeded the maximum log length, and has been terminated.
set_target_properties(${exe} PROPERTIES COMPILE_FLAGS "-Wno-deprecated")
##
add_dependencies(${exe} RTMBUILD_${PROJECT_NAME}_genbridge ${${_package}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} )
#target_link_libraries(${exe} ${catkin_LIBRARIES} ${openrtm_aist_LIBRARIES} ${openhrp3_LIBRARIES} ${${PROJECT_NAME}_IDLLIBRARY_DIRS} )
target_link_libraries(${exe} ${openhrp3_LIBRARIES} ${${PROJECT_NAME}_IDLLIBRARY_DIRS} ${openrtm_aist_LIBRARIES} ${catkin_LIBRARIES} )
Expand Down
28 changes: 19 additions & 9 deletions rtmbuild/scripts/idl2srv.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/usr/bin/env python

from __future__ import print_function

from optparse import OptionParser
import os, os.path, sys, string, re

if sys.version_info[0] >= 3:
from functools import reduce # python3

# resolve library path, copied from omniidl (ubuntu 11.10)
# Try a path based on the installation prefix, customised for Debian
sppath = "/usr/lib/omniidl"
Expand Down Expand Up @@ -283,15 +288,15 @@ def outputMsg(self, typ):
msgfile = basedir + "/msg/" + self.getCppTypeText(typ,full=ROS_FULL) + ".msg"
if not os.path.exists(basedir):
return
print msgfile
print(msgfile)
if options.filenames:
return

if os.path.exists(msgfile) and (os.stat(msgfile).st_mtime > os.stat(idlfile).st_mtime) and not options.overwrite:
return # do not overwrite

os.system('mkdir -p %s/msg' % basedir)
print >>sys.stderr,"[idl2srv] writing "+msgfile+"...."
print("[idl2srv] writing "+msgfile+"....", file=sys.stderr)
fd = open(msgfile, 'w')
if isinstance(typ, idlast.Enum):
for val in typ.enumerators():
Expand All @@ -311,7 +316,7 @@ def outputSrv(self, op):
srvfile = basedir + "/srv/" + self.getCppTypeText(op,full=ROS_FULL) + ".srv"
if not os.path.exists(basedir):
return
print srvfile
print(srvfile)
if options.filenames:
return

Expand All @@ -320,7 +325,7 @@ def outputSrv(self, op):
os.system('mkdir -p %s/srv' % basedir)
args = op.parameters()

print >>sys.stderr, "[idl2srv] writing "+srvfile+"...."
print("[idl2srv] writing "+srvfile+"....", file=sys.stderr)
fd = open(srvfile, 'w')
for arg in [arg for arg in args if arg.is_in()]:
fd.write("%s %s\n" % (self.getROSTypeText(arg.paramType()), arg.identifier()))
Expand Down Expand Up @@ -468,9 +473,9 @@ def genBridgeComponent(self, interface):
Comp_cpp = wd + '/' + module_name + 'Comp.cpp'
mod_cpp = wd + '/' + module_name + '.cpp'
mod_h = wd + '/' + module_name + '.h'
print Comp_cpp
print mod_cpp
print mod_h
print(Comp_cpp)
print(mod_cpp)
print(mod_h)
if options.filenames:
return

Expand All @@ -480,8 +485,13 @@ def genBridgeComponent(self, interface):
# check if rtc-template exists under `rospack find openrtm_aist`/bin, otherwise use openrtm_aist_PREFIX/lib/openrtm_aist/bin
from subprocess import check_output, Popen, PIPE
openrtm_path = Popen(['rospack','find','openrtm_aist'], stdout=PIPE).communicate()[0].rstrip() # use Popen, not check_output, since catkin_make can not found rospack find
if not isinstance(openrtm_path, str):
openrtm_path = openrtm_path.decode('ascii')
if not os.path.exists(os.path.join(openrtm_path, "bin")) :
openrtm_path = os.path.join(check_output(['pkg-config','openrtm-aist','--variable=prefix']).rstrip(),"lib/openrtm_aist")
openrtm_prefix = check_output(['pkg-config','openrtm-aist','--variable=prefix']).rstrip()
if not isinstance(openrtm_prefix, str):
openrtm_prefix = openrtm_prefix.decode('ascii')
openrtm_path = os.path.join(openrtm_prefix,"lib/openrtm_aist")
command = "PATH=%s/bin:$PATH rtc-template -bcxx --module-name=%s --consumer=%s:service0:'%s' --consumer-idl=%s --idl-include=%s" % (openrtm_path, module_name, service_name, service_name, idlfile, idldir)
#command = "rosrun openrtm_aist rtc-template -bcxx --module-name=%s --consumer=%s:service0:'%s' --consumer-idl=%s --idl-include=%s" % (module_name, service_name, service_name, idlfile, idldir)
os.system("mkdir -p %s" % tmpdir)
Expand Down Expand Up @@ -645,7 +655,7 @@ def visitModule(self, node):
n.accept(self)
def visitInterface(self, node):
if node.mainFile():
print node.identifier()
print(node.identifier())
if options.interfaces:
pass

Expand Down

0 comments on commit 6fc8b35

Please sign in to comment.