Skip to content

Commit f80fd31

Browse files
committed
cmake compile test
1 parent 0348c04 commit f80fd31

14 files changed

Lines changed: 94 additions & 116 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ jobs:
99
- uses: actions/checkout@v3
1010
- name: dependencies
1111
run: |
12-
sudo apt update
12+
source _make/install.sh vars_only #defines the following dependency packages
13+
sudo apt install --yes ${ubuntu_rai}
1314
_make/install.sh ubuntu-rai
1415
_make/install.sh libccd
1516
_make/install.sh fcl

CMakeLists.txt

Lines changed: 9 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ file(GLOB SRC_Logic src/Logic/*.cpp)
6868
file(GLOB SRC_LGP src/LGP/*.cpp)
6969
file(GLOB SRC_Control src/Control/*.cpp)
7070
file(GLOB SRC_DataGen src/DataGen/*.cpp)
71+
file(GLOB SRC_Perception src/Perception/*.cpp)
7172
7273
file(GLOB SRC_AlgoLewiner src/Algo/Lewiner/*.cpp)
7374
file(GLOB SRC_GeoGJK src/Geo/GJK/*.c)
@@ -96,6 +97,7 @@ add_library(raiobjs OBJECT
9697
${SRC_LGP}
9798
${SRC_Control}
9899
${SRC_DataGen}
100+
${SRC_Perception}
99101
)
100102
101103
################################################################################
@@ -166,108 +168,13 @@ add_executable(meshTool bin/src_meshTool/main.cpp)
166168
target_link_libraries(meshTool rai)
167169
168170
if(BUILD_TESTS)
169-
add_executable(test_timingOpt test/Control/timingOpt/main.cpp)
170-
target_link_libraries(test_timingOpt rai)
171-
add_executable(test_mobileBase test/Control/mobileBase/main.cpp)
172-
target_link_libraries(test_mobileBase rai)
173-
add_executable(test_switches test/KOMO/switches/main.cpp)
174-
target_link_libraries(test_switches rai)
175-
add_executable(test_manip test/KOMO/manip/main.cpp)
176-
target_link_libraries(test_manip rai)
177-
add_executable(test_timeopt test/KOMO/timeopt/main.cpp)
178-
target_link_libraries(test_timeopt rai)
179-
add_executable(test_tutorial test/KOMO/tutorial/main.cpp)
180-
target_link_libraries(test_tutorial rai)
181-
add_executable(test_komo test/KOMO/komo/main.cpp)
182-
target_link_libraries(test_komo rai)
183-
add_executable(test_splined test/KOMO/splined/main.cpp)
184-
target_link_libraries(test_splined rai)
185-
add_executable(test_factored test/KOMO/factored/main.cpp)
186-
target_link_libraries(test_factored rai)
187-
add_executable(test_skeleton test/KOMO/skeleton/main.cpp)
188-
target_link_libraries(test_skeleton rai)
189-
add_executable(test_geo test/Geo/geo/main.cpp)
190-
target_link_libraries(test_geo rai)
191-
add_executable(test_convex test/Geo/convex/main.cpp)
192-
target_link_libraries(test_convex rai qhull)
193-
add_executable(test_PairCollisions test/Geo/PairCollisions/main.cpp)
194-
target_link_libraries(test_PairCollisions rai)
195-
add_executable(test_mesh test/Geo/mesh/main.cpp)
196-
target_link_libraries(test_mesh rai)
197-
add_executable(test_signedDistanceFunctions test/Geo/signedDistanceFunctions/main.cpp)
198-
target_link_libraries(test_signedDistanceFunctions rai)
199-
add_executable(test_collisionEngines test/Kin/collisionEngines/main.cpp)
200-
target_link_libraries(test_collisionEngines rai)
201-
add_executable(test_CameraView test/Kin/CameraView/main.cpp)
202-
target_link_libraries(test_CameraView rai)
203-
add_executable(test_pairCollision_jacobians test/Kin/pairCollision_jacobians/main.cpp)
204-
target_link_libraries(test_pairCollision_jacobians rai)
205-
add_executable(test_features test/Kin/features/main.cpp)
206-
target_link_libraries(test_features rai)
207-
add_executable(test_bullet test/Kin/bullet/main.cpp)
208-
target_link_libraries(test_bullet rai)
209-
add_executable(test_simulation test/Kin/simulation/main.cpp)
210-
target_link_libraries(test_simulation rai)
211-
add_executable(test_SSB_distance test/Kin/SSB_distance/main.cpp)
212-
target_link_libraries(test_SSB_distance rai)
213-
add_executable(test_dynamics test/Kin/dynamics/main.cpp)
214-
target_link_libraries(test_dynamics rai)
215-
add_executable(test_kin test/Kin/kin/main.cpp)
216-
target_link_libraries(test_kin rai)
217-
#add_executable(test_opengl_threaded test/Gui/opengl_threaded/main.cpp)
218-
#target_link_libraries(test_opengl_threaded rai)
219-
#add_executable(test_opengl test/Gui/opengl/main.cpp)
220-
#target_link_libraries(test_opengl rai)
221-
#add_executable(test_projections test/Gui/projections/main.cpp)
222-
#target_link_libraries(test_projections rai)
223-
#add_executable(test_opengl_windowless test/Gui/opengl_windowless/main.cpp)
224-
#target_link_libraries(test_opengl_windowless rai)
225-
#add_executable(test_opengl_mini test/Gui/opengl_mini/main.cpp)
226-
#target_link_libraries(test_opengl_mini rai)
227-
add_executable(test_RenderData test/Gui/RenderData/main.cpp)
228-
target_link_libraries(test_RenderData rai)
229-
add_executable(test_pcl test/Perception/pcl/main.cpp)
230-
target_link_libraries(test_pcl rai)
231-
add_executable(test_util test/Core/util/main.cpp)
232-
target_link_libraries(test_util rai)
233-
add_executable(test_array test/Core/array/main.cpp)
234-
target_link_libraries(test_array rai)
235-
add_executable(test_thread test/Core/thread/main.cpp)
236-
target_link_libraries(test_thread rai)
237-
add_executable(test_graph test/Core/graph/main.cpp)
238-
target_link_libraries(test_graph rai)
239-
add_executable(test_h5 test/Core/h5/main.cpp)
240-
target_link_libraries(test_h5 rai)
241-
add_executable(test_yaml test/Core/yaml/main.cpp)
242-
target_link_libraries(test_yaml rai yaml-cpp)
243-
add_executable(test_ML-regression test/Algo/ML-regression/main.cpp)
244-
target_link_libraries(test_ML-regression rai)
245-
add_executable(test_ann test/Algo/ann/main.cpp)
246-
target_link_libraries(test_ann rai)
247-
add_executable(test_rrt test/Algo/rrt/main.cpp)
248-
target_link_libraries(test_rrt rai)
249-
add_executable(test_spanningTree test/Algo/spanningTree/main.cpp)
250-
target_link_libraries(test_spanningTree rai)
251-
add_executable(test_splines test/Algo/splines/main.cpp)
252-
target_link_libraries(test_splines rai)
253-
add_executable(test_pickAndPlace test/LGP/pickAndPlace/main.cpp)
254-
target_link_libraries(test_pickAndPlace rai)
255-
add_executable(test_newLGP test/LGP/newLGP/main.cpp)
256-
target_link_libraries(test_newLGP rai)
257-
add_executable(test_pddl test/Logic/pddl/main.cpp)
258-
target_link_libraries(test_pddl rai)
259-
add_executable(test_fol test/Logic/fol/main.cpp)
260-
target_link_libraries(test_fol rai)
261-
add_executable(test_optim test/Optim/optim/main.cpp)
262-
target_link_libraries(test_optim rai)
263-
add_executable(test_nlopt test/Optim/nlopt/main.cpp)
264-
target_link_libraries(test_nlopt rai)
265-
add_executable(test_constrained test/Optim/constrained/main.cpp)
266-
target_link_libraries(test_constrained rai)
267-
add_executable(test_benchmarks test/Optim/benchmarks/main.cpp)
268-
target_link_libraries(test_benchmarks rai)
269-
add_executable(test_ipopt test/Optim/ipopt/main.cpp)
270-
target_link_libraries(test_ipopt rai)
171+
file(GLOB tests test/*/*/main.cpp)
172+
foreach(file ${tests})
173+
get_filename_component(path ${file} DIRECTORY)
174+
get_filename_component(name ${path} NAME)
175+
add_executable(${name} ${file})
176+
target_link_libraries(${name} rai qhull)
177+
endforeach( file ${tests} )
271178
endif()
272179
273180
################################################################################

