Skip to content

Commit

Permalink
added a virtual camera component
Browse files Browse the repository at this point in the history
git-svn-id: https://hrpsys-base.googlecode.com/svn/trunk@100 a991ac11-fb38-5095-8c12-a1ddb0715245
  • Loading branch information
fkanehiro committed Mar 28, 2012
1 parent 5af553b commit 1f301bd
Show file tree
Hide file tree
Showing 29 changed files with 2,007 additions and 41 deletions.
1 change: 1 addition & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set(input_files package.h
../rtc/Simulator/Simulator.txt
../rtc/StateHolder/StateHolder.txt
../rtc/Viewer/Viewer.txt
../rtc/VirtualCamera/VirtualCamera.txt
../rtc/WavPlayer/WavPlayer.txt
../hrplib/hrpIo/iob.h
../idl/DataLoggerService.idl
Expand Down
1 change: 1 addition & 0 deletions doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ INPUT = @CMAKE_CURRENT_SOURCE_DIR@/package.h \
@CMAKE_CURRENT_SOURCE_DIR@/../rtc/StateHolder \
@CMAKE_CURRENT_SOURCE_DIR@/../rtc/VideoCapture \
@CMAKE_CURRENT_SOURCE_DIR@/../rtc/Viewer \
@CMAKE_CURRENT_SOURCE_DIR@/../rtc/VirtualCamera \
@CMAKE_CURRENT_SOURCE_DIR@/../rtc/WavPlayer \
@CMAKE_CURRENT_SOURCE_DIR@/../hrplib/hrpIo/iob.h \
@CMAKE_CURRENT_SOURCE_DIR@/../idl \
Expand Down
1 change: 1 addition & 0 deletions doc/package.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ To use jython scripts to create RT components, connect ports and get/set propert
<li>\ref StateHolder</li>
<li>\ref Viewer</li>
<li>\ref VideoCapture</li>
<li>\ref VirtualCamera</li>
<li>\ref WavPlayer</li>
</ul>
<li>Services provided by basic RT components</li>
Expand Down
33 changes: 5 additions & 28 deletions rtc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
set(idl_flags -bcxx -Wbuse_quotes -Wbh=.hh -Wbs=Sk.cpp -Wba -Wbd=DynSk.cpp -I${OPENRTM_IDL_DIR})
set(package_path OpenHRP)

macro(generate_stub_skel idl_basename)
macro(generate_stub_skel idl_basename package_path)

set(idl_file ${CMAKE_CURRENT_SOURCE_DIR}/../../idl/${idl_basename}.idl)
set(jarfile ${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}.jar)
Expand All @@ -26,32 +25,6 @@ macro(generate_stub_skel idl_basename)

endmacro()

macro(generate_stub_skel_pkg idl_basename package_path)

set(idl_file ${CMAKE_CURRENT_SOURCE_DIR}/../../idl/${idl_basename}.idl)
set(jarfile ${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}.jar)

add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}.hh ${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}Sk.cpp ${CMAKE_CURRENT_BINARY_DIR}/${idl_basename}DynSk.cpp ${jarfile} #${CMAKE_CURRENT_BINARY_DIR}/../../python/${idl_basename}_idl.py
COMMAND omniidl ${idl_flags} ${idl_file}
# COMMAND omniidl -bpython -C../../python ${idl_file}
COMMAND ${IDLJ} ${idlj_flags} -I${OPENRTM_IDL_DIR} ${idl_file}
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/cls
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/cls/${package_path}
COMMAND ${JAVAC} ${javac_flags} src/${package_path}*.java
COMMAND ${JAR} cf ${jarfile} -C ${CMAKE_CURRENT_BINARY_DIR}/cls ${package_path}.
DEPENDS ${idl_file}
)

include_directories(${CMAKE_CURRENT_BINARY_DIR})

install(FILES ${jarfile} DESTINATION share/hrpsys/jar)
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../python/${idl_basename}_idl.py DESTINATION share/python)
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../python/OpenHRP/__init__.py DESTINATION share/python/OpenHRP)
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../../python/OpenHRP__POA/__init__.py DESTINATION share/python/OpenHRP__POA)

endmacro()

add_subdirectory(NullComponent)
add_subdirectory(RobotHardware)
add_subdirectory(StateHolder)
Expand Down Expand Up @@ -91,3 +64,7 @@ find_package(QuickHull)
if (QHULL_FOUND AND IRRLICHT_FOUND)
add_subdirectory(CollisionDetector)
endif()

if (IRRLICHT_FOUND AND RTCPCL_FOUND AND LIBXML2_FOUND)
add_subdirectory(VirtualCamera)
endif()
2 changes: 1 addition & 1 deletion rtc/DataLogger/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generate_stub_skel(DataLoggerService)
generate_stub_skel(DataLoggerService "OpenHRP")

set(comp_sources DataLogger.cpp DataLoggerService_impl.cpp DataLoggerServiceSk.cpp )
add_library(DataLogger SHARED ${comp_sources})
Expand Down
2 changes: 1 addition & 1 deletion rtc/ForwardKinematics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generate_stub_skel(ForwardKinematicsService)
generate_stub_skel(ForwardKinematicsService "OpenHRP")

set(comp_sources ForwardKinematics.cpp ForwardKinematicsServiceSk.cpp ForwardKinematicsService_impl.cpp)
add_library(ForwardKinematics SHARED ${comp_sources})
Expand Down
2 changes: 1 addition & 1 deletion rtc/JpegDecoder/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generate_stub_skel_pkg(Img "Img/")
generate_stub_skel(Img "Img")

