diff --git a/software/raspberry/superviseur-robot/.gitignore b/software/raspberry/superviseur-robot/.gitignore index e98439b..8826514 100644 --- a/software/raspberry/superviseur-robot/.gitignore +++ b/software/raspberry/superviseur-robot/.gitignore @@ -1,5 +1,2 @@ -/.cproject -/.project -/Debug/ -/Release/ -/.settings/ \ No newline at end of file +build/ +src.sav/ diff --git a/software/raspberry/superviseur-robot/CMakeLists.txt b/software/raspberry/superviseur-robot/CMakeLists.txt new file mode 100644 index 0000000..4230fc8 --- /dev/null +++ b/software/raspberry/superviseur-robot/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.9) +project(ProjDestjil CXX) + +set (ProjDestjil_VERSION_MAJOR 1) +set (ProjDestjil_VERSION_MINOR 0) +set (CMAKE_CXX_STANDARD 11) + +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib) + +add_subdirectory("lib") +add_subdirectory("examples") +#add_subdirectory("destjil_init") diff --git a/software/raspberry/superviseur-robot/Essai_VSC/CMakeLists.txt b/software/raspberry/superviseur-robot/Essai_VSC/CMakeLists.txt deleted file mode 100644 index 33ee530..0000000 --- a/software/raspberry/superviseur-robot/Essai_VSC/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(stress) - -set(CMAKE_CXX_STANDARD 11) - -set(SOURCE_FILES main.cpp ../src/robot.cpp ../src/robot.h) -add_executable(stress ${SOURCE_FILES}) \ No newline at end of file diff --git a/software/raspberry/superviseur-robot/Essai_VSC/main.cpp b/software/raspberry/superviseur-robot/Essai_VSC/main.cpp deleted file mode 100644 index 94ec11e..0000000 --- a/software/raspberry/superviseur-robot/Essai_VSC/main.cpp +++ /dev/null @@ -1,91 +0,0 @@ -#include -#include "../src/definitions.h" -#include "../src/robot.h" -#include - -#define NB_TEST 50 -#define NB_RETRIES_MAX 5 -#define DELAY_BETWEEN_RETRIES 10000 // 10 ms -#define DELAY_BETWEEN_TEST 1000000 // 1 seconde - -int nb_retries; -int nb_test; - -int laststatus; -int nb_success; -int nb_timeout; -int nb_unknown_cmd; - -int flipflop; - -int main() { - if (open_communication_robot() != 0) { - std::cout << "Unable to open com port" << std::endl; - - return -1; - } - - std::cout << "Debut du test de stress" << std::endl; - time_t t_debut, t_fin; - struct tm *tm_debut, *tm_fin; - - time(&t_debut); - tm_debut = (struct tm*)malloc (sizeof(struct tm)); - tm_debut = localtime((const time_t*)&t_debut); - - std::cout << "[heure debut]: " << asctime(tm_debut) << std::endl; - - nb_retries=-1; - do { - usleep(DELAY_BETWEEN_RETRIES); - nb_retries++; - laststatus = send_command_to_robot(DMB_START_WITHOUT_WD); - } while ((nb_retries - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/raspberry/superviseur-robot/example/.gitignore b/software/raspberry/superviseur-robot/example/.gitignore deleted file mode 100644 index 0ae6ecd..0000000 --- a/software/raspberry/superviseur-robot/example/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Debug/ -/Server test/ diff --git a/software/raspberry/superviseur-robot/example/.gitignores b/software/raspberry/superviseur-robot/example/.gitignores deleted file mode 100644 index e69de29..0000000 diff --git a/software/raspberry/superviseur-robot/example/.project b/software/raspberry/superviseur-robot/example/.project deleted file mode 100644 index 9fdc26d..0000000 --- a/software/raspberry/superviseur-robot/example/.project +++ /dev/null @@ -1,27 +0,0 @@ - - - Dumber-Robot-Exemple - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/software/raspberry/superviseur-robot/example/.settings/language.settings.xml b/software/raspberry/superviseur-robot/example/.settings/language.settings.xml deleted file mode 100644 index 9abb758..0000000 --- a/software/raspberry/superviseur-robot/example/.settings/language.settings.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/software/raspberry/superviseur-robot/example/CMakeLists.txt b/software/raspberry/superviseur-robot/example/CMakeLists.txt deleted file mode 100644 index f47b4c9..0000000 --- a/software/raspberry/superviseur-robot/example/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(stress) - -set(CMAKE_CXX_STANDARD 11) - -set(SOURCE_FILES main.cpp ../../src/robot.cpp ../../src/robot.h) -add_executable(stress ${SOURCE_FILES}) \ No newline at end of file diff --git a/software/raspberry/superviseur-robot/example/lib b/software/raspberry/superviseur-robot/example/lib deleted file mode 120000 index e057607..0000000 --- a/software/raspberry/superviseur-robot/example/lib +++ /dev/null @@ -1 +0,0 @@ -../src/ \ No newline at end of file diff --git a/software/raspberry/superviseur-robot/example/serialTest/lib/subdir.mk b/software/raspberry/superviseur-robot/example/serialTest/lib/subdir.mk deleted file mode 100644 index acc4132..0000000 --- a/software/raspberry/superviseur-robot/example/serialTest/lib/subdir.mk +++ /dev/null @@ -1,28 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../lib/Robot.cpp \ -../lib/Serial.cpp \ -../lib/TcpServer.cpp \ -../lib/message.cpp - -OBJS += \ -./lib/Robot.o \ -./lib/Serial.o \ -./lib/TcpServer.o \ -./lib/message.o - -CPP_DEPS += \ -./lib/Robot.d \ -./lib/Serial.d \ -./lib/TcpServer.d \ -./lib/message.d - - -# Each subdirectory must supply rules for building sources it contributes -lib/%.o: ../lib/%.cpp - g++ -I"/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/example/lib" -I"/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/example/src" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" - diff --git a/software/raspberry/superviseur-robot/example/serialTest/makefile b/software/raspberry/superviseur-robot/example/serialTest/makefile deleted file mode 100644 index 2e10274..0000000 --- a/software/raspberry/superviseur-robot/example/serialTest/makefile +++ /dev/null @@ -1,56 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include src/subdir.mk --include lib/subdir.mk --include subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(C++_DEPS)),) --include $(C++_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: Dumber-Robot-Exemple - -# Tool invocations -Dumber-Robot-Exemple: $(OBJS) $(USER_OBJS) - g++ -o "Dumber-Robot-Exemple" $(OBJS) $(USER_OBJS) $(LIBS) - -# Other Targets -clean: - -$(RM) $(CC_DEPS)$(C++_DEPS)$(EXECUTABLES)$(C_UPPER_DEPS)$(CXX_DEPS)$(OBJS)$(CPP_DEPS)$(C_DEPS) Dumber-Robot-Exemple - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include ../makefile.targets diff --git a/software/raspberry/superviseur-robot/example/serialTest/objects.mk b/software/raspberry/superviseur-robot/example/serialTest/objects.mk deleted file mode 100644 index 742c2da..0000000 --- a/software/raspberry/superviseur-robot/example/serialTest/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/software/raspberry/superviseur-robot/example/serialTest/sources.mk b/software/raspberry/superviseur-robot/example/serialTest/sources.mk deleted file mode 100644 index af09391..0000000 --- a/software/raspberry/superviseur-robot/example/serialTest/sources.mk +++ /dev/null @@ -1,28 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -C_UPPER_SRCS := -CXX_SRCS := -C++_SRCS := -OBJ_SRCS := -CC_SRCS := -ASM_SRCS := -CPP_SRCS := -C_SRCS := -O_SRCS := -S_UPPER_SRCS := -CC_DEPS := -C++_DEPS := -EXECUTABLES := -C_UPPER_DEPS := -CXX_DEPS := -OBJS := -CPP_DEPS := -C_DEPS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -lib \ -src \ - diff --git a/software/raspberry/superviseur-robot/example/serialTest/src/subdir.mk b/software/raspberry/superviseur-robot/example/serialTest/src/subdir.mk deleted file mode 100644 index b2d1bab..0000000 --- a/software/raspberry/superviseur-robot/example/serialTest/src/subdir.mk +++ /dev/null @@ -1,22 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../src/serialTest.cpp \ -../src/serverTest.cpp - -OBJS += \ -./src/serialTest.o \ -./src/serverTest.o - -CPP_DEPS += \ -./src/serialTest.d \ -./src/serverTest.d - - -# Each subdirectory must supply rules for building sources it contributes -src/%.o: ../src/%.cpp - g++ -I"/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/example/lib" -I"/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/example/src" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" - diff --git a/software/raspberry/superviseur-robot/example/src/Makefile b/software/raspberry/superviseur-robot/example/src/Makefile deleted file mode 100644 index 45721f6..0000000 --- a/software/raspberry/superviseur-robot/example/src/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -LDFLAGS= -L/opt/vc/lib -I/usr/local/include -lopencv_highgui -lopencv_core -lopencv_imgcodecs -lraspicam_cv -lopencv_imgproc -lpthread - -all : - make serial - make video - make ui - make rt - -serial : - g++ serialExample.cpp -o serialExample.elf ../obj/serial.o -video : - g++ videoExample.cpp -o videoExample.elf ../obj/serial.o ../obj/imagerie.o ../obj/tcpServer.o $(LDFLAGS) - -ui : - g++ uiExample.cpp -o uiExample.elf ../obj/serial.o ../obj/imagerie.o ../obj/tcpServer.o $(LDFLAGS) - -rt : - g++ -o rtvideoExample.elf rtvideoExample.cpp -I/usr/xenomai/include/mercury -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -D__MERCURY__ -I/usr/xenomai/include/alchemy ../obj/serial.o ../obj/imagerie.o ../obj/tcpServer.o -lalchemy -lcopperplate /usr/xenomai/lib/xenomai/bootstrap.o -Wl,--wrap=main -Wl,--dynamic-list=/usr/xenomai/lib/dynlist.ld -L/usr/xenomai/lib -lmercury -lpthread -lrt -Wl,-R/usr/xenomai/lib -L/opt/vc/lib -I/usr/local/include -lopencv_highgui -lopencv_core -lopencv_imgcodecs -lraspicam_cv -lopencv_imgproc - -clean : - rm *.elf diff --git a/software/raspberry/superviseur-robot/examples/.gitignore b/software/raspberry/superviseur-robot/examples/.gitignore new file mode 100644 index 0000000..e660fd9 --- /dev/null +++ b/software/raspberry/superviseur-robot/examples/.gitignore @@ -0,0 +1 @@ +bin/ diff --git a/software/raspberry/superviseur-robot/examples/CMakeLists.txt b/software/raspberry/superviseur-robot/examples/CMakeLists.txt new file mode 100644 index 0000000..18f5ffb --- /dev/null +++ b/software/raspberry/superviseur-robot/examples/CMakeLists.txt @@ -0,0 +1,11 @@ +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../examples/bin) + +set(serialTest_FILES ./src/serialTest.cpp) +set(serverTest_FILES ./src/serverTest.cpp) +include_directories(./src ../lib) + +add_executable(serialTest ${serialTest_FILES}) +target_link_libraries(serialTest destjil) + +add_executable(serverTest ${serverTest_FILES}) +target_link_libraries(serverTest destjil) diff --git a/software/raspberry/superviseur-robot/example/src/rtvideoExample.cpp b/software/raspberry/superviseur-robot/examples/src/rtvideoExample.cpp similarity index 100% rename from software/raspberry/superviseur-robot/example/src/rtvideoExample.cpp rename to software/raspberry/superviseur-robot/examples/src/rtvideoExample.cpp diff --git a/software/raspberry/superviseur-robot/example/src/serialExample.cpp b/software/raspberry/superviseur-robot/examples/src/serialExample.cpp similarity index 100% rename from software/raspberry/superviseur-robot/example/src/serialExample.cpp rename to software/raspberry/superviseur-robot/examples/src/serialExample.cpp diff --git a/software/raspberry/superviseur-robot/example/src/serialTest.cpp b/software/raspberry/superviseur-robot/examples/src/serialTest.cpp similarity index 100% rename from software/raspberry/superviseur-robot/example/src/serialTest.cpp rename to software/raspberry/superviseur-robot/examples/src/serialTest.cpp diff --git a/software/raspberry/superviseur-robot/example/src/serverTest.cpp b/software/raspberry/superviseur-robot/examples/src/serverTest.cpp similarity index 100% rename from software/raspberry/superviseur-robot/example/src/serverTest.cpp rename to software/raspberry/superviseur-robot/examples/src/serverTest.cpp diff --git a/software/raspberry/superviseur-robot/example/src/uiExample.cpp b/software/raspberry/superviseur-robot/examples/src/uiExample.cpp similarity index 100% rename from software/raspberry/superviseur-robot/example/src/uiExample.cpp rename to software/raspberry/superviseur-robot/examples/src/uiExample.cpp diff --git a/software/raspberry/superviseur-robot/example/src/videoExample.cpp b/software/raspberry/superviseur-robot/examples/src/videoExample.cpp similarity index 100% rename from software/raspberry/superviseur-robot/example/src/videoExample.cpp rename to software/raspberry/superviseur-robot/examples/src/videoExample.cpp diff --git a/software/raspberry/superviseur-robot/lib/.gitignore b/software/raspberry/superviseur-robot/lib/.gitignore new file mode 100644 index 0000000..dce1580 --- /dev/null +++ b/software/raspberry/superviseur-robot/lib/.gitignore @@ -0,0 +1 @@ +libdestjil.a diff --git a/software/raspberry/superviseur-robot/lib/CMakeLists.txt b/software/raspberry/superviseur-robot/lib/CMakeLists.txt new file mode 100644 index 0000000..3e891f9 --- /dev/null +++ b/software/raspberry/superviseur-robot/lib/CMakeLists.txt @@ -0,0 +1,5 @@ +set(LIB_FILES ./src/Serial.cpp ./src/Robot.cpp ./src/TcpServer.cpp) +include_directories("./") + +add_library(destjil STATIC ${LIB_FILES}) + diff --git a/software/raspberry/superviseur-robot/src/Robot.h b/software/raspberry/superviseur-robot/lib/Robot.h similarity index 100% rename from software/raspberry/superviseur-robot/src/Robot.h rename to software/raspberry/superviseur-robot/lib/Robot.h diff --git a/software/raspberry/superviseur-robot/src/Serial.h b/software/raspberry/superviseur-robot/lib/Serial.h similarity index 100% rename from software/raspberry/superviseur-robot/src/Serial.h rename to software/raspberry/superviseur-robot/lib/Serial.h diff --git a/software/raspberry/superviseur-robot/src/TcpServer.h b/software/raspberry/superviseur-robot/lib/TcpServer.h similarity index 100% rename from software/raspberry/superviseur-robot/src/TcpServer.h rename to software/raspberry/superviseur-robot/lib/TcpServer.h diff --git a/software/raspberry/superviseur-robot/src/definitions.h b/software/raspberry/superviseur-robot/lib/definitions.h similarity index 100% rename from software/raspberry/superviseur-robot/src/definitions.h rename to software/raspberry/superviseur-robot/lib/definitions.h diff --git a/software/raspberry/superviseur-robot/src/image.h b/software/raspberry/superviseur-robot/lib/image.h similarity index 100% rename from software/raspberry/superviseur-robot/src/image.h rename to software/raspberry/superviseur-robot/lib/image.h diff --git a/software/raspberry/superviseur-robot/src/message.h b/software/raspberry/superviseur-robot/lib/message.h similarity index 100% rename from software/raspberry/superviseur-robot/src/message.h rename to software/raspberry/superviseur-robot/lib/message.h diff --git a/software/raspberry/superviseur-robot/src/monitor.h b/software/raspberry/superviseur-robot/lib/monitor.h similarity index 100% rename from software/raspberry/superviseur-robot/src/monitor.h rename to software/raspberry/superviseur-robot/lib/monitor.h diff --git a/software/raspberry/superviseur-robot/src/Robot.cpp b/software/raspberry/superviseur-robot/lib/src/Robot.cpp similarity index 100% rename from software/raspberry/superviseur-robot/src/Robot.cpp rename to software/raspberry/superviseur-robot/lib/src/Robot.cpp diff --git a/software/raspberry/superviseur-robot/src/Serial.cpp b/software/raspberry/superviseur-robot/lib/src/Serial.cpp similarity index 100% rename from software/raspberry/superviseur-robot/src/Serial.cpp rename to software/raspberry/superviseur-robot/lib/src/Serial.cpp diff --git a/software/raspberry/superviseur-robot/src/TcpServer.cpp b/software/raspberry/superviseur-robot/lib/src/TcpServer.cpp similarity index 100% rename from software/raspberry/superviseur-robot/src/TcpServer.cpp rename to software/raspberry/superviseur-robot/lib/src/TcpServer.cpp diff --git a/software/raspberry/superviseur-robot/src/image.cpp b/software/raspberry/superviseur-robot/lib/src/image.cpp similarity index 100% rename from software/raspberry/superviseur-robot/src/image.cpp rename to software/raspberry/superviseur-robot/lib/src/image.cpp diff --git a/software/raspberry/superviseur-robot/src/message.cpp b/software/raspberry/superviseur-robot/lib/src/message.cpp similarity index 100% rename from software/raspberry/superviseur-robot/src/message.cpp rename to software/raspberry/superviseur-robot/lib/src/message.cpp diff --git a/software/raspberry/superviseur-robot/src/monitor.cpp b/software/raspberry/superviseur-robot/lib/src/monitor.cpp similarity index 100% rename from software/raspberry/superviseur-robot/src/monitor.cpp rename to software/raspberry/superviseur-robot/lib/src/monitor.cpp