_make/install.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ cd ${git}
6969

7070
case ${lib} in
7171

72-
ubuntu-rai)
73-
sudo apt install --yes ${ubuntu_rai}
74-
;;
75-
76-
ubuntu-botop)
77-
sudo apt install --yes ${ubuntu_rai} ${ubuntu_botop}
78-
;;
79-
8072
botop)
8173
git clone --recurse-submodules https://github.com/MarcToussaint/botop.git
8274
export PY_VERSION=`python3 -c "import sys; print(str(sys.version_info[0])+'.'+str(sys.version_info[1]))"`

src/Perception/opencvCamera.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,19 @@ void OpencvCamera::step() {
5353
}
5454
}
5555

56+
#else //OPENCV
57+
58+
#include "opencvCamera.h"
59+
60+
struct sOpencvCamera {};
61+
62+
OpencvCamera::OpencvCamera(const char* _name, int _cameraID)
63+
: Thread(STRING("OpencvCamera_"<<_name), 0.),
64+
cameraID(_cameraID),
65+
image(this) { NICO }
66+
OpencvCamera::~OpencvCamera() { NICO }
67+
void OpencvCamera::open() { NICO }
68+
void OpencvCamera::step() { NICO }
69+
void OpencvCamera::close() { NICO }
70+
5671
#endif