find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
Expand Down
2 changes: 1 addition & 1 deletion rtc/NullComponent/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generate_stub_skel(NullService)
generate_stub_skel(NullService "OpenHRP")

set(comp_sources NullComponent.cpp NullServiceSk.cpp NullService_impl.cpp)
add_library(NullComponent SHARED ${comp_sources})
Expand Down
2 changes: 1 addition & 1 deletion rtc/OccupancyGridMap3D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include_directories(${OCTOMAP_INCLUDE_DIR})
link_directories(${OCTOMAP_DIR}/lib)


generate_stub_skel(OGMap3DService)
generate_stub_skel(OGMap3DService "OpenHRP")

set(comp_sources OccupancyGridMap3D.cpp OGMap3DService_impl.cpp OGMap3DServiceSk.cpp)
add_library(OccupancyGridMap3D SHARED ${comp_sources})
Expand Down
2 changes: 1 addition & 1 deletion rtc/RobotHardware/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generate_stub_skel(RobotHardwareService)
generate_stub_skel(RobotHardwareService "OpenHRP")

set(comp_source robot.cpp RobotHardware.cpp RobotHardwareService_impl.cpp RobotHardwareServiceSk.cpp)
add_library(RobotHardware SHARED ${comp_source} )
Expand Down
2 changes: 1 addition & 1 deletion rtc/SequencePlayer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generate_stub_skel(SequencePlayerService)
generate_stub_skel(SequencePlayerService "OpenHRP")

set(comp_sources interpolator.cpp timeUtil.cpp seqplay.cpp SequencePlayer.cpp SequencePlayerService_impl.cpp SequencePlayerServiceSk.cpp )
add_library(SequencePlayer SHARED ${comp_sources})
Expand Down
2 changes: 1 addition & 1 deletion rtc/Simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generate_stub_skel(HRPDataTypes)
generate_stub_skel(HRPDataTypes "OpenHRP")

set(comp_sources Simulator.cpp Project.cpp RTCBody.cpp HRPDataTypesSk.cpp HRPDataTypesDynSk.cpp)
include_directories(${LIBXML2_INCLUDE_DIR})
Expand Down
4 changes: 2 additions & 2 deletions rtc/StateHolder/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
generate_stub_skel(StateHolderService)
generate_stub_skel(TimeKeeperService)
generate_stub_skel(StateHolderService "OpenHRP")
generate_stub_skel(TimeKeeperService "OpenHRP")

set(comp_sources StateHolder.cpp StateHolderService_impl.cpp StateHolderServiceSk.cpp TimeKeeperService_impl.cpp TimeKeeperServiceSk.cpp)
add_library(StateHolder SHARED ${comp_sources})
Expand Down
2 changes: 1 addition & 1 deletion rtc/VideoCapture/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generate_stub_skel_pkg(Img "Img/")
generate_stub_skel(Img "Img")

find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
Expand Down
2 changes: 1 addition & 1 deletion rtc/Viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
generate_stub_skel(HRPDataTypes)
generate_stub_skel(HRPDataTypes "OpenHRP")

set(comp_sources Viewer.cpp IrrModel.cpp Project.cpp RTCGLbody.cpp HRPDataTypesSk.cpp HRPDataTypesDynSk.cpp)
include_directories(${LIBXML2_INCLUDE_DIR})
Expand Down
1 change: 1 addition & 0 deletions rtc/Viewer/Viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ RTC::ReturnCode_t Viewer::onExecute(RTC::UniqueId ec_id)
}
}
}

for (std::map<std::string, RTCGLbody *>::iterator it=m_bodies.begin();
it != m_bodies.end(); it++){
it->second->input();
Expand Down
23 changes: 23 additions & 0 deletions rtc/VirtualCamera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
generate_stub_skel(Img "Img/")
generate_stub_skel(HRPDataTypes "OpenHRP")

find_package(OpenGL REQUIRED)
find_package(OpenCV REQUIRED)

include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${LIBXML2_INCLUDE_DIR})
set(comp_sources VirtualCamera.cpp IrrModel.cpp Project.cpp ImgSk.cpp ImgDynSk.cpp HRPDataTypesSk.cpp HRPDataTypesDynSk.cpp RTCGLbody.cpp)

add_library(VirtualCamera SHARED ${comp_sources})
target_link_libraries(VirtualCamera ${OPENHRP_LIBRARIES} ${OPENGL_LIBRARIES} ${IRRLICHT_LIBRARIES} ${OpenCV_LIBRARIES} ${LIBXML2_LIBRARIES} rtcpcl_pointcloud_type)
set_target_properties(VirtualCamera PROPERTIES PREFIX "")

add_executable(VirtualCameraComp VirtualCameraComp.cpp ${comp_sources})
target_link_libraries(VirtualCameraComp ${OPENHRP_LIBRARIES} ${OPENGL_LIBRARIES} ${IRRLICHT_LIBRARIES} ${OpenCV_LIBRARIES} ${LIBXML2_LIBRARIES} rtcpcl_pointcloud_type)

set(target VirtualCamera VirtualCameraComp)

install(TARGETS ${target}
RUNTIME DESTINATION bin CONFIGURATIONS Release Debug
LIBRARY DESTINATION lib CONFIGURATIONS Release Debug
)
Loading

0 comments on commit 1f301bd

Please sign in to comment.