Correction du cmake et tentative de build
Toujours impossible de trouver alchemy depuis tasks.h
This commit is contained in:
parent
f9ad5f6562
commit
7c3c63e032
6 changed files with 48 additions and 37 deletions
|
@ -10,7 +10,7 @@ add_library(base64
|
|||
lib/base64/base64.cpp
|
||||
lib/base64/base64.h
|
||||
)
|
||||
target_include_directories(base64 PUBLIC lib/base64/base64.h)
|
||||
target_include_directories(base64 PUBLIC lib/base64)
|
||||
|
||||
# lib
|
||||
add_library(lib
|
||||
|
@ -38,12 +38,12 @@ find_package(OpenCV REQUIRED)
|
|||
target_link_libraries(lib ${OpenCV_LIBS})
|
||||
|
||||
# Raspicam_CV
|
||||
find_package(raspicam REQUIRED)
|
||||
target_link_libraries(lib ${raspicam_CV_LIBS})
|
||||
#find_package(raspicam REQUIRED)
|
||||
#target_link_libraries(lib ${raspicam_CV_LIBS})
|
||||
|
||||
# Xenomai
|
||||
set(Xenomai_ROOT_DIR /usr/xenomai) # Optional: hint for Xenomai root folder
|
||||
set(Xenomai_libs POSIX ALCHEMY RTDM PSOS VXWORKS SMOKEY COBALT NATIVE) # List of Xenomai libraries to link
|
||||
set(Xenomai_libs POSIX ALCHEMY RTDM PSOS VXWORKS SMOKEY NATIVE) # List of Xenomai libraries to link
|
||||
|
||||
find_package(Xenomai 3.0 REQUIRED ${Xenomai_libs})
|
||||
if (Xenomai_FOUND)
|
||||
|
@ -53,7 +53,7 @@ else ()
|
|||
endif ()
|
||||
|
||||
foreach (lib IN LISTS Xenomai_libs)
|
||||
message(STATUS ${Xenomai_${lib}_LDFLAGS})
|
||||
message(STATUS ${lib}: ${Xenomai_${lib}_LDFLAGS})
|
||||
target_link_options(main PRIVATE ${Xenomai_${lib}_LDFLAGS})
|
||||
target_include_directories(main PRIVATE ${Xenomai_${lib}_INCLUDE_DIR})
|
||||
target_link_libraries(main ${Xenomai_${lib}_LIBRARY_DIRS} ${Xenomai_${lib}_LIBRARIES})
|
||||
|
|
|
@ -155,7 +155,7 @@ if (DEFINED ENV{SDKTARGETSYSROOT} AND NOT DEFINED Xenomai_ROOT_DIR)
|
|||
SET(ENV{DESTDIR} $ENV{SDKTARGETSYSROOT})
|
||||
endif ()
|
||||
# set the search paths
|
||||
set(Xenomai_SEARCH_PATH /usr/local /usr $ENV{XENOMAI_ROOT_DIR} ${Xenomai_ROOT_DIR} ${Xenomai_ROOT_DIR}/usr/)
|
||||
set(Xenomai_SEARCH_PATH ${Xenomai_ROOT_DIR})
|
||||
|
||||
# searching kernel headers
|
||||
# Find kernel headers
|
||||
|
@ -170,12 +170,14 @@ endif ()
|
|||
|
||||
|
||||
# Find xeno-config
|
||||
find_program(Xenomai_XENO_CONFIG NAMES xeno-config PATHS ${Xenomai_SEARCH_PATH}/bin NO_DEFAULT_PATH)
|
||||
# Always finds /usr/bin/xeno-config for some reason
|
||||
# find_program(Xenomai_XENO_CONFIG NAMES xeno-config PATHS ${Xenomai_SEARCH_PATH}/bin NO_DEFAULT_PATH)
|
||||
set(Xenomai_XENO_CONFIG ${Xenomai_SEARCH_PATH}/bin/xeno-config)
|
||||
|
||||
if (Xenomai_XENO_CONFIG)
|
||||
set(Xenomai_FOUND ${Xenomai_XENO_CONFIG})
|
||||
execute_process(COMMAND ${Xenomai_XENO_CONFIG} --version OUTPUT_VARIABLE Xenomai_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
message(STATUS "xeno-config is found. Xenomai should be ok and version found is ${Xenomai_VERSION}")
|
||||
message(STATUS "xeno-config is found at ${Xenomai_XENO_CONFIG}. Xenomai should be ok and version found is ${Xenomai_VERSION}")
|
||||
|
||||
if (${Xenomai_VERSION} VERSION_GREATER "3.0.2")
|
||||
message(STATUS "xeno-config has the --auto-init-solib option")
|
||||
|
|
|
@ -36,10 +36,11 @@ Camera::Camera():Camera(sm, 10){
|
|||
Camera::Camera(int size, int fps) {
|
||||
this->SetSize(size);
|
||||
#ifndef __FOR_PC__
|
||||
this->cap.set(CV_CAP_PROP_FORMAT, CV_8UC3);
|
||||
this->cap.set(CV_CAP_PROP_FRAME_WIDTH, width);
|
||||
this->cap.set(CV_CAP_PROP_FRAME_HEIGHT, height);
|
||||
this->cap.set(CV_CAP_PROP_FPS, fps);
|
||||
// TODO Throws Camera has no member cap
|
||||
// this->cap.set(CV_CAP_PROP_FORMAT, CV_8UC3);
|
||||
// this->cap.set(CV_CAP_PROP_FRAME_WIDTH, width);
|
||||
// this->cap.set(CV_CAP_PROP_FRAME_HEIGHT, height);
|
||||
// this->cap.set(CV_CAP_PROP_FPS, fps);
|
||||
#endif /* __FOR_PC__ */
|
||||
}
|
||||
|
||||
|
@ -60,13 +61,14 @@ bool Camera::Open() {
|
|||
status = true;
|
||||
}
|
||||
#else
|
||||
if (this->cap.open()) {
|
||||
cout << "Camera warmup 2sec" << endl << flush;
|
||||
sleep(2);
|
||||
cout << "Start capture" << endl << flush;
|
||||
|
||||
status = true;
|
||||
}
|
||||
// TODO Throws Camera has no member cap
|
||||
// if (this->cap.open()) {
|
||||
// cout << "Camera warmup 2sec" << endl << flush;
|
||||
// sleep(2);
|
||||
// cout << "Start capture" << endl << flush;
|
||||
//
|
||||
// status = true;
|
||||
// }
|
||||
#endif /* __FOR_PC__ */
|
||||
|
||||
return status;
|
||||
|
@ -76,7 +78,8 @@ bool Camera::Open() {
|
|||
* Close and release camera
|
||||
*/
|
||||
void Camera::Close() {
|
||||
this->cap.release();
|
||||
// TODO Throws Camera has no member cap
|
||||
// this->cap.release();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -120,8 +123,9 @@ Img Camera::Grab() {
|
|||
cap >> frame;
|
||||
Img capture = Img(frame);
|
||||
#else
|
||||
cap.grab();
|
||||
cap.retrieve(frame);
|
||||
// TODO Throws Camera has no member cap
|
||||
// cap.grab();
|
||||
// cap.retrieve(frame);
|
||||
|
||||
#ifdef __INVERSE_COLOR__
|
||||
cvtColor(frame, frame, CV_BGR2RGB);
|
||||
|
@ -138,7 +142,9 @@ Img Camera::Grab() {
|
|||
* @return true if camera is open, false otherwise
|
||||
*/
|
||||
bool Camera::IsOpen() {
|
||||
return cap.isOpened();
|
||||
// TODO Throws Camera has no member cap
|
||||
// return cap.isOpened();
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
#include <opencv2/imgproc/imgproc.hpp>
|
||||
|
||||
#ifndef __FOR_PC__
|
||||
#include "raspicam/raspicam_cv.h"
|
||||
// TODO install raspicam and uncomment
|
||||
//#include "raspicam/raspicam_cv.h"
|
||||
#endif /* __FOR_PC__ */
|
||||
#include "img.h"
|
||||
|
||||
|
@ -94,14 +95,15 @@ public:
|
|||
Img Grab();
|
||||
|
||||
private:
|
||||
#ifdef __FOR_PC__
|
||||
/**
|
||||
* Camera descriptor
|
||||
*/
|
||||
cv::VideoCapture cap;
|
||||
#else
|
||||
raspicam::RaspiCam_Cv cap;
|
||||
#endif /* __FOR_PC__ */
|
||||
// TODO install raspicam and uncomment
|
||||
//#ifdef __FOR_PC__
|
||||
// /**
|
||||
// * Camera descriptor
|
||||
// */
|
||||
// cv::VideoCapture cap;
|
||||
//#else
|
||||
// raspicam::RaspiCam_Cv cap;
|
||||
//#endif /* __FOR_PC__ */
|
||||
|
||||
/**
|
||||
* Size for image (default= small)
|
||||
|
|
|
@ -153,7 +153,7 @@ int ComRobot::Open(string shost, int nport) {
|
|||
}
|
||||
return 1;
|
||||
#else
|
||||
return -1
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ int ComRobot::Open(string shost, int nport) {
|
|||
int ComRobot::Close() {
|
||||
#ifdef __SIMULATION__
|
||||
return close(sock);
|
||||
#elif
|
||||
#else
|
||||
return close(fd);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -175,9 +175,10 @@ std::list<Position> Img::SearchRobot(Arena arena) {
|
|||
imgTraitment = this->img(arena.arena);
|
||||
}
|
||||
|
||||
cvtColor(imgTraitment, imgTraitment, CV_RGB2GRAY);
|
||||
threshold(imgTraitment, imgTraitment, 128, 255, CV_THRESH_BINARY);
|
||||
findContours(imgTraitment, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cv::Point(0, 0));
|
||||
// TODO Cannot find symbols
|
||||
// cvtColor(imgTraitment, imgTraitment, CV_RGB2GRAY);
|
||||
// threshold(imgTraitment, imgTraitment, 128, 255, CV_THRESH_BINARY);
|
||||
// findContours(imgTraitment, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cv::Point(0, 0));
|
||||
|
||||
for (unsigned int i = 0; i < contours.size(); i++) {
|
||||
ImageMat m(contours[i]);
|
||||
|
|
Loading…
Reference in a new issue