test/DataGen/shapenetGrasp/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ void generateGraspsFiles(uint N=10) {
6464

6565
arr scores = SG.evaluateGrasp();
6666

67-
if(min(scores)>0.) Xsucc.append(convert<float>(pose).reshape(1,-1));
68-
else Xfail.append(convert<float>(pose).reshape(1,-1));
67+
if(min(scores)>0.) Xsucc.append(rai::convert<float>(pose).reshape(1,-1));
68+
else Xfail.append(rai::convert<float>(pose).reshape(1,-1));
6969

7070
cout <<" -- shape: " <<shape <<" eval: " <<i+1 <<" #succ: " <<Xsucc.d0 <<
7171
" #fail: " <<Xfail.d0 <<endl;
@@ -103,7 +103,7 @@ void displayGraspsFiles(uint N=10) {
103103
shapes.append(shape, Xsucc.d0);
104104
}
105105

106-
SG.displaySamples(convert<double>(X), shapes);
106+
SG.displaySamples(rai::convert<double>(X), shapes);
107107
}
108108

109109

test/Geo/signedDistanceFunctions/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
BASE = ../../..
22

3-
LIBS += -lglut -lGL -lqhull
3+
QHULL = 1
4+
GL = 1
45

56
DEPEND = Core Gui Geo Optim
67

test/Perception/aruco/main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
#include <Kin/frame.h>
88
#include <Kin/viewer.h>
99

10+
#ifdef RAI_OPENCV
11+
1012
#include <opencv2/features2d.hpp>
1113
#include "opencv2/imgproc.hpp"
1214
#include <opencv2/objdetect/aruco_detector.hpp>
1315

14-
1516
void test(){
1617
rai::Configuration C;
1718
C.addFile("$RAI_PATH/scenarios/pandaSingle.g");
@@ -54,6 +55,10 @@ void test(){
5455
}
5556
}
5657

58+
#else //opencv
59+
void test(){ NICO }
60+
#endif
61+
5762
int main(int argc,char **argv){
5863
rai::initCmdLine(argc,argv);
5964

0 commit comments

Comments
 (0)