Skip to content

Commit e057da2

Browse files
committed
Stackification (#150)
* uimacpp_ros, robosherlock_msgs, rapidjson_ros part of a stack now;
1 parent 9e86671 commit e057da2

File tree

703 files changed

+133359
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

703 files changed

+133359
-90
lines changed

.gitignore

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
cmake/robosherlock_config.cmake
2-
cmake/robosherlock.cmake
3-
data
4-
scripts/.*.modified
5-
scripts/*.pyc
6-
src/core/include/rs/types/*.h
7-
descriptors/typesystem/all_types.xml
1+
robosherlock/cmake/robosherlock_config.cmake
2+
robosherlock/cmake/robosherlock.cmake
3+
robosherlock/data
4+
robosherlock/scripts/.*.modified
5+
robosherlock/scripts/*.pyc
6+
robosherlock/src/core/include/rs/types/*.h
7+
robosherlock/descriptors/typesystem/all_types.xml

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "rapidjson_ros/include/rapidjson"]
2+
path = rapidjson_ros/include/rapidjson
3+
url = https://github.com/Tencent/rapidjson.git

.travis.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ env:
2727
before_install:
2828
- sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
2929
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
30-
- sudo add-apt-repository ppa:robosherlock/ppa -y
3130
- sudo apt-get update -qq
32-
- sudo apt-get install -y python-catkin-pkg python-rosdep python-wstool ros-kinetic-catkin ros-kinetic-libmongocxx-ros libxerces-c-dev libapr1-dev mongodb protobuf-compiler rapidjson lcov --force-yes
31+
- sudo apt-get install -y python-catkin-pkg python-rosdep python-wstool ros-kinetic-catkin ros-kinetic-libmongocxx-ros libxerces-c-dev libapr1-dev mongodb protobuf-compiler lcov --force-yes
3332
- source /opt/ros/$ROS_DISTRO/setup.bash
3433
- sudo rosdep init
3534
- rosdep update
@@ -49,9 +48,6 @@ install:
4948
- ln -s $CI_SOURCE_PATH .
5049

5150
before_script:
52-
- cd ~/catkin_ws/src
53-
- git clone https://github.com/RoboSherlock/robosherlock_msgs.git
54-
- git clone https://github.com/RoboSherlock/uimacpp_ros.git
5551
- cd ~/catkin_ws
5652
- rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
5753
- echo "export APR_HOME=/usr" >> ~/.bashrc
@@ -63,7 +59,7 @@ before_script:
6359
script:
6460
- cd ~/catkin_ws
6561
- source devel/setup.bash
66-
- find -L /home/travis/catkin_ws/src/robosherlock -name include -type d
62+
- find -L /home/travis/catkin_ws/src/robosherlock/robosherlock -name include -type d
6763
- catkin_make "$( [ -f $CATKIN_OPTIONS ] && cat $CATKIN_OPTIONS )"
6864
- source devel/setup.bash
6965
- cd ~/catkin_ws/src/robosherlock

rapidjson_ros/CMakeLists.txt

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(rapidjson_ros)
3+
4+
## Compile as C++11, supported in ROS Kinetic and newer
5+
add_compile_options(-std=c++11)
6+
7+
find_package(catkin REQUIRED)
8+
9+
###################################
10+
## catkin specific configuration ##
11+
###################################
12+
## The catkin_package macro generates cmake config files for your package
13+
## Declare things to be passed to dependent projects
14+
## INCLUDE_DIRS: uncomment this if your package contains header files
15+
## LIBRARIES: libraries you create in this project that dependent projects also need
16+
## CATKIN_DEPENDS: catkin_packages dependent projects also need
17+
## DEPENDS: system dependencies of this project that dependent projects also need
18+
19+
add_definitions(-DRAPIDJSON_HAS_STDSTRING)
20+
catkin_package(
21+
INCLUDE_DIRS include/rapidjson/include
22+
# LIBRARIES rapidjson_ros
23+
# CATKIN_DEPENDS other_catkin_pkg
24+
# DEPENDS system_lib
25+
)
26+
27+
###########
28+
## Build ##
29+
###########
30+
31+
## Specify additional locations of header files
32+
## Your package locations should be listed before other locations
33+
include_directories(
34+
include/rapidjson/include
35+
)
36+
37+
## Declare a C++ library
38+
# add_library(${PROJECT_NAME}
39+
# src/${PROJECT_NAME}/rapidjson_ros.cpp
40+
# )
41+
42+
## Add cmake target dependencies of the library
43+
## as an example, code may need to be generated before libraries
44+
## either from message generation or dynamic reconfigure
45+
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
46+
47+
## Declare a C++ executable
48+
## With catkin_make all packages are built within a single CMake context
49+
## The recommended prefix ensures that target names across packages don't collide
50+
# add_executable(${PROJECT_NAME}_node src/rapidjson_ros_node.cpp)
51+
52+
## Rename C++ executable without prefix
53+
## The above recommended prefix causes long target names, the following renames the
54+
## target back to the shorter version for ease of user use
55+
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
56+
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
57+
58+
## Add cmake target dependencies of the executable
59+
## same as for the library above
60+
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
61+
62+
## Specify libraries to link a library or executable target against
63+
# target_link_libraries(${PROJECT_NAME}_node
64+
# ${catkin_LIBRARIES}
65+
# )
66+
67+
#############
68+
## Install ##
69+
#############
70+
71+
# all install targets should use catkin DESTINATION variables
72+
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
73+
74+
## Mark executable scripts (Python etc.) for installation
75+
## in contrast to setup.py, you can choose the destination
76+
# install(PROGRAMS
77+
# scripts/my_python_script
78+
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
79+
# )
80+
81+
## Mark executables and/or libraries for installation
82+
# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
83+
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
84+
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
85+
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
86+
# )
87+
88+
## Mark cpp header files for installation
89+
# install(DIRECTORY include/${PROJECT_NAME}/
90+
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
91+
# FILES_MATCHING PATTERN "*.h"
92+
# PATTERN ".svn" EXCLUDE
93+
# )
94+
95+
## Mark other files for installation (e.g. launch and bag files, etc.)
96+
# install(FILES
97+
# # myfile1
98+
# # myfile2
99+
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
100+
# )
101+
102+
#############
103+
## Testing ##
104+
#############
105+
106+
## Add gtest based cpp test target and link libraries
107+
# catkin_add_gtest(${PROJECT_NAME}-test test/test_rapidjson_ros.cpp)
108+
# if(TARGET ${PROJECT_NAME}-test)
109+
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
110+
# endif()
111+
112+
## Add folders to be run by python nosetests
113+
# catkin_add_nosetests(test)

rapidjson_ros/include/rapidjson

Submodule rapidjson added at f54b0e4

rapidjson_ros/package.xml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<package format="2">
3+
<name>rapidjson_ros</name>
4+
<version>0.0.1</version>
5+
<description>The rapidjson_ros package; Wrapping rapidjson lib for Ubuntu 16.04/ROS Xenial</description>
6+
7+
<maintainer email="[email protected]">Ferenc Balint-Benczedi</maintainer>
8+
9+
<license>TODO</license>
10+
11+
<buildtool_depend>catkin</buildtool_depend>
12+
<build_depend>roscpp</build_depend>
13+
14+
<export>
15+
<!-- Other tools can request additional information be placed here -->
16+
17+
</export>
18+
</package>

CMakeLists.txt robosherlock/CMakeLists.txt

+6-17
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ find_package(catkin REQUIRED
5555
visualization_msgs cv_bridge image_transport
5656
image_geometry message_filters resource_retriever
5757
robosherlock_msgs std_srvs libmongocxx_ros
58-
uimacpp_ros)
58+
uimacpp_ros rapidjson_ros)
5959

6060

6161
find_package(Eigen3 QUIET)
@@ -104,10 +104,10 @@ if(PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE)
104104
set(RS_WEB_LIB rs_web)
105105
endif()
106106

107-
find_package(RapidJSON REQUIRED)
108-
if(${RapidJSON_FOUND})
109-
add_definitions(-DWITH_JSON -DRAPIDJSON_HAS_STDSTRING)
110-
endif()
107+
#find_package(RapidJSON REQUIRED)
108+
#if(${RapidJSON_FOUND})
109+
add_definitions(-DRAPIDJSON_HAS_STDSTRING)
110+
#endif()
111111

112112
find_package(json_prolog QUIET)
113113
option(WITH_JSON_PROLOG "build using json prolog" False)
@@ -134,7 +134,6 @@ endif()
134134
## CMake variables ##
135135
################################################################################
136136

137-
add_definitions(-DDB_SCRIPTS_DIR="${PROJECT_SOURCE_DIR}/scripts/mongodb/")
138137
add_definitions(${PCL_DEFINITIONS})
139138

140139
################################################################################
@@ -157,7 +156,7 @@ set(RS_LIBS
157156
catkin_package(
158157
INCLUDE_DIRS ${RS_INCLUDE_DIRS_LIST} ${SWIPL_INCLUDE_DIRS} ${LIBAPR_INCLUDE_DIRS} ${Caffe_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS}
159158
LIBRARIES ${RS_LIBS}
160-
CATKIN_DEPENDS pcl_ros cv_bridge libmongocxx_ros robosherlock_msgs uimacpp_ros
159+
CATKIN_DEPENDS pcl_ros cv_bridge libmongocxx_ros robosherlock_msgs uimacpp_ros rapidjson_ros
161160
DEPENDS Boost OpenCV APR PCL ICUUC
162161
CFG_EXTRAS robosherlock.cmake ${PROJECT_NAME}_config.cmake
163162
)
@@ -178,19 +177,9 @@ include_directories(
178177
${CMAKE_CURRENT_BINARY_DIR}
179178
)
180179

181-
################################################################################
182-
## Update analysis engines, typesystem and include all relevant files ##
183-
################################################################################
184-
185-
## Update xml list of annotators inside analysis engines
186-
# update_analysis_engines()
187-
188180
## generate classes from the typesystem xml files
189181
generate_type_system()
190182

191-
#find all relevant files
192-
find_additional_files(3rdparty)
193-
194183
################################################################################
195184
## Sub Projects ##
196185
################################################################################
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

package.xml robosherlock/package.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
<depend>uimacpp_ros </depend>
3838
<depend>robosherlock_msgs </depend>
3939
<depend>libmongocxx_ros </depend>
40-
40+
41+
<depend>rapidjson_ros </depend>
4142
<depend>yaml-cpp </depend>
4243

4344
<export>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/io/include/rs/io/Storage.h robosherlock/src/io/include/rs/io/Storage.h

-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ class Storage
6666
std::unordered_map<std::string,mongo::OID> camInfoOIDs;
6767
bool first;
6868

69-
void setupDBScripts();
70-
7169
bool readArrayFS(uima::FeatureStructure fs, ::mongo::BSONObjBuilder &builderCAS, const ::mongo::OID &casOID, const std::string &sofaId, const std::string &dbCollection);
7270
bool readFS(uima::FeatureStructure fs, ::mongo::BSONObjBuilder &builderCAS, const ::mongo::OID &casOID, const std::string &sofaId, const std::string &dbCollection);
7371

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/io/src/Storage.cpp robosherlock/src/io/src/Storage.cpp

-57
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ Storage::Storage(const std::string &dbHost, const std::string &dbName, const boo
6161

6262
db.connect(dbHost);
6363

64-
#ifdef DB_SCRIPTS_DIR
65-
if(setupScripts)
66-
{
67-
setupDBScripts();
68-
}
69-
#endif
7064
if(clear)
7165
{
7266
std::list<std::string> names = db.getCollectionNames(dbName);
@@ -99,57 +93,6 @@ Storage &Storage::operator=(const Storage &other)
9993
return *this;
10094
}
10195

102-
void Storage::setupDBScripts()
103-
{
104-
std::vector<std::string> scripts;
105-
106-
DIR *dp;
107-
struct dirent *dirp;
108-
109-
if((dp = opendir(DB_SCRIPTS_DIR)) == nullptr)
110-
{
111-
outDebug("MongoDB script directory does not exist.");
112-
return;
113-
}
114-
115-
while((dirp = readdir(dp)) != nullptr)
116-
{
117-
if(dirp->d_type != DT_REG)
118-
{
119-
continue;
120-
}
121-
122-
std::string filename = dirp->d_name;
123-
if(filename.rfind(SCRIPT_EXT) != std::string::npos)
124-
{
125-
scripts.push_back(filename);
126-
}
127-
}
128-
closedir(dp);
129-
130-
db.remove(dbScripts, mongo::Query());
131-
for(size_t i = 0; i < scripts.size(); ++i)
132-
{
133-
std::string scriptFile = DB_SCRIPTS_DIR + scripts[i];
134-
std::ifstream file(scriptFile);
135-
136-
if(!file.is_open())
137-
{
138-
outError("could not open: " << scriptFile);
139-
continue;
140-
}
141-
142-
std::string script((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
143-
file.close();
144-
145-
outDebug("Evaluation JavaScript: " << scriptFile);
146-
if(!db.eval(dbName, "function(){" + script + "}"))
147-
{
148-
outError("Error evaluating JavaScript: " << scriptFile);
149-
}
150-
}
151-
}
152-
15396
bool Storage::readArrayFS(uima::FeatureStructure fs, mongo::BSONObjBuilder &builderCAS, const mongo::OID &casOID, const std::string &sofaId, const std::string &dbCollection)
15497
{
15598
uima::ArrayFS array;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

robosherlock_msgs/CMakeLists.txt

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(robosherlock_msgs)
3+
4+
find_package(catkin REQUIRED COMPONENTS
5+
geometry_msgs
6+
shape_msgs
7+
sensor_msgs
8+
visualization_msgs
9+
message_generation)
10+
11+
add_message_files(
12+
FILES
13+
RSObjectDescriptions.msg
14+
RSActiveAnnotatorList.msg
15+
)
16+
17+
add_service_files(FILES
18+
SetRSContext.srv
19+
RSQueryService.srv
20+
RSVisControl.srv
21+
UpdateObjects.srv
22+
ExecutePipeline.srv
23+
)
24+
25+
generate_messages(
26+
DEPENDENCIES
27+
geometry_msgs
28+
visualization_msgs
29+
shape_msgs
30+
sensor_msgs)
31+
32+
catkin_package(
33+
CATKIN_DEPENDS
34+
geometry_msgs
35+
shape_msgs
36+
sensor_msgs
37+
message_runtime
38+
)

robosherlock_msgs/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#list of active annotators (used for sending it to web frontend)
2+
string[] annotators
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
string[] obj_descriptions

0 commit comments

Comments
 (0)