Browse Source

robot class + serial class ok. Tcp server class seems ok

Sébastien DI MERCURIO 5 years ago
parent
commit
d6c8a54215
58 changed files with 2210 additions and 1717 deletions
  1. 16
    0
      .vscode/c_cpp_properties.json
  2. 16
    0
      .vscode/tasks.json
  3. 7
    0
      software/raspberry/superviseur-robot/Essai_VSC/CMakeLists.txt
  4. 3
    3
      software/raspberry/superviseur-robot/Essai_VSC/main.cpp
  5. 145
    0
      software/raspberry/superviseur-robot/example/.cproject
  6. 2
    0
      software/raspberry/superviseur-robot/example/.gitignore
  7. 0
    0
      software/raspberry/superviseur-robot/example/.gitignores
  8. 27
    0
      software/raspberry/superviseur-robot/example/.project
  9. 25
    0
      software/raspberry/superviseur-robot/example/.settings/language.settings.xml
  10. 0
    0
      software/raspberry/superviseur-robot/example/CMakeLists.txt
  11. 1
    0
      software/raspberry/superviseur-robot/example/lib
  12. 28
    0
      software/raspberry/superviseur-robot/example/serialTest/lib/subdir.mk
  13. 56
    0
      software/raspberry/superviseur-robot/example/serialTest/makefile
  14. 8
    0
      software/raspberry/superviseur-robot/example/serialTest/objects.mk
  15. 28
    0
      software/raspberry/superviseur-robot/example/serialTest/sources.mk
  16. 22
    0
      software/raspberry/superviseur-robot/example/serialTest/src/subdir.mk
  17. 186
    0
      software/raspberry/superviseur-robot/example/src/serialTest.cpp
  18. 111
    0
      software/raspberry/superviseur-robot/example/src/serverTest.cpp
  19. 0
    8
      software/raspberry/superviseur-robot/example/stress/.gitignore
  20. 0
    29
      software/raspberry/superviseur-robot/example/stress/.idea/codeStyles/Project.xml
  21. 0
    4
      software/raspberry/superviseur-robot/example/stress/.idea/misc.xml
  22. 0
    8
      software/raspberry/superviseur-robot/example/stress/.idea/modules.xml
  23. 0
    2
      software/raspberry/superviseur-robot/example/stress/.idea/stress.iml
  24. 0
    6
      software/raspberry/superviseur-robot/example/stress/.idea/vcs.xml
  25. 0
    294
      software/raspberry/superviseur-robot/example/stress/.idea/workspace.xml
  26. 0
    355
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeCache.txt
  27. 0
    16
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake
  28. 0
    49
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/Makefile.cmake
  29. 0
    108
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/Makefile2
  30. 0
    3
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/TargetDirectories.txt
  31. 0
    3
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/clion-environment.txt
  32. 0
    1
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/clion-log.txt
  33. 0
    1
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/cmake.check_cache
  34. 0
    34
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/feature_tests.c
  35. 0
    405
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/feature_tests.cxx
  36. 0
    1
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/progress.marks
  37. 0
    208
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/Makefile
  38. 0
    44
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/cmake_install.cmake
  39. BIN
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/stress
  40. 0
    100
      software/raspberry/superviseur-robot/example/stress/cmake-build-debug/stress.cbp
  41. 57
    0
      software/raspberry/superviseur-robot/src.sav/definitions.h
  42. 211
    0
      software/raspberry/superviseur-robot/src.sav/image.cpp
  43. 128
    0
      software/raspberry/superviseur-robot/src.sav/image.h
  44. 29
    0
      software/raspberry/superviseur-robot/src.sav/message.cpp
  45. 33
    0
      software/raspberry/superviseur-robot/src.sav/message.h
  46. 161
    0
      software/raspberry/superviseur-robot/src.sav/monitor.cpp
  47. 115
    0
      software/raspberry/superviseur-robot/src.sav/monitor.h
  48. 18
    8
      software/raspberry/superviseur-robot/src.sav/robot.cpp
  49. 1
    1
      software/raspberry/superviseur-robot/src.sav/robot.h
  50. 349
    0
      software/raspberry/superviseur-robot/src/Robot.cpp
  51. 84
    0
      software/raspberry/superviseur-robot/src/Robot.h
  52. 164
    0
      software/raspberry/superviseur-robot/src/Serial.cpp
  53. 49
    0
      software/raspberry/superviseur-robot/src/Serial.h
  54. 93
    0
      software/raspberry/superviseur-robot/src/TcpServer.cpp
  55. 35
    0
      software/raspberry/superviseur-robot/src/TcpServer.h
  56. 0
    24
      software/raspberry/superviseur-robot/src/definitions.h
  57. 1
    1
      software/raspberry/superviseur-robot/src/image.cpp
  58. 1
    1
      software/raspberry/superviseur-robot/src/image.h

+ 16
- 0
.vscode/c_cpp_properties.json View File

@@ -0,0 +1,16 @@
1
+{
2
+    "configurations": [
3
+        {
4
+            "name": "Linux",
5
+            "includePath": [
6
+                "${workspaceFolder}/**"
7
+            ],
8
+            "defines": [],
9
+            "compilerPath": "/usr/bin/clang",
10
+            "cStandard": "c11",
11
+            "cppStandard": "c++17",
12
+            "intelliSenseMode": "clang-x64"
13
+        }
14
+    ],
15
+    "version": 4
16
+}

+ 16
- 0
.vscode/tasks.json View File

@@ -0,0 +1,16 @@
1
+{
2
+  // See https://go.microsoft.com/fwlink/?LinkId=733558
3
+    // for the documentation about the tasks.json format
4
+    "version": "2.0.0",
5
+    "tasks": [
6
+        {
7
+            "taskName": "Compile on raspberry",
8
+            "command": "rsync -az '${file}' 10.105.1.6:~ && ssh server.example.org 'chmod +x ./${fileBasename}; ./${fileBasename}'",
9
+            "type": "shell",
10
+            "group": {
11
+                "kind": "build",
12
+                "isDefault": true
13
+            }
14
+        }
15
+    ]
16
+}

+ 7
- 0
software/raspberry/superviseur-robot/Essai_VSC/CMakeLists.txt View File

@@ -0,0 +1,7 @@
1
+cmake_minimum_required(VERSION 3.9)
2
+project(stress)
3
+
4
+set(CMAKE_CXX_STANDARD 11)
5
+
6
+set(SOURCE_FILES main.cpp ../src/robot.cpp ../src/robot.h)
7
+add_executable(stress ${SOURCE_FILES})

software/raspberry/superviseur-robot/example/stress/main.cpp → software/raspberry/superviseur-robot/Essai_VSC/main.cpp View File

@@ -1,6 +1,6 @@
1 1
 #include <iostream>
2
-#include "../../src/definitions.h"
3
-#include "../../src/robot.h"
2
+#include "../src/definitions.h"
3
+#include "../src/robot.h"
4 4
 #include <ctime>
5 5
 
6 6
 #define NB_TEST 50
@@ -19,7 +19,7 @@ int nb_unknown_cmd;
19 19
 int flipflop;
20 20
 
21 21
 int main() {
22
-    if (open_communication_robot("/dev/ttyUSB0") != 0) {
22
+    if (open_communication_robot() != 0) {
23 23
         std::cout << "Unable to open com port" << std::endl;
24 24
 
25 25
         return -1;

+ 145
- 0
software/raspberry/superviseur-robot/example/.cproject View File

@@ -0,0 +1,145 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
3
+	<storageModule moduleId="org.eclipse.cdt.core.settings">
4
+		<cconfiguration id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908">
5
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908" moduleId="org.eclipse.cdt.core.settings" name="serialTest">
6
+				<externalSettings/>
7
+				<extensions>
8
+					<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
9
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
10
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
11
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
12
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
13
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
14
+				</extensions>
15
+			</storageModule>
16
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
17
+				<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="Test RF quality" id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908" name="serialTest" parent="com.atollic.managedbuild.pctools.config.gnu.exe.debug">
18
+					<folderInfo id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908." name="/" resourcePath="">
19
+						<toolChain id="com.atollic.managedbuild.pctoolschain.gnu.exe.debug.1644719303" name="Atollic Linux PC Tools" superClass="com.atollic.managedbuild.pctoolschain.gnu.exe.debug">
20
+							<targetPlatform id="com.atollic.pctools.managedbuild.target.gnu.platform.exe.debug.444948895" name="Debug Platform" superClass="com.atollic.pctools.managedbuild.target.gnu.platform.exe.debug"/>
21
+							<builder buildPath="${workspace_loc:/Dumber-Robot-Exemple}/Debug" customBuilderProperties="toolChainpathType=1|toolChainpathString=/opt/Atollic_TrueSTUDIO_for_STM32_x86_64_9.0.0/ARMTools/bin|" id="com.atollic.pctools.managedbuild.target.gnu.builder.exe.debug.703691933" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="GNU Make Builder" superClass="com.atollic.pctools.managedbuild.target.gnu.builder.exe.debug"/>
22
+							<tool id="com.atollic.managedbuild.pctools.gnu.archiver.base.754185313" name="Archiver" superClass="com.atollic.managedbuild.pctools.gnu.archiver.base"/>
23
+							<tool id="com.atollic.managedbuild.pctools.gnu.cpp.compiler.exe.debug.460714726" name="C++ Compiler" superClass="com.atollic.managedbuild.pctools.gnu.cpp.compiler.exe.debug">
24
+								<option id="com.atollic.pctools.gnu.cpp.compiler.exe.debug.option.optimization.level.759860919" name="Optimization Level" superClass="com.atollic.pctools.gnu.cpp.compiler.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="com.atollic.pctools.gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
25
+								<option id="com.atollic.pctools.gnu.cpp.compiler.exe.debug.option.debugging.level.1134609705" name="Debug Level" superClass="com.atollic.pctools.gnu.cpp.compiler.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="com.atollic.pctools.gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
26
+								<option id="com.atollic.pctools.gnu.cpp.compiler.option.include.paths.1092205484" name="Include paths (-I)" superClass="com.atollic.pctools.gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
27
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
28
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
29
+								</option>
30
+								<inputType id="com.atollic.managedbuild.pctools.gnu.cpp.compiler.input.18466674" superClass="com.atollic.managedbuild.pctools.gnu.cpp.compiler.input"/>
31
+							</tool>
32
+							<tool id="com.atollic.managedbuild.pctools.gnu.c.compiler.exe.debug.1524457175" name="C Compiler" superClass="com.atollic.managedbuild.pctools.gnu.c.compiler.exe.debug">
33
+								<option defaultValue="com.atollic.pctools.gnu.c.optimization.level.none" id="com.atollic.pctools.gnu.c.compiler.exe.debug.option.optimization.level.602619486" name="Optimization Level" superClass="com.atollic.pctools.gnu.c.compiler.exe.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
34
+								<option id="com.atollic.pctools.gnu.c.compiler.exe.debug.option.debugging.level.1202784327" name="Debug Level" superClass="com.atollic.pctools.gnu.c.compiler.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="com.atollic.pctools.gnu.c.debugging.level.max" valueType="enumerated"/>
35
+								<option id="com.atollic.pctools.gnu.c.compiler.option.include.paths.608880272" name="Include paths (-I)" superClass="com.atollic.pctools.gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
36
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
37
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
38
+								</option>
39
+								<inputType id="com.atollic.managedbuild.pctools.gnu.c.compiler.input.978460249" superClass="com.atollic.managedbuild.pctools.gnu.c.compiler.input"/>
40
+							</tool>
41
+							<tool id="com.atollic.managedbuild.pctools.gnu.c.linker.exe.debug.650018959" name="C Linker" superClass="com.atollic.managedbuild.pctools.gnu.c.linker.exe.debug"/>
42
+							<tool id="com.atollic.managedbuild.pctools.gnu.cpp.linker.exe.debug.949894658" name="C++ Linker" superClass="com.atollic.managedbuild.pctools.gnu.cpp.linker.exe.debug">
43
+								<inputType id="com.atollic.managedbuild.pctools.gnu.cpp.linker.input.520817887" superClass="com.atollic.managedbuild.pctools.gnu.cpp.linker.input">
44
+									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
45
+									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
46
+								</inputType>
47
+							</tool>
48
+							<tool id="com.atollic.managedbuild.pctools.gnu.assembler.exe.debug.1090002007" name="Assembler" superClass="com.atollic.managedbuild.pctools.gnu.assembler.exe.debug">
49
+								<inputType id="com.atollic.managedbuild.pctools.gnu.assembler.input.665455269" superClass="com.atollic.managedbuild.pctools.gnu.assembler.input"/>
50
+							</tool>
51
+						</toolChain>
52
+					</folderInfo>
53
+					<fileInfo id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908.107079152" name="image.h" rcbsApplicability="disable" resourcePath="lib/image.h" toolsToInvoke=""/>
54
+					<fileInfo id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908.2136136082" name="Makefile" rcbsApplicability="disable" resourcePath="src/Makefile" toolsToInvoke=""/>
55
+					<sourceEntries>
56
+						<entry excluding="monitor.cpp|image.h|image.cpp" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="lib"/>
57
+						<entry excluding="Makefile|videoExample.cpp|uiExample.cpp|serialExample.cpp|rtvideoExample.cpp" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
58
+					</sourceEntries>
59
+				</configuration>
60
+			</storageModule>
61
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
62
+		</cconfiguration>
63
+		<cconfiguration id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908.1158593353">
64
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908.1158593353" moduleId="org.eclipse.cdt.core.settings" name="Server test">
65
+				<externalSettings/>
66
+				<extensions>
67
+					<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
68
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
69
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
70
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
71
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
72
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
73
+				</extensions>
74
+			</storageModule>
75
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
76
+				<configuration artifactName="ServerTest" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="Test server setup" id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908.1158593353" name="Server test" parent="com.atollic.managedbuild.pctools.config.gnu.exe.debug">
77
+					<folderInfo id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908.1158593353." name="/" resourcePath="">
78
+						<toolChain id="com.atollic.managedbuild.pctoolschain.gnu.exe.debug.1769978487" name="Atollic Linux PC Tools" superClass="com.atollic.managedbuild.pctoolschain.gnu.exe.debug">
79
+							<targetPlatform id="com.atollic.pctools.managedbuild.target.gnu.platform.exe.debug.1135891617" name="Debug Platform" superClass="com.atollic.pctools.managedbuild.target.gnu.platform.exe.debug"/>
80
+							<builder buildPath="${workspace_loc:/Dumber-Robot-Exemple}/Debug" customBuilderProperties="toolChainpathType=1|toolChainpathString=/opt/Atollic_TrueSTUDIO_for_STM32_x86_64_9.0.0/ARMTools/bin|" id="com.atollic.pctools.managedbuild.target.gnu.builder.exe.debug.1461439116" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="GNU Make Builder" superClass="com.atollic.pctools.managedbuild.target.gnu.builder.exe.debug"/>
81
+							<tool id="com.atollic.managedbuild.pctools.gnu.archiver.base.1426655308" name="Archiver" superClass="com.atollic.managedbuild.pctools.gnu.archiver.base"/>
82
+							<tool id="com.atollic.managedbuild.pctools.gnu.cpp.compiler.exe.debug.115182827" name="C++ Compiler" superClass="com.atollic.managedbuild.pctools.gnu.cpp.compiler.exe.debug">
83
+								<option id="com.atollic.pctools.gnu.cpp.compiler.exe.debug.option.optimization.level.1103169709" name="Optimization Level" superClass="com.atollic.pctools.gnu.cpp.compiler.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="com.atollic.pctools.gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
84
+								<option id="com.atollic.pctools.gnu.cpp.compiler.exe.debug.option.debugging.level.1900144654" name="Debug Level" superClass="com.atollic.pctools.gnu.cpp.compiler.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="com.atollic.pctools.gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
85
+								<option id="com.atollic.pctools.gnu.cpp.compiler.option.include.paths.2096629070" name="Include paths (-I)" superClass="com.atollic.pctools.gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
86
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
87
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
88
+								</option>
89
+								<inputType id="com.atollic.managedbuild.pctools.gnu.cpp.compiler.input.928183158" superClass="com.atollic.managedbuild.pctools.gnu.cpp.compiler.input"/>
90
+							</tool>
91
+							<tool id="com.atollic.managedbuild.pctools.gnu.c.compiler.exe.debug.1435027661" name="C Compiler" superClass="com.atollic.managedbuild.pctools.gnu.c.compiler.exe.debug">
92
+								<option defaultValue="com.atollic.pctools.gnu.c.optimization.level.none" id="com.atollic.pctools.gnu.c.compiler.exe.debug.option.optimization.level.169974575" name="Optimization Level" superClass="com.atollic.pctools.gnu.c.compiler.exe.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
93
+								<option id="com.atollic.pctools.gnu.c.compiler.exe.debug.option.debugging.level.980419679" name="Debug Level" superClass="com.atollic.pctools.gnu.c.compiler.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="com.atollic.pctools.gnu.c.debugging.level.max" valueType="enumerated"/>
94
+								<option id="com.atollic.pctools.gnu.c.compiler.option.include.paths.967863685" name="Include paths (-I)" superClass="com.atollic.pctools.gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
95
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
96
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/src}&quot;"/>
97
+								</option>
98
+								<inputType id="com.atollic.managedbuild.pctools.gnu.c.compiler.input.1991549921" superClass="com.atollic.managedbuild.pctools.gnu.c.compiler.input"/>
99
+							</tool>
100
+							<tool id="com.atollic.managedbuild.pctools.gnu.c.linker.exe.debug.1530079011" name="C Linker" superClass="com.atollic.managedbuild.pctools.gnu.c.linker.exe.debug"/>
101
+							<tool id="com.atollic.managedbuild.pctools.gnu.cpp.linker.exe.debug.1993338495" name="C++ Linker" superClass="com.atollic.managedbuild.pctools.gnu.cpp.linker.exe.debug">
102
+								<inputType id="com.atollic.managedbuild.pctools.gnu.cpp.linker.input.774293629" superClass="com.atollic.managedbuild.pctools.gnu.cpp.linker.input">
103
+									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
104
+									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
105
+								</inputType>
106
+							</tool>
107
+							<tool id="com.atollic.managedbuild.pctools.gnu.assembler.exe.debug.210875902" name="Assembler" superClass="com.atollic.managedbuild.pctools.gnu.assembler.exe.debug">
108
+								<inputType id="com.atollic.managedbuild.pctools.gnu.assembler.input.61333264" superClass="com.atollic.managedbuild.pctools.gnu.assembler.input"/>
109
+							</tool>
110
+						</toolChain>
111
+					</folderInfo>
112
+					<fileInfo id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908.1158593353.lib/image.h" name="image.h" rcbsApplicability="disable" resourcePath="lib/image.h" toolsToInvoke=""/>
113
+					<fileInfo id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908.1158593353.src/Makefile" name="Makefile" rcbsApplicability="disable" resourcePath="src/Makefile" toolsToInvoke=""/>
114
+					<sourceEntries>
115
+						<entry excluding="monitor.cpp|image.h|image.cpp" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="lib"/>
116
+						<entry excluding="serialTest.cpp|Makefile|videoExample.cpp|uiExample.cpp|serialExample.cpp|rtvideoExample.cpp" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
117
+					</sourceEntries>
118
+				</configuration>
119
+			</storageModule>
120
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
121
+		</cconfiguration>
122
+	</storageModule>
123
+	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
124
+		<project id="Dumber-Robot-Exemple.com.atollic.pctools.managedbuild.target.gnu.exe.162302072" name="Executable" projectType="com.atollic.pctools.managedbuild.target.gnu.exe"/>
125
+	</storageModule>
126
+	<storageModule moduleId="scannerConfiguration">
127
+		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
128
+	</storageModule>
129
+	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
130
+	<storageModule moduleId="refreshScope" versionNumber="2">
131
+		<configuration configurationName="Server test">
132
+			<resource resourceType="PROJECT" workspacePath="/Dumber-Robot-Exemple"/>
133
+		</configuration>
134
+		<configuration configurationName="serialTest">
135
+			<resource resourceType="PROJECT" workspacePath="/Dumber-Robot-Exemple"/>
136
+		</configuration>
137
+		<configuration configurationName="Debug">
138
+			<resource resourceType="PROJECT" workspacePath="/Dumber-Robot-Exemple"/>
139
+		</configuration>
140
+		<configuration configurationName="Release">
141
+			<resource resourceType="PROJECT" workspacePath="/Dumber-Robot-Exemple"/>
142
+		</configuration>
143
+	</storageModule>
144
+	<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
145
+</cproject>

+ 2
- 0
software/raspberry/superviseur-robot/example/.gitignore View File

@@ -0,0 +1,2 @@
1
+/Debug/
2
+/Server test/

+ 0
- 0
software/raspberry/superviseur-robot/example/.gitignores View File


+ 27
- 0
software/raspberry/superviseur-robot/example/.project View File

@@ -0,0 +1,27 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<projectDescription>
3
+	<name>Dumber-Robot-Exemple</name>
4
+	<comment></comment>
5
+	<projects>
6
+	</projects>
7
+	<buildSpec>
8
+		<buildCommand>
9
+			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
10
+			<triggers>clean,full,incremental,</triggers>
11
+			<arguments>
12
+			</arguments>
13
+		</buildCommand>
14
+		<buildCommand>
15
+			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
16
+			<triggers>full,incremental,</triggers>
17
+			<arguments>
18
+			</arguments>
19
+		</buildCommand>
20
+	</buildSpec>
21
+	<natures>
22
+		<nature>org.eclipse.cdt.core.cnature</nature>
23
+		<nature>org.eclipse.cdt.core.ccnature</nature>
24
+		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
25
+		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
26
+	</natures>
27
+</projectDescription>

+ 25
- 0
software/raspberry/superviseur-robot/example/.settings/language.settings.xml View File

@@ -0,0 +1,25 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+<project>
3
+	<configuration id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908" name="serialTest">
4
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
5
+			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
6
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
7
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
8
+			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="205429042390110507" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
9
+				<language-scope id="org.eclipse.cdt.core.gcc"/>
10
+				<language-scope id="org.eclipse.cdt.core.g++"/>
11
+			</provider>
12
+		</extension>
13
+	</configuration>
14
+	<configuration id="com.atollic.managedbuild.pctools.config.gnu.exe.debug.119910908.1158593353" name="Server test">
15
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
16
+			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
17
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
18
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
19
+			<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="205429042390110507" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
20
+				<language-scope id="org.eclipse.cdt.core.gcc"/>
21
+				<language-scope id="org.eclipse.cdt.core.g++"/>
22
+			</provider>
23
+		</extension>
24
+	</configuration>
25
+</project>

software/raspberry/superviseur-robot/example/stress/CMakeLists.txt → software/raspberry/superviseur-robot/example/CMakeLists.txt View File


+ 1
- 0
software/raspberry/superviseur-robot/example/lib View File

@@ -0,0 +1 @@
1
+../src/

+ 28
- 0
software/raspberry/superviseur-robot/example/serialTest/lib/subdir.mk View File

@@ -0,0 +1,28 @@
1
+################################################################################
2
+# Automatically-generated file. Do not edit!
3
+################################################################################
4
+
5
+# Add inputs and outputs from these tool invocations to the build variables 
6
+CPP_SRCS += \
7
+../lib/Robot.cpp \
8
+../lib/Serial.cpp \
9
+../lib/TcpServer.cpp \
10
+../lib/message.cpp 
11
+
12
+OBJS += \
13
+./lib/Robot.o \
14
+./lib/Serial.o \
15
+./lib/TcpServer.o \
16
+./lib/message.o 
17
+
18
+CPP_DEPS += \
19
+./lib/Robot.d \
20
+./lib/Serial.d \
21
+./lib/TcpServer.d \
22
+./lib/message.d 
23
+
24
+
25
+# Each subdirectory must supply rules for building sources it contributes
26
+lib/%.o: ../lib/%.cpp
27
+	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 "$@" "$<"
28
+

+ 56
- 0
software/raspberry/superviseur-robot/example/serialTest/makefile View File

@@ -0,0 +1,56 @@
1
+################################################################################
2
+# Automatically-generated file. Do not edit!
3
+################################################################################
4
+
5
+-include ../makefile.init
6
+
7
+RM := rm -rf
8
+
9
+# All of the sources participating in the build are defined here
10
+-include sources.mk
11
+-include src/subdir.mk
12
+-include lib/subdir.mk
13
+-include subdir.mk
14
+-include objects.mk
15
+
16
+ifneq ($(MAKECMDGOALS),clean)
17
+ifneq ($(strip $(CC_DEPS)),)
18
+-include $(CC_DEPS)
19
+endif
20
+ifneq ($(strip $(C++_DEPS)),)
21
+-include $(C++_DEPS)
22
+endif
23
+ifneq ($(strip $(C_UPPER_DEPS)),)
24
+-include $(C_UPPER_DEPS)
25
+endif
26
+ifneq ($(strip $(CXX_DEPS)),)
27
+-include $(CXX_DEPS)
28
+endif
29
+ifneq ($(strip $(CPP_DEPS)),)
30
+-include $(CPP_DEPS)
31
+endif
32
+ifneq ($(strip $(C_DEPS)),)
33
+-include $(C_DEPS)
34
+endif
35
+endif
36
+
37
+-include ../makefile.defs
38
+
39
+# Add inputs and outputs from these tool invocations to the build variables 
40
+
41
+# All Target
42
+all: Dumber-Robot-Exemple
43
+
44
+# Tool invocations
45
+Dumber-Robot-Exemple: $(OBJS) $(USER_OBJS)
46
+	g++  -o "Dumber-Robot-Exemple" $(OBJS) $(USER_OBJS) $(LIBS)
47
+
48
+# Other Targets
49
+clean:
50
+	-$(RM) $(CC_DEPS)$(C++_DEPS)$(EXECUTABLES)$(C_UPPER_DEPS)$(CXX_DEPS)$(OBJS)$(CPP_DEPS)$(C_DEPS) Dumber-Robot-Exemple
51
+	-@echo ' '
52
+
53
+.PHONY: all clean dependents
54
+.SECONDARY:
55
+
56
+-include ../makefile.targets

+ 8
- 0
software/raspberry/superviseur-robot/example/serialTest/objects.mk View File

@@ -0,0 +1,8 @@
1
+################################################################################
2
+# Automatically-generated file. Do not edit!
3
+################################################################################
4
+
5
+USER_OBJS :=
6
+
7
+LIBS :=
8
+

+ 28
- 0
software/raspberry/superviseur-robot/example/serialTest/sources.mk View File

@@ -0,0 +1,28 @@
1
+################################################################################
2
+# Automatically-generated file. Do not edit!
3
+################################################################################
4
+
5
+C_UPPER_SRCS := 
6
+CXX_SRCS := 
7
+C++_SRCS := 
8
+OBJ_SRCS := 
9
+CC_SRCS := 
10
+ASM_SRCS := 
11
+CPP_SRCS := 
12
+C_SRCS := 
13
+O_SRCS := 
14
+S_UPPER_SRCS := 
15
+CC_DEPS := 
16
+C++_DEPS := 
17
+EXECUTABLES := 
18
+C_UPPER_DEPS := 
19
+CXX_DEPS := 
20
+OBJS := 
21
+CPP_DEPS := 
22
+C_DEPS := 
23
+
24
+# Every subdirectory with source files must be described here
25
+SUBDIRS := \
26
+lib \
27
+src \
28
+

+ 22
- 0
software/raspberry/superviseur-robot/example/serialTest/src/subdir.mk View File

@@ -0,0 +1,22 @@
1
+################################################################################
2
+# Automatically-generated file. Do not edit!
3
+################################################################################
4
+
5
+# Add inputs and outputs from these tool invocations to the build variables 
6
+CPP_SRCS += \
7
+../src/serialTest.cpp \
8
+../src/serverTest.cpp 
9
+
10
+OBJS += \
11
+./src/serialTest.o \
12
+./src/serverTest.o 
13
+
14
+CPP_DEPS += \
15
+./src/serialTest.d \
16
+./src/serverTest.d 
17
+
18
+
19
+# Each subdirectory must supply rules for building sources it contributes
20
+src/%.o: ../src/%.cpp
21
+	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 "$@" "$<"
22
+

+ 186
- 0
software/raspberry/superviseur-robot/example/src/serialTest.cpp View File

@@ -0,0 +1,186 @@
1
+/*******************************************************************************
2
+ * Copyright (c) 2018 INSA - GEI, Toulouse, France.
3
+ * All rights reserved. This program and the accompanying materials
4
+ * are made available "AS IS", without any warranty of any kind.
5
+ *
6
+ * INSA assumes no responsibility for errors or omissions in the 
7
+ * software or documentation available. 
8
+ *
9
+ * Part of code Copyright ST Microelectronics.
10
+ *
11
+ * Contributors:
12
+ *     Lucien Senaneuch - Initial API and implementation
13
+ *     Sebastien DI MERCURIO - Maintainer since Octobre 2018
14
+ *******************************************************************************/
15
+
16
+#include <iostream>
17
+#include <ctime>
18
+#include "Robot.h"
19
+#include <unistd.h>
20
+
21
+using namespace std;
22
+
23
+#define NB_TEST 50
24
+#define DELAY_BETWEEN_TEST 1000000 // 1 seconde
25
+
26
+int nb_retries;
27
+int nb_test;
28
+
29
+int laststatus;
30
+int nb_success;
31
+int nb_timeout;
32
+int nb_unknown_cmd;
33
+
34
+int flipflop;
35
+
36
+int Test(Robot rob) {
37
+    try {
38
+        if (flipflop == 0) {
39
+            rob.Move(100);
40
+        } else {
41
+            rob.Move(-100);
42
+        }
43
+    } catch (string e) {
44
+        //if (e.find("Timeout")==string.npos)
45
+        //    status=ROBOT_TIMED_OUT;
46
+
47
+
48
+    }
49
+
50
+    return rob.GetLastCommandStatus();;
51
+}
52
+
53
+int main() {
54
+    Robot myRobot;
55
+
56
+    if (myRobot.Open("/dev/ttyUSB0") == SUCCESS) { // ouverture de la com avec le robot
57
+
58
+        std::cout << "Start robot: ";
59
+        try {
60
+            myRobot.StartWithoutWatchdog();
61
+        } catch ( string e ) {
62
+            std::cerr << std::endl << e << std::endl;
63
+            return 1;
64
+        }
65
+
66
+        if (myRobot.GetLastCommandStatus()==SUCCESS)
67
+            std::cout << "Ok" <<std::endl;
68
+        else {
69
+            std::cout << " Error: GetLastCommand returns " << myRobot.GetLastCommandStatus() <<std::endl;
70
+            return 2;
71
+        }
72
+
73
+        std::cout << "Start stress test" << std::endl;
74
+        time_t t_debut, t_fin;
75
+        struct tm *tm_debut, *tm_fin;
76
+
77
+        time(&t_debut);
78
+        tm_debut = localtime((const time_t*)&t_debut);
79
+        std::cout << "[start time]: " << asctime(tm_debut) << std::endl;
80
+
81
+        nb_success =0;
82
+        nb_timeout =0;
83
+        nb_unknown_cmd =0;
84
+        flipflop = 0;
85
+
86
+        for (nb_test=0; nb_test < NB_TEST; nb_test++) {
87
+            laststatus=Test(myRobot);
88
+
89
+            if (flipflop ==0) flipflop=1;
90
+            else flipflop =0;
91
+
92
+            if (laststatus == SUCCESS) nb_success++;
93
+            else if (laststatus == TIMEOUT_COMMAND) nb_timeout++;
94
+            else if ((laststatus == INVALID_ANSWER) || (laststatus == INVALID_COMMAND)) nb_unknown_cmd ++;
95
+
96
+            std::cout << "Test " << nb_test << " [s " << nb_success
97
+                    << ": t " << nb_timeout << ": u " << nb_unknown_cmd
98
+                    << "]"<< "\x1B" <<"[30D"<<std::flush;
99
+
100
+            usleep(DELAY_BETWEEN_TEST);
101
+        }
102
+
103
+        time(&t_fin);
104
+        tm_fin = localtime((const time_t*)&t_fin);
105
+        std::cout << std::endl << std::endl << "[end time]: " << asctime(tm_fin) << std::endl;
106
+
107
+        std::cout << "Reset robot" <<std::endl;
108
+        myRobot.Reset();
109
+
110
+        std::cout << "Close com" <<std::endl;
111
+        myRobot.Close();
112
+
113
+    } else {
114
+        std::cerr << "Unable to open \\dev\\ttyUSB0" << std::endl;
115
+
116
+        return 2;
117
+    }
118
+
119
+    //    if (open_communication_robot("/dev/ttyUSB0") != 0) {
120
+    //        std::cout << "Unable to open com port" << std::endl;
121
+    //
122
+    //        return -1;
123
+    //    }
124
+    //
125
+    //    std::cout << "Debut du test de stress" << std::endl;
126
+    //    time_t t_debut, t_fin;
127
+    //    struct tm *tm_debut, *tm_fin;
128
+    //
129
+    //    time(&t_debut);
130
+    //    tm_debut = localtime((const time_t*)&t_debut);
131
+    //
132
+    //    std::cout << "[heure debut]: " << asctime(tm_debut) << std::endl;
133
+    //
134
+    //    nb_retries=-1;
135
+    //    do {
136
+    //        usleep(DELAY_BETWEEN_RETRIES);
137
+    //        nb_retries++;
138
+    //        laststatus = send_command_to_robot(DMB_START_WITHOUT_WD);
139
+    //    } while ((nb_retries<NB_RETRIES_MAX) && (laststatus != 0));
140
+    //
141
+    //    if(nb_retries == NB_RETRIES_MAX) {
142
+    //        std::cout << "Unable to start robot" <<std::endl;
143
+    //
144
+    //        return -1;
145
+    //    }
146
+    //
147
+    //    nb_success =0;
148
+    //    nb_timeout =0;
149
+    //    nb_unknown_cmd =0;
150
+    //    flipflop = 0;
151
+    //
152
+    //    for (nb_test=0; nb_test < NB_TEST; nb_test++) {
153
+    //        nb_retries=-1;
154
+    //
155
+    //        do {
156
+    //            usleep(DELAY_BETWEEN_RETRIES);
157
+    //            nb_retries++;
158
+    //            if (flipflop == 0) {
159
+    //                laststatus = send_command_to_robot(DMB_TURN, "100");
160
+    //            } else {
161
+    //                laststatus = send_command_to_robot(DMB_TURN, "-100");
162
+    //            }
163
+    //
164
+    //        } while ((nb_retries<NB_RETRIES_MAX) && (laststatus != 0));
165
+    //
166
+    //        if (flipflop ==0) flipflop=1;
167
+    //        else flipflop =0;
168
+    //
169
+    //        if (laststatus == 0) nb_success++;
170
+    //        else if (laststatus == ROBOT_TIMED_OUT) nb_timeout++;
171
+    //        else if (laststatus == ROBOT_UKNOWN_CMD) nb_unknown_cmd ++;
172
+    //
173
+    //        std::cout << "Test " << nb_test << " [s " << nb_success
174
+    //                  << ": t " << nb_timeout << ": u " << nb_unknown_cmd
175
+    //                  << "]"<< "\x1B" <<"[30D"<<std::flush;
176
+    //
177
+    //        usleep(DELAY_BETWEEN_TEST);
178
+    //    }
179
+    //
180
+    //    time(&t_fin);
181
+    //    tm_fin = localtime((const time_t*)&t_fin);
182
+    //
183
+    //    std::cout << std::endl << std::endl << "[heure fin]: " << asctime(tm_fin) << std::endl;
184
+
185
+    return 0;
186
+}

+ 111
- 0
software/raspberry/superviseur-robot/example/src/serverTest.cpp View File

@@ -0,0 +1,111 @@
1
+/*******************************************************************************
2
+ * Copyright (c) 2018 INSA - GEI, Toulouse, France.
3
+ * All rights reserved. This program and the accompanying materials
4
+ * are made available "AS IS", without any warranty of any kind.
5
+ *
6
+ * INSA assumes no responsibility for errors or omissions in the 
7
+ * software or documentation available. 
8
+ *
9
+ * Part of code Copyright ST Microelectronics.
10
+ *
11
+ * Contributors:
12
+ *     Lucien Senaneuch - Initial API and implementation
13
+ *     Sebastien DI MERCURIO - Maintainer since Octobre 2018
14
+ *******************************************************************************/
15
+
16
+#include <iostream>
17
+#include "Robot.h"
18
+#include "TcpServer.h"
19
+
20
+int main (void)
21
+{
22
+    TcpServer server;
23
+    int clientFD;
24
+    string msgIn, msgOut,tmp;
25
+    bool finish;
26
+
27
+    Robot robot;
28
+
29
+    cout << "TCP server example" << endl;
30
+
31
+    cout << "Bind and listen on port 1337: ";
32
+    try {
33
+        server.Listen(1337);
34
+    }
35
+    catch ( const invalid_argument &ia ) {
36
+        cerr << "Error binding server: " << ia.what() << endl;
37
+        return 1;
38
+    }
39
+
40
+    cout << "Ok" <<endl;
41
+
42
+    cout << "Open com with robot: ";
43
+    try {
44
+        robot.Open ("/dev/ttyUSB0");
45
+    } catch (string e)
46
+    {
47
+        cerr << e << endl;
48
+        return 3;
49
+    }
50
+
51
+    cout << "Ok" <<endl;
52
+
53
+    while (1)
54
+    {
55
+        cout << "Wait for client to connect: ";
56
+        try {
57
+            clientFD= server.AcceptClient();
58
+        }
59
+        catch ( const invalid_argument &ia ) {
60
+            cerr << "Error during client accept: " << ia.what() << endl;
61
+            return 2;
62
+        }
63
+
64
+        cout << to_string(clientFD) << endl;
65
+
66
+        msgIn.clear();
67
+        finish=false;
68
+
69
+        do {
70
+            msgIn = server.Receive(clientFD, 2); // cmd + \n
71
+
72
+            if (msgIn.empty()) finish=true;
73
+            else {
74
+                try {
75
+                    switch (msgIn[0]) {
76
+                        case 's':
77
+                            // Start robot
78
+                            robot.StartWithoutWatchdog();
79
+                            break;
80
+                        case 'f':
81
+                            robot.Move(100);
82
+                            break;
83
+                        case 'b':
84
+                            robot.Move(-100);
85
+                            break;
86
+                        case 'r':
87
+                            robot.Turn(90);
88
+                            break;
89
+                        case 'l':
90
+                            robot.Turn(-90);
91
+                            break;
92
+                        case 'Q':
93
+                            robot.Reset();
94
+                            break;
95
+                    }
96
+                } catch (string e) {
97
+                    cerr << e;
98
+                }
99
+
100
+                if (robot.GetLastCommandStatus() == SUCCESS)
101
+                    server.Send(clientFD, "OK\n");
102
+                else server.Send(clientFD, "ERR\n");
103
+            }
104
+        } while (finish==false);
105
+
106
+        cout << "Client disconnected" <<endl;
107
+        clientFD=-1;
108
+    }
109
+
110
+    return 0;
111
+}

+ 0
- 8
software/raspberry/superviseur-robot/example/stress/.gitignore View File

@@ -1,8 +0,0 @@
1
-*.o
2
-*.d
3
-CMakeTmp
4
-stress.dir
5
-3.9.6
6
-*.log
7
-*.bin
8
-

+ 0
- 29
software/raspberry/superviseur-robot/example/stress/.idea/codeStyles/Project.xml View File

@@ -1,29 +0,0 @@
1
-<component name="ProjectCodeStyleConfiguration">
2
-  <code_scheme name="Project" version="173">
3
-    <Objective-C-extensions>
4
-      <file>
5
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
6
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
7
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
8
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
9
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
10
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
11
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
12
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
13
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
14
-      </file>
15
-      <class>
16
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
17
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
18
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
19
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
20
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
21
-        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
22
-      </class>
23
-      <extensions>
24
-        <pair source="cpp" header="h" fileNamingConvention="NONE" />
25
-        <pair source="c" header="h" fileNamingConvention="NONE" />
26
-      </extensions>
27
-    </Objective-C-extensions>
28
-  </code_scheme>
29
-</component>

+ 0
- 4
software/raspberry/superviseur-robot/example/stress/.idea/misc.xml View File

@@ -1,4 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
4
-</project>

+ 0
- 8
software/raspberry/superviseur-robot/example/stress/.idea/modules.xml View File

@@ -1,8 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="ProjectModuleManager">
4
-    <modules>
5
-      <module fileurl="file://$PROJECT_DIR$/.idea/stress.iml" filepath="$PROJECT_DIR$/.idea/stress.iml" />
6
-    </modules>
7
-  </component>
8
-</project>

+ 0
- 2
software/raspberry/superviseur-robot/example/stress/.idea/stress.iml View File

@@ -1,2 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<module classpath="CMake" type="CPP_MODULE" version="4" />

+ 0
- 6
software/raspberry/superviseur-robot/example/stress/.idea/vcs.xml View File

@@ -1,6 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="VcsDirectoryMappings">
4
-    <mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
5
-  </component>
6
-</project>

+ 0
- 294
software/raspberry/superviseur-robot/example/stress/.idea/workspace.xml View File

@@ -1,294 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="CMakeRunConfigurationManager" shouldGenerate="true" shouldDeleteObsolete="true" buildAllGenerated="true">
4
-    <generated>
5
-      <config projectName="stress" targetName="stress" />
6
-    </generated>
7
-  </component>
8
-  <component name="CMakeSettings">
9
-    <configurations>
10
-      <configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
11
-    </configurations>
12
-  </component>
13
-  <component name="ChangeListManager">
14
-    <list default="true" id="6f68a0e1-52e9-471a-8d47-af63db94b711" name="Default" comment="">
15
-      <change beforePath="" afterPath="$PROJECT_DIR$/.idea/codeStyles/Project.xml" />
16
-      <change beforePath="" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
17
-      <change beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
18
-    </list>
19
-    <ignored path="$PROJECT_DIR$/cmake-build-debug/" />
20
-    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
21
-    <option name="TRACKING_ENABLED" value="true" />
22
-    <option name="SHOW_DIALOG" value="false" />
23
-    <option name="HIGHLIGHT_CONFLICTS" value="true" />
24
-    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
25
-    <option name="LAST_RESOLUTION" value="IGNORE" />
26
-  </component>
27
-  <component name="ExecutionTargetManager" SELECTED_TARGET="CMakeBuildProfile:Debug" />
28
-  <component name="FileEditorManager">
29
-    <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
30
-      <file leaf-file-name="CMakeLists.txt" pinned="false" current-in-tab="false">
31
-        <entry file="file://$PROJECT_DIR$/CMakeLists.txt">
32
-          <provider selected="true" editor-type-id="text-editor">
33
-            <state relative-caret-position="108">
34
-              <caret line="6" column="16" lean-forward="false" selection-start-line="6" selection-start-column="16" selection-end-line="6" selection-end-column="16" />
35
-              <folding />
36
-            </state>
37
-          </provider>
38
-        </entry>
39
-      </file>
40
-      <file leaf-file-name="main.cpp" pinned="false" current-in-tab="false">
41
-        <entry file="file://$PROJECT_DIR$/main.cpp">
42
-          <provider selected="true" editor-type-id="text-editor">
43
-            <state relative-caret-position="144">
44
-              <caret line="8" column="28" lean-forward="false" selection-start-line="8" selection-start-column="28" selection-end-line="8" selection-end-column="28" />
45
-              <folding>
46
-                <element signature="e#0#19#0" expanded="true" />
47
-              </folding>
48
-            </state>
49
-          </provider>
50
-        </entry>
51
-      </file>
52
-      <file leaf-file-name="robot.h" pinned="false" current-in-tab="false">
53
-        <entry file="file://$PROJECT_DIR$/../../src/robot.h">
54
-          <provider selected="true" editor-type-id="text-editor">
55
-            <state relative-caret-position="-378">
56
-              <caret line="18" column="19" lean-forward="true" selection-start-line="18" selection-start-column="19" selection-end-line="18" selection-end-column="19" />
57
-              <folding />
58
-            </state>
59
-          </provider>
60
-        </entry>
61
-      </file>
62
-      <file leaf-file-name="robot.cpp" pinned="false" current-in-tab="true">
63
-        <entry file="file://$PROJECT_DIR$/../../src/robot.cpp">
64
-          <provider selected="true" editor-type-id="text-editor">
65
-            <state relative-caret-position="-1890">
66
-              <caret line="6" column="9" lean-forward="true" selection-start-line="6" selection-start-column="9" selection-end-line="6" selection-end-column="9" />
67
-              <folding />
68
-            </state>
69
-          </provider>
70
-        </entry>
71
-      </file>
72
-      <file leaf-file-name="definitions.h" pinned="false" current-in-tab="false">
73
-        <entry file="file://$PROJECT_DIR$/../../src/definitions.h">
74
-          <provider selected="true" editor-type-id="text-editor">
75
-            <state relative-caret-position="252">
76
-              <caret line="35" column="24" lean-forward="false" selection-start-line="35" selection-start-column="8" selection-end-line="35" selection-end-column="24" />
77
-              <folding />
78
-            </state>
79
-          </provider>
80
-        </entry>
81
-      </file>
82
-    </leaf>
83
-  </component>
84
-  <component name="Git.Settings">
85
-    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
86
-  </component>
87
-  <component name="IdeDocumentHistory">
88
-    <option name="CHANGED_PATHS">
89
-      <list>
90
-        <option value="$PROJECT_DIR$/CMakeLists.txt" />
91
-        <option value="$PROJECT_DIR$/main.cpp" />
92
-      </list>
93
-    </option>
94
-  </component>
95
-  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
96
-  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
97
-  <component name="JsGulpfileManager">
98
-    <detection-done>true</detection-done>
99
-    <sorting>DEFINITION_ORDER</sorting>
100
-  </component>
101
-  <component name="ProjectFrameBounds">
102
-    <option name="x" value="331" />
103
-    <option name="y" value="64" />
104
-    <option name="width" value="1400" />
105
-    <option name="height" value="873" />
106
-  </component>
107
-  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
108
-  <component name="ProjectView">
109
-    <navigator currentView="ProjectPane" proportions="" version="1">
110
-      <flattenPackages />
111
-      <showMembers />
112
-      <showModules />
113
-      <showLibraryContents />
114
-      <hideEmptyPackages />
115
-      <abbreviatePackageNames />
116
-      <autoscrollToSource />
117
-      <autoscrollFromSource />
118
-      <sortByType />
119
-      <manualOrder />
120
-      <foldersAlwaysOnTop value="true" />
121
-    </navigator>
122
-    <panes>
123
-      <pane id="ProjectPane">
124
-        <subPane>
125
-          <expand>
126
-            <path>
127
-              <item name="stress" type="dad4c3:CidrFilesViewHelper$MyProjectTreeStructure$1" />
128
-              <item name="stress" type="47feb1d3:ProjectViewModuleNode" />
129
-            </path>
130
-            <path>
131
-              <item name="stress" type="dad4c3:CidrFilesViewHelper$MyProjectTreeStructure$1" />
132
-              <item name="stress" type="47feb1d3:ProjectViewModuleNode" />
133
-              <item name="stress" type="462c0819:PsiDirectoryNode" />
134
-            </path>
135
-            <path>
136
-              <item name="stress" type="dad4c3:CidrFilesViewHelper$MyProjectTreeStructure$1" />
137
-              <item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
138
-            </path>
139
-            <path>
140
-              <item name="stress" type="dad4c3:CidrFilesViewHelper$MyProjectTreeStructure$1" />
141
-              <item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
142
-              <item name="Header Search Paths" type="70bed36:NamedLibraryElementNode" />
143
-            </path>
144
-          </expand>
145
-          <select />
146
-        </subPane>
147
-      </pane>
148
-    </panes>
149
-  </component>
150
-  <component name="PropertiesComponent">
151
-    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
152
-    <property name="WebServerToolWindowFactoryState" value="false" />
153
-    <property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
154
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../src/definitions.h" />
155
-  </component>
156
-  <component name="RunDashboard">
157
-    <option name="ruleStates">
158
-      <list>
159
-        <RuleState>
160
-          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
161
-        </RuleState>
162
-        <RuleState>
163
-          <option name="name" value="StatusDashboardGroupingRule" />
164
-        </RuleState>
165
-      </list>
166
-    </option>
167
-  </component>
168
-  <component name="RunManager" selected="Application.stress">
169
-    <configuration name="Build All" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS_2="true" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="stress" RUN_TARGET_NAME="stress" EXPLICIT_BUILD_TARGET_NAME="all">
170
-      <envs />
171
-    </configuration>
172
-    <configuration name="stress" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS_2="true" PROJECT_NAME="stress" TARGET_NAME="stress" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="stress" RUN_TARGET_NAME="stress">
173
-      <envs />
174
-    </configuration>
175
-    <list size="2">
176
-      <item index="0" class="java.lang.String" itemvalue="Application.Build All" />
177
-      <item index="1" class="java.lang.String" itemvalue="Application.stress" />
178
-    </list>
179
-  </component>
180
-  <component name="ShelveChangesManager" show_recycled="false">
181
-    <option name="remove_strategy" value="false" />
182
-  </component>
183
-  <component name="TaskManager">
184
-    <task active="true" id="Default" summary="Default task">
185
-      <changelist id="6f68a0e1-52e9-471a-8d47-af63db94b711" name="Default" comment="" />
186
-      <created>1518169204762</created>
187
-      <option name="number" value="Default" />
188
-      <option name="presentableId" value="Default" />
189
-      <updated>1518169204762</updated>
190
-      <workItem from="1518169206682" duration="106000" />
191
-      <workItem from="1518169334602" duration="6358000" />
192
-    </task>
193
-    <servers />
194
-  </component>
195
-  <component name="TimeTrackingManager">
196
-    <option name="totallyTimeSpent" value="6464000" />
197
-  </component>
198
-  <component name="ToolWindowManager">
199
-    <frame x="331" y="64" width="1400" height="873" extended-state="0" />
200
-    <editor active="true" />
201
-    <layout>
202
-      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18785714" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
203
-      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
204
-      <window_info id="Messages" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18037136" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
205
-      <window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.47612733" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
206
-      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
207
-      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
208
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
209
-      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
210
-      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
211
-      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
212
-      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
213
-      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
214
-      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
215
-      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
216
-      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
217
-      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
218
-      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
219
-      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
220
-    </layout>
221
-  </component>
222
-  <component name="TypeScriptGeneratedFilesManager">
223
-    <option name="version" value="1" />
224
-  </component>
225
-  <component name="VcsContentAnnotationSettings">
226
-    <option name="myLimit" value="2678400000" />
227
-  </component>
228
-  <component name="XDebuggerManager">
229
-    <breakpoint-manager />
230
-    <watches-manager />
231
-  </component>
232
-  <component name="editorHistoryManager">
233
-    <entry file="file://$PROJECT_DIR$/CMakeLists.txt">
234
-      <provider selected="true" editor-type-id="text-editor">
235
-        <state relative-caret-position="0">
236
-          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
237
-          <folding />
238
-        </state>
239
-      </provider>
240
-    </entry>
241
-    <entry file="file://$PROJECT_DIR$/main.cpp">
242
-      <provider selected="true" editor-type-id="text-editor">
243
-        <state relative-caret-position="0">
244
-          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
245
-          <folding>
246
-            <element signature="e#0#19#0" expanded="true" />
247
-          </folding>
248
-        </state>
249
-      </provider>
250
-    </entry>
251
-    <entry file="file://$PROJECT_DIR$/CMakeLists.txt">
252
-      <provider selected="true" editor-type-id="text-editor">
253
-        <state relative-caret-position="108">
254
-          <caret line="6" column="16" lean-forward="false" selection-start-line="6" selection-start-column="16" selection-end-line="6" selection-end-column="16" />
255
-          <folding />
256
-        </state>
257
-      </provider>
258
-    </entry>
259
-    <entry file="file://$PROJECT_DIR$/../../src/definitions.h">
260
-      <provider selected="true" editor-type-id="text-editor">
261
-        <state relative-caret-position="252">
262
-          <caret line="35" column="24" lean-forward="false" selection-start-line="35" selection-start-column="8" selection-end-line="35" selection-end-column="24" />
263
-          <folding />
264
-        </state>
265
-      </provider>
266
-    </entry>
267
-    <entry file="file://$PROJECT_DIR$/main.cpp">
268
-      <provider selected="true" editor-type-id="text-editor">
269
-        <state relative-caret-position="144">
270
-          <caret line="8" column="28" lean-forward="false" selection-start-line="8" selection-start-column="28" selection-end-line="8" selection-end-column="28" />
271
-          <folding>
272
-            <element signature="e#0#19#0" expanded="true" />
273
-          </folding>
274
-        </state>
275
-      </provider>
276
-    </entry>
277
-    <entry file="file://$PROJECT_DIR$/../../src/robot.h">
278
-      <provider selected="true" editor-type-id="text-editor">
279
-        <state relative-caret-position="-378">
280
-          <caret line="18" column="19" lean-forward="true" selection-start-line="18" selection-start-column="19" selection-end-line="18" selection-end-column="19" />
281
-          <folding />
282
-        </state>
283
-      </provider>
284
-    </entry>
285
-    <entry file="file://$PROJECT_DIR$/../../src/robot.cpp">
286
-      <provider selected="true" editor-type-id="text-editor">
287
-        <state relative-caret-position="-1890">
288
-          <caret line="6" column="9" lean-forward="true" selection-start-line="6" selection-start-column="9" selection-end-line="6" selection-end-column="9" />
289
-          <folding />
290
-        </state>
291
-      </provider>
292
-    </entry>
293
-  </component>
294
-</project>

+ 0
- 355
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeCache.txt
File diff suppressed because it is too large
View File


+ 0
- 16
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/CMakeDirectoryInformation.cmake View File

@@ -1,16 +0,0 @@
1
-# CMAKE generated file: DO NOT EDIT!
2
-# Generated by "Unix Makefiles" Generator, CMake Version 3.9
3
-
4
-# Relative path conversion top directories.
5
-set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/dimercur/Travail/git/C-TP-RT/example/stress")
6
-set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug")
7
-
8
-# Force unix paths in dependencies.
9
-set(CMAKE_FORCE_UNIX_PATHS 1)
10
-
11
-
12
-# The C and CXX include file regular expressions for this directory.
13
-set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
14
-set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
15
-set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
16
-set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})

+ 0
- 49
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/Makefile.cmake View File

@@ -1,49 +0,0 @@
1
-# CMAKE generated file: DO NOT EDIT!
2
-# Generated by "Unix Makefiles" Generator, CMake Version 3.9
3
-
4
-# The generator used is:
5
-set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
6
-
7
-# The top level Makefile was generated from the following files:
8
-set(CMAKE_MAKEFILE_DEPENDS
9
-  "CMakeCache.txt"
10
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/CMakeCInformation.cmake"
11
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/CMakeCXXInformation.cmake"
12
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/CMakeCommonLanguageInclude.cmake"
13
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake"
14
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/CMakeFindCodeBlocks.cmake"
15
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/CMakeGenericSystem.cmake"
16
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/CMakeLanguageInformation.cmake"
17
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/CMakeSystemSpecificInformation.cmake"
18
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/CMakeSystemSpecificInitialize.cmake"
19
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/Compiler/CMakeCommonCompilerMacros.cmake"
20
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/Compiler/GNU-C.cmake"
21
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/Compiler/GNU-CXX.cmake"
22
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/Compiler/GNU.cmake"
23
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/Platform/Linux-GNU-C.cmake"
24
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/Platform/Linux-GNU-CXX.cmake"
25
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/Platform/Linux-GNU.cmake"
26
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/Platform/Linux.cmake"
27
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/Platform/UnixPaths.cmake"
28
-  "/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/share/cmake-3.9/Modules/ProcessorCount.cmake"
29
-  "../CMakeLists.txt"
30
-  "CMakeFiles/3.9.6/CMakeCCompiler.cmake"
31
-  "CMakeFiles/3.9.6/CMakeCXXCompiler.cmake"
32
-  "CMakeFiles/3.9.6/CMakeSystem.cmake"
33
-  )
34
-
35
-# The corresponding makefile is:
36
-set(CMAKE_MAKEFILE_OUTPUTS
37
-  "Makefile"
38
-  "CMakeFiles/cmake.check_cache"
39
-  )
40
-
41
-# Byproducts of CMake generate step:
42
-set(CMAKE_MAKEFILE_PRODUCTS
43
-  "CMakeFiles/CMakeDirectoryInformation.cmake"
44
-  )
45
-
46
-# Dependency information for all targets:
47
-set(CMAKE_DEPEND_INFO_FILES
48
-  "CMakeFiles/stress.dir/DependInfo.cmake"
49
-  )

+ 0
- 108
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/Makefile2 View File

@@ -1,108 +0,0 @@
1
-# CMAKE generated file: DO NOT EDIT!
2
-# Generated by "Unix Makefiles" Generator, CMake Version 3.9
3
-
4
-# Default target executed when no arguments are given to make.
5
-default_target: all
6
-
7
-.PHONY : default_target
8
-
9
-# The main recursive all target
10
-all:
11
-
12
-.PHONY : all
13
-
14
-# The main recursive preinstall target
15
-preinstall:
16
-
17
-.PHONY : preinstall
18
-
19
-#=============================================================================
20
-# Special targets provided by cmake.
21
-
22
-# Disable implicit rules so canonical targets will work.
23
-.SUFFIXES:
24
-
25
-
26
-# Remove some rules from gmake that .SUFFIXES does not remove.
27
-SUFFIXES =
28
-
29
-.SUFFIXES: .hpux_make_needs_suffix_list
30
-
31
-
32
-# Suppress display of executed commands.
33
-$(VERBOSE).SILENT:
34
-
35
-
36
-# A target that is always out of date.
37
-cmake_force:
38
-
39
-.PHONY : cmake_force
40
-
41
-#=============================================================================
42
-# Set environment variables for the build.
43
-
44
-# The shell in which to execute make rules.
45
-SHELL = /bin/sh
46
-
47
-# The CMake executable.
48
-CMAKE_COMMAND = /home/Applications/JetBrains/clion-2017.3.3/bin/cmake/bin/cmake
49
-
50
-# The command to remove a file.
51
-RM = /home/Applications/JetBrains/clion-2017.3.3/bin/cmake/bin/cmake -E remove -f
52
-
53
-# Escaping for special characters.
54
-EQUALS = =
55
-
56
-# The top-level source directory on which CMake was run.
57
-CMAKE_SOURCE_DIR = /home/dimercur/Travail/git/C-TP-RT/example/stress
58
-
59
-# The top-level build directory on which CMake was run.
60
-CMAKE_BINARY_DIR = /home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug
61
-
62
-#=============================================================================
63
-# Target rules for target CMakeFiles/stress.dir
64
-
65
-# All Build rule for target.
66
-CMakeFiles/stress.dir/all:
67
-	$(MAKE) -f CMakeFiles/stress.dir/build.make CMakeFiles/stress.dir/depend
68
-	$(MAKE) -f CMakeFiles/stress.dir/build.make CMakeFiles/stress.dir/build
69
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/CMakeFiles --progress-num=1,2,3 "Built target stress"
70
-.PHONY : CMakeFiles/stress.dir/all
71
-
72
-# Include target in all.
73
-all: CMakeFiles/stress.dir/all
74
-
75
-.PHONY : all
76
-
77
-# Build rule for subdir invocation for target.
78
-CMakeFiles/stress.dir/rule: cmake_check_build_system
79
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/CMakeFiles 3
80
-	$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/stress.dir/all
81
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/CMakeFiles 0
82
-.PHONY : CMakeFiles/stress.dir/rule
83
-
84
-# Convenience name for target.
85
-stress: CMakeFiles/stress.dir/rule
86
-
87
-.PHONY : stress
88
-
89
-# clean rule for target.
90
-CMakeFiles/stress.dir/clean:
91
-	$(MAKE) -f CMakeFiles/stress.dir/build.make CMakeFiles/stress.dir/clean
92
-.PHONY : CMakeFiles/stress.dir/clean
93
-
94
-# clean rule for target.
95
-clean: CMakeFiles/stress.dir/clean
96
-
97
-.PHONY : clean
98
-
99
-#=============================================================================
100
-# Special targets to cleanup operation of make.
101
-
102
-# Special rule to run CMake to check the build system integrity.
103
-# No rule that depends on this can have commands that come from listfiles
104
-# because they might be regenerated.
105
-cmake_check_build_system:
106
-	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
107
-.PHONY : cmake_check_build_system
108
-

+ 0
- 3
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/TargetDirectories.txt View File

@@ -1,3 +0,0 @@
1
-/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/CMakeFiles/rebuild_cache.dir
2
-/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/CMakeFiles/edit_cache.dir
3
-/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/CMakeFiles/stress.dir

+ 0
- 3
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/clion-environment.txt View File

@@ -1,3 +0,0 @@
1
-Options: 
2
-
3
-Options:

+ 0
- 1
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/clion-log.txt View File

@@ -1,4 +0,0 @@
1
-/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/dimercur/Travail/git/C-TP-RT/example/stress

+ 0
- 1
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/cmake.check_cache View File

@@ -1 +0,0 @@
1
-# This file is generated by cmake for dependency checking of the CMakeCache.txt file

+ 0
- 34
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/feature_tests.c View File

@@ -1,34 +0,0 @@
1
-
2
-  const char features[] = {"\n"
3
-"C_FEATURE:"
4
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304
5
-"1"
6
-#else
7
-"0"
8
-#endif
9
-"c_function_prototypes\n"
10
-"C_FEATURE:"
11
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
12
-"1"
13
-#else
14
-"0"
15
-#endif
16
-"c_restrict\n"
17
-"C_FEATURE:"
18
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L
19
-"1"
20
-#else
21
-"0"
22
-#endif
23
-"c_static_assert\n"
24
-"C_FEATURE:"
25
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
26
-"1"
27
-#else
28
-"0"
29
-#endif
30
-"c_variadic_macros\n"
31
-
32
-};
33
-
34
-int main(int argc, char** argv) { (void)argv; return features[argc]; }

+ 0
- 405
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/feature_tests.cxx View File

@@ -1,405 +0,0 @@
1
-
2
-  const char features[] = {"\n"
3
-"CXX_FEATURE:"
4
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L
5
-"1"
6
-#else
7
-"0"
8
-#endif
9
-"cxx_aggregate_default_initializers\n"
10
-"CXX_FEATURE:"
11
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
12
-"1"
13
-#else
14
-"0"
15
-#endif
16
-"cxx_alias_templates\n"
17
-"CXX_FEATURE:"
18
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L
19
-"1"
20
-#else
21
-"0"
22
-#endif
23
-"cxx_alignas\n"
24
-"CXX_FEATURE:"
25
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L
26
-"1"
27
-#else
28
-"0"
29
-#endif
30
-"cxx_alignof\n"
31
-"CXX_FEATURE:"
32
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L
33
-"1"
34
-#else
35
-"0"
36
-#endif
37
-"cxx_attributes\n"
38
-"CXX_FEATURE:"
39
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
40
-"1"
41
-#else
42
-"0"
43
-#endif
44
-"cxx_attribute_deprecated\n"
45
-"CXX_FEATURE:"
46
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
47
-"1"
48
-#else
49
-"0"
50
-#endif
51
-"cxx_auto_type\n"
52
-"CXX_FEATURE:"
53
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
54
-"1"
55
-#else
56
-"0"
57
-#endif
58
-"cxx_binary_literals\n"
59
-"CXX_FEATURE:"
60
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
61
-"1"
62
-#else
63
-"0"
64
-#endif
65
-"cxx_constexpr\n"
66
-"CXX_FEATURE:"
67
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
68
-"1"
69
-#else
70
-"0"
71
-#endif
72
-"cxx_contextual_conversions\n"
73
-"CXX_FEATURE:"
74
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
75
-"1"
76
-#else
77
-"0"
78
-#endif
79
-"cxx_decltype\n"
80
-"CXX_FEATURE:"
81
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
82
-"1"
83
-#else
84
-"0"
85
-#endif
86
-"cxx_decltype_auto\n"
87
-"CXX_FEATURE:"
88
-#if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L
89
-"1"
90
-#else
91
-"0"
92
-#endif
93
-"cxx_decltype_incomplete_return_types\n"
94
-"CXX_FEATURE:"
95
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
96
-"1"
97
-#else
98
-"0"
99
-#endif
100
-"cxx_default_function_template_args\n"
101
-"CXX_FEATURE:"
102
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
103
-"1"
104
-#else
105
-"0"
106
-#endif
107
-"cxx_defaulted_functions\n"
108
-"CXX_FEATURE:"
109
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
110
-"1"
111
-#else
112
-"0"
113
-#endif
114
-"cxx_defaulted_move_initializers\n"
115
-"CXX_FEATURE:"
116
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
117
-"1"
118
-#else
119
-"0"
120
-#endif
121
-"cxx_delegating_constructors\n"
122
-"CXX_FEATURE:"
123
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
124
-"1"
125
-#else
126
-"0"
127
-#endif
128
-"cxx_deleted_functions\n"
129
-"CXX_FEATURE:"
130
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
131
-"1"
132
-#else
133
-"0"
134
-#endif
135
-"cxx_digit_separators\n"
136
-"CXX_FEATURE:"
137
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
138
-"1"
139
-#else
140
-"0"
141
-#endif
142
-"cxx_enum_forward_declarations\n"
143
-"CXX_FEATURE:"
144
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
145
-"1"
146
-#else
147
-"0"
148
-#endif
149
-"cxx_explicit_conversions\n"
150
-"CXX_FEATURE:"
151
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
152
-"1"
153
-#else
154
-"0"
155
-#endif
156
-"cxx_extended_friend_declarations\n"
157
-"CXX_FEATURE:"
158
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
159
-"1"
160
-#else
161
-"0"
162
-#endif
163
-"cxx_extern_templates\n"
164
-"CXX_FEATURE:"
165
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
166
-"1"
167
-#else
168
-"0"
169
-#endif
170
-"cxx_final\n"
171
-"CXX_FEATURE:"
172
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
173
-"1"
174
-#else
175
-"0"
176
-#endif
177
-"cxx_func_identifier\n"
178
-"CXX_FEATURE:"
179
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
180
-"1"
181
-#else
182
-"0"
183
-#endif
184
-"cxx_generalized_initializers\n"
185
-"CXX_FEATURE:"
186
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
187
-"1"
188
-#else
189
-"0"
190
-#endif
191
-"cxx_generic_lambdas\n"
192
-"CXX_FEATURE:"
193
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L
194
-"1"
195
-#else
196
-"0"
197
-#endif
198
-"cxx_inheriting_constructors\n"
199
-"CXX_FEATURE:"
200
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
201
-"1"
202
-#else
203
-"0"
204
-#endif
205
-"cxx_inline_namespaces\n"
206
-"CXX_FEATURE:"
207
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
208
-"1"
209
-#else
210
-"0"
211
-#endif
212
-"cxx_lambdas\n"
213
-"CXX_FEATURE:"
214
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
215
-"1"
216
-#else
217
-"0"
218
-#endif
219
-"cxx_lambda_init_captures\n"
220
-"CXX_FEATURE:"
221
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
222
-"1"
223
-#else
224
-"0"
225
-#endif
226
-"cxx_local_type_template_args\n"
227
-"CXX_FEATURE:"
228
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
229
-"1"
230
-#else
231
-"0"
232
-#endif
233
-"cxx_long_long_type\n"
234
-"CXX_FEATURE:"
235
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
236
-"1"
237
-#else
238
-"0"
239
-#endif
240
-"cxx_noexcept\n"
241
-"CXX_FEATURE:"
242
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
243
-"1"
244
-#else
245
-"0"
246
-#endif
247
-"cxx_nonstatic_member_init\n"
248
-"CXX_FEATURE:"
249
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
250
-"1"
251
-#else
252
-"0"
253
-#endif
254
-"cxx_nullptr\n"
255
-"CXX_FEATURE:"
256
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
257
-"1"
258
-#else
259
-"0"
260
-#endif
261
-"cxx_override\n"
262
-"CXX_FEATURE:"
263
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
264
-"1"
265
-#else
266
-"0"
267
-#endif
268
-"cxx_range_for\n"
269
-"CXX_FEATURE:"
270
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
271
-"1"
272
-#else
273
-"0"
274
-#endif
275
-"cxx_raw_string_literals\n"
276
-"CXX_FEATURE:"
277
-#if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40801) && __cplusplus >= 201103L
278
-"1"
279
-#else
280
-"0"
281
-#endif
282
-"cxx_reference_qualified_functions\n"
283
-"CXX_FEATURE:"
284
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L
285
-"1"
286
-#else
287
-"0"
288
-#endif
289
-"cxx_relaxed_constexpr\n"
290
-"CXX_FEATURE:"
291
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L
292
-"1"
293
-#else
294
-"0"
295
-#endif
296
-"cxx_return_type_deduction\n"
297
-"CXX_FEATURE:"
298
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
299
-"1"
300
-#else
301
-"0"
302
-#endif
303
-"cxx_right_angle_brackets\n"
304
-"CXX_FEATURE:"
305
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
306
-"1"
307
-#else
308
-"0"
309
-#endif
310
-"cxx_rvalue_references\n"
311
-"CXX_FEATURE:"
312
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
313
-"1"
314
-#else
315
-"0"
316
-#endif
317
-"cxx_sizeof_member\n"
318
-"CXX_FEATURE:"
319
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
320
-"1"
321
-#else
322
-"0"
323
-#endif
324
-"cxx_static_assert\n"
325
-"CXX_FEATURE:"
326
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
327
-"1"
328
-#else
329
-"0"
330
-#endif
331
-"cxx_strong_enums\n"
332
-"CXX_FEATURE:"
333
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && __cplusplus
334
-"1"
335
-#else
336
-"0"
337
-#endif
338
-"cxx_template_template_parameters\n"
339
-"CXX_FEATURE:"
340
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L
341
-"1"
342
-#else
343
-"0"
344
-#endif
345
-"cxx_thread_local\n"
346
-"CXX_FEATURE:"
347
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
348
-"1"
349
-#else
350
-"0"
351
-#endif
352
-"cxx_trailing_return_types\n"
353
-"CXX_FEATURE:"
354
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
355
-"1"
356
-#else
357
-"0"
358
-#endif
359
-"cxx_unicode_literals\n"
360
-"CXX_FEATURE:"
361
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
362
-"1"
363
-#else
364
-"0"
365
-#endif
366
-"cxx_uniform_initialization\n"
367
-"CXX_FEATURE:"
368
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
369
-"1"
370
-#else
371
-"0"
372
-#endif
373
-"cxx_unrestricted_unions\n"
374
-"CXX_FEATURE:"
375
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && __cplusplus >= 201103L
376
-"1"
377
-#else
378
-"0"
379
-#endif
380
-"cxx_user_literals\n"
381
-"CXX_FEATURE:"
382
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L
383
-"1"
384
-#else
385
-"0"
386
-#endif
387
-"cxx_variable_templates\n"
388
-"CXX_FEATURE:"
389
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
390
-"1"
391
-#else
392
-"0"
393
-#endif
394
-"cxx_variadic_macros\n"
395
-"CXX_FEATURE:"
396
-#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && (__cplusplus >= 201103L || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__))
397
-"1"
398
-#else
399
-"0"
400
-#endif
401
-"cxx_variadic_templates\n"
402
-
403
-};
404
-
405
-int main(int argc, char** argv) { (void)argv; return features[argc]; }

+ 0
- 1
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/CMakeFiles/progress.marks View File

@@ -1 +0,0 @@
1
-3

+ 0
- 208
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/Makefile View File

@@ -1,208 +0,0 @@
1
-# CMAKE generated file: DO NOT EDIT!
2
-# Generated by "Unix Makefiles" Generator, CMake Version 3.9
3
-
4
-# Default target executed when no arguments are given to make.
5
-default_target: all
6
-
7
-.PHONY : default_target
8
-
9
-# Allow only one "make -f Makefile2" at a time, but pass parallelism.
10
-.NOTPARALLEL:
11
-
12
-
13
-#=============================================================================
14
-# Special targets provided by cmake.
15
-
16
-# Disable implicit rules so canonical targets will work.
17
-.SUFFIXES:
18
-
19
-
20
-# Remove some rules from gmake that .SUFFIXES does not remove.
21
-SUFFIXES =
22
-
23
-.SUFFIXES: .hpux_make_needs_suffix_list
24
-
25
-
26
-# Suppress display of executed commands.
27
-$(VERBOSE).SILENT:
28
-
29
-
30
-# A target that is always out of date.
31
-cmake_force:
32
-
33
-.PHONY : cmake_force
34
-
35
-#=============================================================================
36
-# Set environment variables for the build.
37
-
38
-# The shell in which to execute make rules.
39
-SHELL = /bin/sh
40
-
41
-# The CMake executable.
42
-CMAKE_COMMAND = /home/Applications/JetBrains/clion-2017.3.3/bin/cmake/bin/cmake
43
-
44
-# The command to remove a file.
45
-RM = /home/Applications/JetBrains/clion-2017.3.3/bin/cmake/bin/cmake -E remove -f
46
-
47
-# Escaping for special characters.
48
-EQUALS = =
49
-
50
-# The top-level source directory on which CMake was run.
51
-CMAKE_SOURCE_DIR = /home/dimercur/Travail/git/C-TP-RT/example/stress
52
-
53
-# The top-level build directory on which CMake was run.
54
-CMAKE_BINARY_DIR = /home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug
55
-
56
-#=============================================================================
57
-# Targets provided globally by CMake.
58
-
59
-# Special rule for the target rebuild_cache
60
-rebuild_cache:
61
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
62
-	/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
63
-.PHONY : rebuild_cache
64
-
65
-# Special rule for the target rebuild_cache
66
-rebuild_cache/fast: rebuild_cache
67
-
68
-.PHONY : rebuild_cache/fast
69
-
70
-# Special rule for the target edit_cache
71
-edit_cache:
72
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
73
-	/home/Applications/JetBrains/clion-2017.3.3/bin/cmake/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
74
-.PHONY : edit_cache
75
-
76
-# Special rule for the target edit_cache
77
-edit_cache/fast: edit_cache
78
-
79
-.PHONY : edit_cache/fast
80
-
81
-# The main all target
82
-all: cmake_check_build_system
83
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/CMakeFiles /home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/CMakeFiles/progress.marks
84
-	$(MAKE) -f CMakeFiles/Makefile2 all
85
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/CMakeFiles 0
86
-.PHONY : all
87
-
88
-# The main clean target
89
-clean:
90
-	$(MAKE) -f CMakeFiles/Makefile2 clean
91
-.PHONY : clean
92
-
93
-# The main clean target
94
-clean/fast: clean
95
-
96
-.PHONY : clean/fast
97
-
98
-# Prepare targets for installation.
99
-preinstall: all
100
-	$(MAKE) -f CMakeFiles/Makefile2 preinstall
101
-.PHONY : preinstall
102
-
103
-# Prepare targets for installation.
104
-preinstall/fast:
105
-	$(MAKE) -f CMakeFiles/Makefile2 preinstall
106
-.PHONY : preinstall/fast
107
-
108
-# clear depends
109
-depend:
110
-	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
111
-.PHONY : depend
112
-
113
-#=============================================================================
114
-# Target rules for targets named stress
115
-
116
-# Build rule for target.
117
-stress: cmake_check_build_system
118
-	$(MAKE) -f CMakeFiles/Makefile2 stress
119
-.PHONY : stress
120
-
121
-# fast build rule for target.
122
-stress/fast:
123
-	$(MAKE) -f CMakeFiles/stress.dir/build.make CMakeFiles/stress.dir/build
124
-.PHONY : stress/fast
125
-
126
-home/dimercur/Travail/git/C-TP-RT/src/robot.o: home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.o
127
-
128
-.PHONY : home/dimercur/Travail/git/C-TP-RT/src/robot.o
129
-
130
-# target to build an object file
131
-home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.o:
132
-	$(MAKE) -f CMakeFiles/stress.dir/build.make CMakeFiles/stress.dir/home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.o
133
-.PHONY : home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.o
134
-
135
-home/dimercur/Travail/git/C-TP-RT/src/robot.i: home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.i
136
-
137
-.PHONY : home/dimercur/Travail/git/C-TP-RT/src/robot.i
138
-
139
-# target to preprocess a source file
140
-home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.i:
141
-	$(MAKE) -f CMakeFiles/stress.dir/build.make CMakeFiles/stress.dir/home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.i
142
-.PHONY : home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.i
143
-
144
-home/dimercur/Travail/git/C-TP-RT/src/robot.s: home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.s
145
-
146
-.PHONY : home/dimercur/Travail/git/C-TP-RT/src/robot.s
147
-
148
-# target to generate assembly for a file
149
-home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.s:
150
-	$(MAKE) -f CMakeFiles/stress.dir/build.make CMakeFiles/stress.dir/home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.s
151
-.PHONY : home/dimercur/Travail/git/C-TP-RT/src/robot.cpp.s
152
-
153
-main.o: main.cpp.o
154
-
155
-.PHONY : main.o
156
-
157
-# target to build an object file
158
-main.cpp.o:
159
-	$(MAKE) -f CMakeFiles/stress.dir/build.make CMakeFiles/stress.dir/main.cpp.o
160
-.PHONY : main.cpp.o
161
-
162
-main.i: main.cpp.i
163
-
164
-.PHONY : main.i
165
-
166
-# target to preprocess a source file
167
-main.cpp.i:
168
-	$(MAKE) -f CMakeFiles/stress.dir/build.make CMakeFiles/stress.dir/main.cpp.i
169
-.PHONY : main.cpp.i
170
-
171
-main.s: main.cpp.s
172
-
173
-.PHONY : main.s
174
-
175
-# target to generate assembly for a file
176
-main.cpp.s:
177
-	$(MAKE) -f CMakeFiles/stress.dir/build.make CMakeFiles/stress.dir/main.cpp.s
178
-.PHONY : main.cpp.s
179
-
180
-# Help Target
181
-help:
182
-	@echo "The following are some of the valid targets for this Makefile:"
183
-	@echo "... all (the default if no target is provided)"
184
-	@echo "... clean"
185
-	@echo "... depend"
186
-	@echo "... rebuild_cache"
187
-	@echo "... edit_cache"
188
-	@echo "... stress"
189
-	@echo "... home/dimercur/Travail/git/C-TP-RT/src/robot.o"
190
-	@echo "... home/dimercur/Travail/git/C-TP-RT/src/robot.i"
191
-	@echo "... home/dimercur/Travail/git/C-TP-RT/src/robot.s"
192
-	@echo "... main.o"
193
-	@echo "... main.i"
194
-	@echo "... main.s"
195
-.PHONY : help
196
-
197
-
198
-
199
-#=============================================================================
200
-# Special targets to cleanup operation of make.
201
-
202
-# Special rule to run CMake to check the build system integrity.
203
-# No rule that depends on this can have commands that come from listfiles
204
-# because they might be regenerated.
205
-cmake_check_build_system:
206
-	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
207
-.PHONY : cmake_check_build_system
208
-

+ 0
- 44
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/cmake_install.cmake View File

@@ -1,44 +0,0 @@
1
-# Install script for directory: /home/dimercur/Travail/git/C-TP-RT/example/stress
2
-
3
-# Set the install prefix
4
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
5
-  set(CMAKE_INSTALL_PREFIX "/usr/local")
6
-endif()
7
-string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
8
-
9
-# Set the install configuration name.
10
-if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
11
-  if(BUILD_TYPE)
12
-    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
13
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
14
-  else()
15
-    set(CMAKE_INSTALL_CONFIG_NAME "Debug")
16
-  endif()
17
-  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
18
-endif()
19
-
20
-# Set the component getting installed.
21
-if(NOT CMAKE_INSTALL_COMPONENT)
22
-  if(COMPONENT)
23
-    message(STATUS "Install component: \"${COMPONENT}\"")
24
-    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
25
-  else()
26
-    set(CMAKE_INSTALL_COMPONENT)
27
-  endif()
28
-endif()
29
-
30
-# Install shared libraries without execute permission?
31
-if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
32
-  set(CMAKE_INSTALL_SO_NO_EXE "1")
33
-endif()
34
-
35
-if(CMAKE_INSTALL_COMPONENT)
36
-  set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
37
-else()
38
-  set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
39
-endif()
40
-
41
-string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
42
-       "${CMAKE_INSTALL_MANIFEST_FILES}")
43
-file(WRITE "/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/${CMAKE_INSTALL_MANIFEST}"
44
-     "${CMAKE_INSTALL_MANIFEST_CONTENT}")

BIN
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/stress View File


+ 0
- 100
software/raspberry/superviseur-robot/example/stress/cmake-build-debug/stress.cbp View File

@@ -1,100 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<CodeBlocks_project_file>
3
-	<FileVersion major="1" minor="6"/>
4
-	<Project>
5
-		<Option title="stress"/>
6
-		<Option makefile_is_custom="1"/>
7
-		<Option compiler="gcc"/>
8
-		<Option virtualFolders="CMake Files\;"/>
9
-		<Build>
10
-			<Target title="all">
11
-				<Option working_dir="/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug"/>
12
-				<Option type="4"/>
13
-				<MakeCommands>
14
-					<Build command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 all"/>
15
-					<CompileFile command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 &quot;$file&quot;"/>
16
-					<Clean command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 clean"/>
17
-					<DistClean command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 clean"/>
18
-				</MakeCommands>
19
-			</Target>
20
-			<Target title="rebuild_cache">
21
-				<Option working_dir="/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug"/>
22
-				<Option type="4"/>
23
-				<MakeCommands>
24
-					<Build command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 rebuild_cache"/>
25
-					<CompileFile command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 &quot;$file&quot;"/>
26
-					<Clean command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 clean"/>
27
-					<DistClean command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 clean"/>
28
-				</MakeCommands>
29
-			</Target>
30
-			<Target title="edit_cache">
31
-				<Option working_dir="/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug"/>
32
-				<Option type="4"/>
33
-				<MakeCommands>
34
-					<Build command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 edit_cache"/>
35
-					<CompileFile command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 &quot;$file&quot;"/>
36
-					<Clean command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 clean"/>
37
-					<DistClean command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 clean"/>
38
-				</MakeCommands>
39
-			</Target>
40
-			<Target title="stress">
41
-				<Option output="/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/stress" prefix_auto="0" extension_auto="0"/>
42
-				<Option working_dir="/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug"/>
43
-				<Option object_output="./"/>
44
-				<Option type="1"/>
45
-				<Option compiler="gcc"/>
46
-				<Compiler>
47
-					<Add directory="/usr/include/c++/7"/>
48
-					<Add directory="/usr/include/x86_64-linux-gnu/c++/7"/>
49
-					<Add directory="/usr/include/c++/7/backward"/>
50
-					<Add directory="/usr/lib/gcc/x86_64-linux-gnu/7/include"/>
51
-					<Add directory="/usr/local/include"/>
52
-					<Add directory="/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed"/>
53
-					<Add directory="/usr/include/x86_64-linux-gnu"/>
54
-					<Add directory="/usr/include"/>
55
-				</Compiler>
56
-				<MakeCommands>
57
-					<Build command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 stress"/>
58
-					<CompileFile command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 &quot;$file&quot;"/>
59
-					<Clean command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 clean"/>
60
-					<DistClean command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 clean"/>
61
-				</MakeCommands>
62
-			</Target>
63
-			<Target title="stress/fast">
64
-				<Option output="/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/stress" prefix_auto="0" extension_auto="0"/>
65
-				<Option working_dir="/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug"/>
66
-				<Option object_output="./"/>
67
-				<Option type="1"/>
68
-				<Option compiler="gcc"/>
69
-				<Compiler>
70
-					<Add directory="/usr/include/c++/7"/>
71
-					<Add directory="/usr/include/x86_64-linux-gnu/c++/7"/>
72
-					<Add directory="/usr/include/c++/7/backward"/>
73
-					<Add directory="/usr/lib/gcc/x86_64-linux-gnu/7/include"/>
74
-					<Add directory="/usr/local/include"/>
75
-					<Add directory="/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed"/>
76
-					<Add directory="/usr/include/x86_64-linux-gnu"/>
77
-					<Add directory="/usr/include"/>
78
-				</Compiler>
79
-				<MakeCommands>
80
-					<Build command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 stress/fast"/>
81
-					<CompileFile command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 &quot;$file&quot;"/>
82
-					<Clean command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 clean"/>
83
-					<DistClean command="/usr/bin/make -j4 -f &quot;/home/dimercur/Travail/git/C-TP-RT/example/stress/cmake-build-debug/Makefile&quot;  VERBOSE=1 clean"/>
84
-				</MakeCommands>
85
-			</Target>
86
-		</Build>
87
-		<Unit filename="/home/dimercur/Travail/git/C-TP-RT/example/stress/main.cpp">
88
-			<Option target="stress"/>
89
-		</Unit>
90
-		<Unit filename="/home/dimercur/Travail/git/C-TP-RT/src/robot.cpp">
91
-			<Option target="stress"/>
92
-		</Unit>
93
-		<Unit filename="/home/dimercur/Travail/git/C-TP-RT/src/robot.h">
94
-			<Option target="stress"/>
95
-		</Unit>
96
-		<Unit filename="/home/dimercur/Travail/git/C-TP-RT/example/stress/CMakeLists.txt">
97
-			<Option virtualFolder="CMake Files\"/>
98
-		</Unit>
99
-	</Project>
100
-</CodeBlocks_project_file>

+ 57
- 0
software/raspberry/superviseur-robot/src.sav/definitions.h View File

@@ -0,0 +1,57 @@
1
+/*
2
+ * To change this license header, choose License Headers in Project Properties.
3
+ * To change this template file, choose Tools | Templates
4
+ * and open the template in the editor.
5
+ */
6
+
7
+/* 
8
+ * File:   msg.h
9
+ * Author: pehladik
10
+ *
11
+ * Created on 15 janvier 2018, 20:45
12
+ */
13
+
14
+#ifndef DEFINITIONS_H
15
+#define DEFINITIONS_H
16
+
17
+#define OPEN_COM_DMB  'o'
18
+#define CLOSE_COM_DMB 'C'
19
+
20
+#define DMB_PING                'p'
21
+#define DMB_IDLE                'r'
22
+#define DMB_START_WITHOUT_WD    'u'
23
+#define DMB_START_WITH_WD       'W'
24
+#define DMB_RELOAD_WD           'w'
25
+#define DMB_GET_VBAT            'v'
26
+#define DMB_IS_BUSY             'b'
27
+#define DMB_MOVE                'M'
28
+#define DMB_TURN                'T'
29
+#define DMB_GO_FORWARD          'F'
30
+#define DMB_GO_BACK             'B'
31
+#define DMB_GO_LEFT             'L'
32
+#define DMB_GO_RIGHT            'R'
33
+#define DMB_STOP_MOVE           'S'
34
+
35
+#define ROBOT_TIMED_OUT -3
36
+#define ROBOT_UKNOWN_CMD -2
37
+#define ROBOT_ERROR  -1
38
+#define ROBOT_CHECKSUM  -4
39
+#define ROBOT_OK    0
40
+
41
+#define CAM_OPEN                    'A'
42
+#define CAM_CLOSE                   'I'
43
+#define CAM_ASK_ARENA               'y'
44
+#define CAM_ARENA_CONFIRM           'x'
45
+#define CAM_ARENA_INFIRM            'z'
46
+#define CAM_COMPUTE_POSITION        'p'
47
+#define CAM_STOP_COMPUTE_POSITION   's'
48
+
49
+#define DMB_BAT_LOW 0
50
+#define DMB_BAT_MEDIUM 1
51
+#define DMB_BAT_HIGHT 2
52
+
53
+#define DMB_BUSY 1
54
+#define DMB_DO_NOTHING 0
55
+
56
+#endif /* MSG_H */
57
+

+ 211
- 0
software/raspberry/superviseur-robot/src.sav/image.cpp View File

@@ -0,0 +1,211 @@
1
+/**
2
+ * \file      image.cpp
3
+ * \author    L.Senaneuch
4
+ * \version   1.0
5
+ * \date      06/06/2017
6
+ * \brief     Fonctions de traitement d'image utilisable pour la détection du robot.
7
+ *
8
+ * \details   Ce fichier utilise la libraire openCV2 pour faciliter le traitement d'image dans le projet Destijl.
9
+ *            Il permet de faciliter la détection de l'arène et la détection du robot.
10
+ *			  /!\ Attention Bien que celui-ci soit un .cpp la structure du code n'est pas sous forme d'objet.
11
+ */
12
+
13
+#include "image.h"
14
+#include <iostream>
15
+
16
+using namespace cv;
17
+#ifndef __STUB__
18
+using namespace raspicam;
19
+#else
20
+Image stubImg;
21
+#endif
22
+using namespace std;
23
+
24
+float calculAngle(Position * positionRobot);
25
+int cropArena(Image *imgInput, Image *imgOutput, Arene *AreneInput);
26
+float euclideanDist(Point& p, Point& q);
27
+
28
+void draw_arena(Image *imgInput, Image *imgOutput, Arene *monArene)
29
+{
30
+    if(imgInput!=imgOutput)
31
+        *imgOutput=imgInput->clone();
32
+    rectangle(*imgOutput,monArene->tl(),monArene->br(),Scalar(0,0,125),2,8,0);
33
+}
34
+
35
+int open_camera(Camera  *camera)
36
+{
37
+#ifndef __STUB__
38
+    camera->set(CV_CAP_PROP_FORMAT, CV_8UC3);
39
+    camera->set(CV_CAP_PROP_FRAME_WIDTH,WIDTH);
40
+    camera->set(CV_CAP_PROP_FRAME_HEIGHT,HEIGHT);
41
+
42
+    printf("Opening Camera...\n");
43
+    if (!(camera->open())) {
44
+        perror("Can't open Camera\n") ;
45
+        return -1;
46
+    }
47
+    else
48
+    {
49
+        printf("Camera warmup 2sec\n");
50
+        sleep(2);
51
+        printf("Start capture\n");
52
+        return 0;
53
+    }   
54
+#endif
55
+}
56
+
57
+void get_image(Camera *camera, Image * monImage, const char  * fichier) // getImg(Camera, Image img);
58
+{
59
+#ifndef __STUB__
60
+    camera->grab();
61
+    camera->retrieve(*monImage);
62
+    cvtColor(*monImage,*monImage,CV_BGR2RGB);
63
+#else
64
+    stubImg = imread(fichier, CV_LOAD_IMAGE_COLOR);
65
+    stubImg.copyTo(*monImage);
66
+#endif
67
+}
68
+
69
+void close_camera(Camera *camera) // closeCam(Camera) : camera Entrer
70
+{
71
+#ifndef __STUB__
72
+    camera->release();
73
+#endif
74
+}
75
+
76
+
77
+int detect_arena(Image *monImage, Arene *rectangle) // Image en entrée // rectangle en sortie
78
+{
79
+    vector<vector<Point> > contours;
80
+    vector<Point> approx;
81
+    vector<Vec4i> hierarchy;
82
+
83
+    Image imageTrt;
84
+    cvtColor(*monImage,imageTrt,CV_RGB2GRAY); // conversion en niveau de gris
85
+    threshold(imageTrt,imageTrt,128,255,CV_THRESH_BINARY); // Threshold les éléments les plus clair
86
+    Canny(imageTrt, imageTrt, 100,200,3); // detection d'angle
87
+
88
+    findContours(imageTrt, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0));
89
+    for(unsigned int i = 0; i < contours.size();i++)
90
+	{
91
+        approxPolyDP(Image(contours[i]), approx, arcLength(Image(contours[i]), true)*0.1, true);
92
+        if(approx.size()==4 && fabs(cv::contourArea(contours[i])) > 100000)
93
+        {
94
+            *rectangle = boundingRect(Image(contours[i]));
95
+            return 0;
96
+        }
97
+    }
98
+    return -1;
99
+}
100
+
101
+int cropArena(Image *imgInput, Image *imgOutput, Arene *areneInput) // image // rectangle // image2
102
+{
103
+    Image img;
104
+    img=imgInput->clone();
105
+
106
+    *imgOutput = img(*areneInput);
107
+    return 0;
108
+}
109
+
110
+float euclideanDist(Point& p, Point& q) {
111
+    Point diff = p - q;
112
+    return cv::sqrt(diff.x*diff.x + diff.y*diff.y);
113
+}
114
+
115
+void compress_image(Image *imgInput, Jpg *imageCompress) // image entrée // imageEncodé en sortie
116
+{
117
+    imencode(".jpg",*imgInput,*imageCompress);
118
+}
119
+
120
+
121
+int detect_position(Image *imgInput, Position *posTriangle, Arene * monArene) // entree : image  / sortie tab pos
122
+{
123
+    vector<vector<Point> > contours;
124
+    vector<Point> approx;
125
+    vector<Vec4i> hierarchy;
126
+
127
+    Image imgTraitment;
128
+
129
+    if(monArene==NULL)
130
+        imgTraitment=imgInput->clone();
131
+    else
132
+        cropArena(imgInput,&imgTraitment, monArene);
133
+
134
+    cvtColor(imgTraitment,imgTraitment,CV_RGB2GRAY);
135
+    threshold(imgTraitment,imgTraitment,128,255,CV_THRESH_BINARY);
136
+    findContours(imgTraitment, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0));
137
+
138
+    int nbrTriangle = 0;
139
+    for(unsigned int i = 0;i < contours.size();i++)
140
+	{
141
+        approxPolyDP(Mat(contours[i]), approx, arcLength(Mat(contours[i]), true)*0.17, true);
142
+        if(approx.size() == 3 && fabs(contourArea(contours[i])) > 200 && fabs(contourArea(contours[i])) < 700)
143
+        {
144
+
145
+            Point a,b,c;
146
+            Point center;
147
+
148
+
149
+            a = approx[0];
150
+            b = approx[1];
151
+            c = approx[2];
152
+
153
+
154
+            if(monArene !=NULL) // ajout de l'offset de l'arène
155
+            {
156
+               a.x += monArene->x;
157
+               a.y += monArene->y;
158
+               b.x += monArene->x;
159
+               b.y += monArene->y;
160
+               c.x += monArene->x;
161
+               c.y += monArene->y;		    
162
+            }
163
+		
164
+            center.x = (a.x + b.x + c.x)/3;
165
+            center.y = (a.y + b.y + c.y)/3;
166
+
167
+            posTriangle[nbrTriangle].center=center;
168
+
169
+            if(euclideanDist(center,b) > euclideanDist(center,a) && euclideanDist(center,b) > euclideanDist(center,c) )
170
+            {
171
+
172
+                posTriangle[nbrTriangle].direction=b;
173
+                //line(img,center,b,Scalar(0,125,0),2,8,0);
174
+            }
175
+            else if(euclideanDist(center,a) > euclideanDist(center,c))
176
+            {
177
+                posTriangle[nbrTriangle].direction=a;
178
+                //line(img,center,a,Scalar(0,125,0),2,8,0);
179
+
180
+            }
181
+            else
182
+            {
183
+                posTriangle[nbrTriangle].direction=c;
184
+                //line(img,center,c,Scalar(0,125,0),2,8,0);
185
+            }
186
+            posTriangle[nbrTriangle].angle=calculAngle(&posTriangle[nbrTriangle]);
187
+
188
+            nbrTriangle++;
189
+
190
+        }
191
+    }
192
+    return nbrTriangle;
193
+}
194
+
195
+void draw_position(Image *imgInput, Image *imgOutput, Position *positionRobot) // img E/S   pos : E
196
+{
197
+    if(imgInput!=imgOutput)
198
+    {
199
+        *imgOutput=imgInput->clone();
200
+    }
201
+    line(*imgOutput,positionRobot->center,positionRobot->direction,Scalar(0,125,0),2,8,0);
202
+}
203
+
204
+float calculAngle(Position * positionRobot) // position en entree
205
+{
206
+    float a = positionRobot->direction.x - positionRobot->center.x;
207
+    float b = positionRobot->direction.y - positionRobot->center.y ;
208
+    float angle = atan2(b,a);
209
+    return angle * 180.f/M_PI;
210
+
211
+}

+ 128
- 0
software/raspberry/superviseur-robot/src.sav/image.h View File

@@ -0,0 +1,128 @@
1
+/**
2
+ * \file      image.h
3
+ * \author    L.Senaneuch
4
+ * \version   1.0
5
+ * \date      06/06/2017
6
+ * \brief     Fonctions de traitement d'image utilisable pour la d�tection du robot.
7
+ *
8
+ * \details   Ce fichier utilise la libraire openCV2 pour faciliter le traitement d'image dans le projet Destijl.
9
+ *            Il permet de faciliter la d�tection de l'ar�ne et la d�tection du robot.
10
+ *			  /!\ Attention Bien que celui-ci soit un .cpp la structure du code n'est pas sous forme d'objet.
11
+ */
12
+
13
+
14
+#ifndef IMAGERIE_H
15
+#define IMAGERIE_H
16
+
17
+#ifndef __STUB__
18
+#include <raspicam/raspicam_cv.h>
19
+#else
20
+#include <opencv2/highgui/highgui.hpp>
21
+#endif
22
+#include "opencv2/imgproc/imgproc.hpp"
23
+#include <unistd.h>
24
+#include <math.h>
25
+
26
+#define WIDTH 480 //1280 1024 640 480
27
+#define HEIGHT 360 // 960 768 480 360
28
+
29
+using namespace std;
30
+using namespace cv;
31
+#ifndef __STUB__
32
+using namespace raspicam;
33
+#endif
34
+
35
+typedef Mat Image;
36
+#ifndef __STUB__
37
+typedef RaspiCam_Cv Camera;
38
+#else
39
+typedef int Camera;
40
+#endif
41
+typedef Rect Arene;
42
+typedef vector<unsigned char> Jpg;
43
+
44
+struct Position {
45
+    Point center;
46
+    Point direction;
47
+    float angle;
48
+};
49
+
50
+/**
51
+ * \brief      Ouvre une camera.
52
+ * \details    Met à jour le descripteur de fichier passé en paramètre pour correspondre à la camera ouverte
53
+ *             
54
+ * \param    *Camera      	Pointeur d'un file descriptor d'une camera ouverte
55
+ * \return retourne 0 si la camera a été ouverte correctement et -1 si une erreur survient.
56
+ */
57
+int open_camera(Camera *camera);
58
+
59
+/**
60
+ * \brief      Ferme la camera passé en paramètre
61
+ *             
62
+ * \param    *Camera       Pointeur sur la camera à fermer
63
+ */
64
+void close_camera(Camera *camera);
65
+
66
+/**
67
+ * \brief      Capture une image avec la camera passée en entrée. En cas de test
68
+ * sans camera, la fonction charge une image 
69
+ * \details    La camera doit préalablement être ouverte via \a openCamera(...)
70
+ *             
71
+ * \param    *Camera       Pointeur sur la camera passée en entrée.
72
+ * \param    *monImage 	   Pointeur sur une image capturée. 
73
+ * \param    *fichier         chemin du fichier d'image
74
+ * \return    Retourne -1 si une erreur survient.
75
+ */
76
+void get_image(Camera *camera, Image * monImage, const char *fichier = NULL);
77
+
78
+/**
79
+ * \brief      Détecte une arène dans une image fournis en paramètre.
80
+ *             
81
+ * \param    *monImage       Pointeur sur l'image d'entrée
82
+ * \param    *rectangle 	 Pointeur sur les coordonnées du rectangles trouvé. 
83
+ * \return    Retourne -1 si aucune arène n'est détectée. Sinon retourne 0
84
+ */
85
+int detect_arena(Image *monImage, Arene *rectangle);
86
+
87
+/**
88
+ * \brief      Dessine le plus petit rectangle contenant l'arène
89
+ 
90
+ * \param    *imgInput       Pointeur sur l'image d'entrée.
91
+ * \param    *imgOutput      Pointeur sur l'image de sortie (image d'entrée + arène marquée)
92
+ * \param    *monArene		 Pointeur de type Arène contenant les information à dessiner
93
+ */
94
+void draw_arena(Image *imgInput, Image *imgOutput, Arene *monArene);
95
+
96
+/**
97
+ * \brief      Détecte la position d'un robot.
98
+ * \details    Détecte la position de triangles blanc sur une image /a imgInput passé en paramètre d'entrer.
99
+ *             
100
+ * \param    *imgInput       Pointeur sur l'image sur laquelle chercher la position du des robots.
101
+ * \param    *posTriangle    Pointeur sur un tableau de position ou seront stocké les positions des triangles détectés.
102
+ * \param    *monArene       Pointeur de type Arène si nécessaire d'affiner la recherche (optionnel) 
103
+ * \return    Le nombre de triangles détectés.
104
+ */
105
+int detect_position(Image *imgInput, Position *posTriangle, Arene * monArene = NULL);
106
+
107
+/**
108
+ * \brief      Dessine sur une image en entrée la position d'un robot et sa direction.
109
+ * \details    Sauvegarde l'image des coordonnées passées par positionRobot 
110
+ * superposée à l'image d'entrée sur imgOutput.
111
+ *             
112
+ * \param      *imgInput	      	Pointeur sur l'image d'entrée
113
+ * \param      *imgOutput    		Pointeur sur l'image de sortie ( image 
114
+ * d'entrée + dessin de la position)
115
+ * \param      *positionRobot   	Pointeur sur la structure position d'un robot.
116
+ */
117
+void draw_position(Image *imgInput, Image *imgOutput, Position *positionRobot);
118
+
119
+/**
120
+ * \brief      Détecte la position d'un robot.
121
+ * \details    Détecte la position de triangles blanc sur une image /a imgInput passé en paramètre d'entrer.
122
+ *             
123
+ * \param    *imgInput      	Pointeur sur l'image à sauvegarder en mémoire sous format jpg.
124
+ * \param    *imageCompress	Pointeur sur une image .jpg.
125
+ */
126
+void compress_image(Image *imgInput, Jpg *imageCompress);
127
+
128
+#endif // IMAGERIE_H

+ 29
- 0
software/raspberry/superviseur-robot/src.sav/message.cpp View File

@@ -0,0 +1,29 @@
1
+/*
2
+ * To change this license header, choose License Headers in Project Properties.
3
+ * To change this template file, choose Tools | Templates
4
+ * and open the template in the editor.
5
+ */
6
+#include "message.h"
7
+
8
+void set_msgToMon_header(MessageToMon *msg, char *header) {
9
+    memcpy(msg->header, header, sizeof (header));
10
+}
11
+
12
+void set_msgToMon_data(MessageToMon *msg, void * data) {
13
+    if (msg->data != NULL) {
14
+        free(msg->data);
15
+    }
16
+    msg->data = malloc(sizeof (data));
17
+    memcpy(msg->data, data, sizeof (data));
18
+}
19
+
20
+void free_msgToMon_data(MessageToMon *msg) {
21
+    if (msg->data != NULL) {
22
+        free(msg->data);
23
+    }
24
+}
25
+
26
+void print_msgToMon(MessageToMon *msg) {
27
+    printf("header: %s\n", msg->header);
28
+    printf("data: %s\n", msg->data);
29
+}

+ 33
- 0
software/raspberry/superviseur-robot/src.sav/message.h View File

@@ -0,0 +1,33 @@
1
+/*
2
+ * To change this license header, choose License Headers in Project Properties.
3
+ * To change this template file, choose Tools | Templates
4
+ * and open the template in the editor.
5
+ */
6
+
7
+/* 
8
+ * File:   message.h
9
+ * Author: pehladik
10
+ *
11
+ * Created on 7 février 2018, 17:20
12
+ */
13
+
14
+#ifndef MESSAGE_H
15
+#define MESSAGE_H
16
+
17
+#include <stdio.h>
18
+#include <stdlib.h>
19
+#include <unistd.h>
20
+#include <string.h>
21
+
22
+typedef struct {
23
+    char header[4];
24
+    void *data = NULL;
25
+} MessageToMon;
26
+
27
+void set_msgToMon_header(MessageToMon *msg, char *header);
28
+void set_msgToMon_data(MessageToMon *msg, void * data);
29
+void free_msgToMon_data(MessageToMon *msg);
30
+void print_msgToMon(MessageToMon *msg);
31
+
32
+#endif /* MESSAGE_H */
33
+

+ 161
- 0
software/raspberry/superviseur-robot/src.sav/monitor.cpp View File

@@ -0,0 +1,161 @@
1
+#include "monitor.h"
2
+
3
+using namespace std;
4
+
5
+SOCKADDR_IN ssin;
6
+SOCKET sock;
7
+socklen_t recsize = sizeof (ssin);
8
+
9
+/*Socket et contexte d'adressage du client */
10
+SOCKADDR_IN csin;
11
+SOCKET csock;
12
+socklen_t crecsize = sizeof (csin);
13
+
14
+int sock_err;
15
+pid_t pidNodejs;
16
+
17
+string serverReceive(int size);
18
+int serverSend(const void *data, int dataLength);
19
+int receive(char *data);
20
+
21
+int run_nodejs(const char * path, char * file) {
22
+    int ret;
23
+    //char *const parmList[] = {"/bin/ls", "-l", "/home", NULL};
24
+    char * const parmList[] = {"node", file, NULL};
25
+
26
+    if ((ret = fork()) == -1)
27
+        perror("fork error");
28
+    else if (ret == 0) {
29
+        ret = execv(path, parmList);
30
+    }
31
+    return ret;
32
+}
33
+
34
+int kill_nodejs() {
35
+#ifdef __VERBOSE__  
36
+    printf("kill nodejs\n");
37
+#endif
38
+    return kill(pidNodejs, SIGTERM);
39
+}
40
+
41
+int open_server(int port) {
42
+    /* Création d'un socket */
43
+    sock = socket(AF_INET, SOCK_STREAM, 0);
44
+    int enable = 1;
45
+
46
+    /* Si la socket est valide */
47
+    if (sock != INVALID_SOCKET) {
48
+#ifdef _WITH_TRACE_
49
+        printf("TCP/IP Socket %d opened\n", sock);
50
+#endif
51
+        setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof (enable));
52
+
53
+        /* Configuration */
54
+        ssin.sin_addr.s_addr = htonl(INADDR_ANY); /* Adresse IP automatique */
55
+        ssin.sin_family = AF_INET; /* Protocole familial (IP) */
56
+        ssin.sin_port = htons(port); /* Listage du port */
57
+        sock_err = bind(sock, (SOCKADDR*) & ssin, recsize);
58
+
59
+        /* Si la socket fonctionne */
60
+        if (sock_err != SOCKET_ERROR) {
61
+            /* Démarrage du listage (mode server) */
62
+            sock_err = listen(sock, 1);
63
+
64
+            /* Si la socket fonctionne */
65
+            if (sock_err != SOCKET_ERROR) {
66
+                /* Attente pendant laquelle le client se connecte */
67
+#ifdef _WITH_TRACE_
68
+                printf("Waiting a client on port %d\n", port);
69
+#endif
70
+                csock = accept(sock, (SOCKADDR*) & csin, &crecsize);
71
+#ifdef _WITH_TRACE_
72
+                printf("Client connected\n");
73
+#endif
74
+                return 0;
75
+            } else {
76
+                perror("listen");
77
+            }
78
+        } else {
79
+            perror("bind");
80
+            return (-1);
81
+        }
82
+    } else {
83
+        perror("socket");
84
+        return (-1);
85
+    }
86
+    return 0;
87
+}
88
+
89
+int close_server(void) {
90
+    /* Fermeture de la socket client et de la socket serveur */
91
+    close(csock);
92
+    close(sock);
93
+    printf("Socket fermé\n");
94
+    return 0;
95
+}
96
+
97
+int send_message_to_monitor(const char* typeMessage, const void * data) {
98
+    if ((string) typeMessage == HEADER_STM_IMAGE) {
99
+        Jpg * imgC = (Jpg*) data;
100
+        serverSend("IMG", 3);
101
+        serverSend(imgC->data(), imgC->size());
102
+        serverSend("TRAME", 5);
103
+        return 0;
104
+    } else if ((string) typeMessage == HEADER_STM_POS) {
105
+        char buffer[20];
106
+        Position * maPosition = (Position*) data;
107
+        sprintf(buffer, "POScenter: %3d;%3d | %.1fTRAME", maPosition->center.x, maPosition->center.y, maPosition->angle);
108
+        serverSend(buffer, strlen(buffer));
109
+        return 0;
110
+    } else if ((string) typeMessage == HEADER_STM_MES) {
111
+        char buffer[50];
112
+        sprintf(buffer, "MSG%sTRAME", (const char*) data);
113
+        serverSend(buffer, strlen(buffer));
114
+        return 0;
115
+    } else if ((string) typeMessage == HEADER_STM_ACK) {
116
+        char buffer[50];
117
+        sprintf(buffer, "ACK%sTRAME", (const char*) data);
118
+        serverSend(buffer, strlen(buffer));
119
+        return 0;
120
+    } else if ((string) typeMessage == HEADER_STM_BAT) {
121
+        char buffer[50];
122
+        sprintf(buffer, "BAT%sTRAME", (const char*) data);
123
+        serverSend(buffer, strlen(buffer));
124
+        return 0;
125
+    } else if ((string) typeMessage == HEADER_STM_NO_ACK) {
126
+        char buffer[50];
127
+        sprintf(buffer, "NAK%sTRAME", (const char*) data);
128
+        serverSend(buffer, strlen(buffer));
129
+        return 0;
130
+    } else if ((string) typeMessage == HEADER_STM_LOST_DMB) {
131
+        char buffer[50];
132
+        sprintf(buffer, "LCD%sTRAME", (const char*) data);
133
+        serverSend(buffer, strlen(buffer));
134
+        return 0;
135
+    } else {
136
+        return -1;
137
+    }
138
+}
139
+
140
+int receive_message_from_monitor(char *typeMessage, char *data) {
141
+    char buffer[20];
142
+    int tBuffer = receive(buffer);
143
+    sscanf(buffer, "%3s:%s", typeMessage, data);
144
+    return tBuffer;
145
+}
146
+
147
+int receive(char *data) {
148
+    int result;
149
+    result = recv(csock, data, 20, 0);
150
+    //cout <<"Data : " << data << endl;
151
+    return result;
152
+}
153
+
154
+int serverSend(const void *data, int dataLength) {
155
+    if (send(csock, data, dataLength, 0) != dataLength) {
156
+        perror("Send failed : ");
157
+        return false;
158
+    }
159
+
160
+    return true;
161
+}

+ 115
- 0
software/raspberry/superviseur-robot/src.sav/monitor.h View File

@@ -0,0 +1,115 @@
1
+//
2
+// Created by lucien on 05/04/17.
3
+//
4
+
5
+#ifndef TCPSERVER_H
6
+#define TCPSERVER_H
7
+
8
+#include <sys/types.h>
9
+#include <sys/socket.h>
10
+#include <netinet/in.h>
11
+#include <arpa/inet.h>
12
+#include <unistd.h>
13
+#include <signal.h>
14
+#include <stdlib.h>
15
+#include <stdio.h>
16
+#include <string.h>
17
+#include "image.h"
18
+#include "definitions.h"
19
+
20
+#define HEADER_STM_IMAGE "IMG" // Envoi d'une image
21
+#define HEADER_STM_BAT "BAT" // Envoi de l'état de la batterie
22
+#define HEADER_STM_POS "POS" // Envoi de la position
23
+#define HEADER_STM_NO_ACK "NAK" // Acquittement d'un échec
24
+#define HEADER_STM_ACK "ACK" // Acquittement d'un succès
25
+#define HEADER_STM_MES "MSG" // Message textuel
26
+#define HEADER_STM_LOST_DMB "LCD" // Perte de la communication avec le robot
27
+
28
+#define HEADER_MTS_MSG "MSG" // Message directe pour Console Dumber
29
+#define HEADER_MTS_DMB_ORDER "DMB" // Message d'ordre pour le robot
30
+#define HEADER_MTS_COM_DMB "COM" // Message de gestion de la communication avec le robot
31
+#define HEADER_MTS_CAMERA "CAM" // Message de gestion de la camera
32
+#define HEADER_MTS_STOP "STO" // Message d'arrêt du system
33
+
34
+#define INVALID_SOCKET -1
35
+#define SOCKET_ERROR -1
36
+
37
+#define DEFAULT_PORT  8080
38
+#define DEFAULT_PARITY 0
39
+
40
+#define DETECT_ARENA    (1)
41
+#define CHECK_ARENA     (2)
42
+#define NO_ARENA        (3)
43
+
44
+#define DEFAULT_NODEJS_PATH "/usr/bin/nodejs"
45
+#define DEFAULT_INTERFACE_FILE "./interface.js"
46
+
47
+#define closesocket(param) close(param)
48
+
49
+typedef int SOCKET;
50
+typedef struct sockaddr_in SOCKADDR_IN;
51
+typedef struct sockaddr SOCKADDR;
52
+
53
+typedef struct {
54
+    char header[4];
55
+    char data[100];
56
+} MessageFromMon;
57
+
58
+
59
+/**
60
+ * \brief    Lance nodejs .
61
+ * \param    path    chemin de l'executable nodejs (défaut /usr/bin/nodejs)
62
+ * \param    file  chemin du fichier de l'interface (défaut ./interface.js)
63
+ * \return   retourne 0 si le process a été lancé et -1 sinon.
64
+ */
65
+int run_nodejs(const char * path = DEFAULT_NODEJS_PATH, char * file = DEFAULT_INTERFACE_FILE);
66
+
67
+/**
68
+ * \brief    Tue le process exécutant nodejs.
69
+ * \return   retourne 0 en cas de succès et -1 sinon.
70
+ */
71
+int kill_nodejs();
72
+
73
+/**
74
+ * \brief      Mise en place du serveur (port 8080 par défaut).
75
+ * \param    port    numéro du port utilisé par le serveur (8080 par défaut).
76
+ * \return   retourne 0 si le serveur est mis en place et -1 en cas de problème.
77
+ */
78
+int open_server(int port = DEFAULT_PORT); //public
79
+
80
+/**
81
+ * \brief    Ferme le serveur.
82
+ * \return   retourne 0 si le serveur est fermé et -1 en cas de problème.
83
+ */
84
+int close_server(void); // public
85
+
86
+/**
87
+ * \brief    Envoi d'un message vers l'interface graphique
88
+ * \param    typeMessage     Type du message envoyé. Les valeurs possibles sont 
89
+ * IMG pour une image, MES pour un message à afficher dans la console, POS pour
90
+ * la position du robot, BAT pour une valeur de la batterie et ACK pour valider
91
+ * un message de l'interface.
92
+ * \param  data   données associées au message. Le type de la donnée doit
93
+ * correspondre au message : Image pour IMG, char * MES, Position pour POS, 
94
+ * char * pour BAT et rien pour ACK. Attention, il n'y a aucune vérification
95
+ * a posterio.
96
+ * \return   retourne 0 si l'envoie a bien été réalisé et -1 en cas de problème.
97
+ */
98
+int send_message_to_monitor(const char* typeMessage, const void * data = NULL);
99
+
100
+/**
101
+ * \brief    Réception d'un message. La fonction est bloquante et retourne par
102
+ * référence le type de message reçu (DMB pour un ordre au robot, ARN pour la
103
+ * détection des arènes et POS pour un calcul de position) ainsi que les données
104
+ * associées.
105
+ * \param    typeMessage     Type du message reçu : DMB pour un ordre au robot, 
106
+ * ARN pour la demande de détection de l'arène, POS pour un calcul de position
107
+ * et MSG pour un message de l'interface
108
+ * \param  data   données associées au message reçu.
109
+ * \return   retourne 0 la taille du message reçu ou une valeur négative si la
110
+ * connexion est perdue.
111
+ */
112
+int receive_message_from_monitor(char *typeMessage, char *data);
113
+
114
+
115
+#endif // TCPSERVER_H

software/raspberry/superviseur-robot/src/robot.cpp → software/raspberry/superviseur-robot/src.sav/robot.cpp View File

@@ -1,3 +1,13 @@
1
+/**
2
+ * \file      robot.cpp
3
+ * \author    L.Senaneuch
4
+ * \version   1.0
5
+ * \date      06/06/2017
6
+ * \brief     Fonction permettant la communication avec le robot.
7
+ *
8
+ * \details   Ce fichier regroupe des fonctions facilitant la communication avec le robot en utilisant le port serie USART
9
+ */
10
+
1 11
 #include "robot.h"
2 12
 
3 13
 int fd;
@@ -190,19 +200,19 @@ int getChar(char * c)
190 200
 
191 201
 int readSerial(char * msg)
192 202
 {
193
-    char car;
194
-    int i =0,j=0;
195
-    for(j = 0 ; j < 20 ; j++)
203
+    char car=0;
204
+    int i=0;
205
+    for(int j = 0 ; j < 20 ; j++)
196 206
         msg[j]=0;
197
-    while(car !='\r' && car!='\n')
198
-    {
199
-        if(i>=20)
207
+    
208
+    while(car !='\r' && car!='\n') {
209
+        if(i>=20) 
200 210
             return -5;
201 211
 
202
-        if(getChar(&car)==ROBOT_TIMED_OUT)
203
-        {
212
+        if(getChar(&car)==ROBOT_TIMED_OUT) {
204 213
             return ROBOT_TIMED_OUT;
205 214
         }
215
+        
206 216
         msg[i] = car;
207 217
         i++;
208 218
     }

software/raspberry/superviseur-robot/src/robot.h → software/raspberry/superviseur-robot/src.sav/robot.h View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * \file      serial.h
2
+ * \file      robot.h
3 3
  * \author    L.Senaneuch
4 4
  * \version   1.0
5 5
  * \date      06/06/2017

+ 349
- 0
software/raspberry/superviseur-robot/src/Robot.cpp View File

@@ -0,0 +1,349 @@
1
+/*******************************************************************************
2
+ * Copyright (c) 2018 INSA - GEI, Toulouse, France.
3
+ * All rights reserved. This program and the accompanying materials
4
+ * are made available "AS IS", without any warranty of any kind.
5
+ *
6
+ * INSA assumes no responsibility for errors or omissions in the 
7
+ * software or documentation available. 
8
+ *
9
+ * Contributors:
10
+ *     Lucien Senaneuch - Initial API and implementation
11
+ *     Sebastien DI MERCURIO - Maintainer since Octobre 2018
12
+ *******************************************************************************/
13
+
14
+/**
15
+ * \file      robot.cpp
16
+ * \author    L.Senaneuch
17
+ * \version   1.0
18
+ * \date      06/06/2017
19
+ * \brief     Fonction permettant la communication avec le robot.
20
+ *
21
+ * \details   Ce fichier regroupe des fonctions facilitant la communication avec le robot en utilisant le port serie USART
22
+ */
23
+
24
+#include "Robot.h"
25
+
26
+#include <unistd.h>
27
+#include <fcntl.h>
28
+#include <termios.h>
29
+
30
+#include <stdlib.h>
31
+#include "definitions.h"
32
+
33
+using namespace std;
34
+
35
+#define ROBOT_CMD_ENDING_CHAR           '\r'
36
+
37
+#define ROBOT_CMD_PING                  'p'
38
+#define ROBOT_CMD_RESET                 'r'
39
+#define ROBOT_CMD_START_WITHOUT_WD      'u'
40
+#define ROBOT_CMD_START_WITH_WD         'W'
41
+#define ROBOT_CMD_RELOAD_WD             'w'
42
+#define ROBOT_CMD_GET_VBAT              'v'
43
+#define ROBOT_CMD_IS_BUSY               'b'
44
+#define ROBOT_CMD_MOVE                  'M'
45
+#define ROBOT_CMD_TURN                  'T'
46
+#define ROBOT_CMD_GET_VERSION           'V'
47
+#define ROBOT_CMD_POWER_OFF             'z'
48
+
49
+#define ROBOT_CMD_OK_ANS                "O"
50
+#define ROBOT_CMD_ERR_ANS               "E"
51
+#define ROBOT_CMD_UNKNOW_ANS            "C"
52
+
53
+const string Robot::InvalidAnswerException = "Invalid answer exception";
54
+
55
+Robot::Robot() {
56
+
57
+}
58
+
59
+Robot::~Robot() {
60
+    this->Close();
61
+}
62
+
63
+char Robot::Open() {
64
+    return Serial::Open(DEFAULT_SERIAL_PORT,9600);
65
+}
66
+
67
+char Robot::Open(const char *path) {
68
+    return Serial::Open(path,9600);
69
+}
70
+
71
+char Robot::Close() {
72
+    return Serial::Close();
73
+}
74
+
75
+int Robot::GetLastCommandStatus() {
76
+    return this->lastCommandStatus;
77
+}
78
+
79
+void Robot::Ping() {
80
+#ifndef __STUB__
81
+    string ans;
82
+    SendCommand(string(1,ROBOT_CMD_PING), &ans);
83
+
84
+    CheckAnswer(ans);
85
+#else
86
+    return SUCCESS;
87
+#endif /* __STUB__ */
88
+}
89
+
90
+void Robot::Reset() {
91
+#ifndef __STUB__
92
+    string ans;
93
+    SendCommand(string(1,ROBOT_CMD_RESET), &ans);
94
+
95
+    CheckAnswer(ans);
96
+#else
97
+    return SUCCESS;
98
+#endif /* __STUB__ */
99
+}
100
+
101
+void Robot::StartWithoutWatchdog() {
102
+#ifndef __STUB__
103
+    string ans;
104
+    SendCommand(string(1,ROBOT_CMD_START_WITHOUT_WD), &ans);
105
+
106
+    CheckAnswer(ans);
107
+#else
108
+    return SUCCESS;
109
+#endif /* __STUB__ */
110
+}
111
+
112
+void Robot::StartWithWatchdog() {
113
+#ifndef __STUB__
114
+    string ans;
115
+    SendCommand(string(1,ROBOT_CMD_START_WITH_WD), &ans);
116
+
117
+    CheckAnswer(ans);
118
+#else
119
+    return SUCCESS;
120
+#endif /* __STUB__ */
121
+}
122
+
123
+void Robot::ResetWatchdog() {
124
+#ifndef __STUB__
125
+    string ans;
126
+    SendCommand(string(1,ROBOT_CMD_RELOAD_WD), &ans);
127
+
128
+    CheckAnswer(ans);
129
+#else
130
+    return SUCCESS;
131
+#endif /* __STUB__ */
132
+}
133
+
134
+void Robot::Move(int distance) {
135
+#ifndef __STUB__
136
+    string ans;
137
+    SendCommand(string(1,ROBOT_CMD_MOVE) + "="+to_string(distance), &ans);
138
+
139
+    CheckAnswer(ans);
140
+#else
141
+    return SUCCESS;
142
+#endif /* __STUB__ */
143
+}
144
+
145
+void Robot::Turn(int angle) {
146
+#ifndef __STUB__
147
+    string ans;
148
+    SendCommand(string(1,ROBOT_CMD_TURN) + "="+to_string(angle), &ans);
149
+
150
+    CheckAnswer(ans);
151
+#else
152
+    return SUCCESS;
153
+#endif /* __STUB__ */
154
+}
155
+
156
+void Robot::PowerOff() {
157
+#ifndef __STUB__
158
+    string ans;
159
+    SendCommand(string(1,ROBOT_CMD_POWER_OFF), &ans);
160
+
161
+    CheckAnswer(ans);
162
+#else
163
+    return SUCCESS;
164
+#endif /* __STUB__ */
165
+}
166
+
167
+char Robot::GetBatteryLevel() {
168
+#ifndef __STUB__
169
+    string ans;
170
+
171
+    SendCommand(string(1,ROBOT_CMD_GET_VBAT), &ans);
172
+    lastCommandStatus=SUCCESS;
173
+
174
+    if (ans.length()==1) {
175
+        if ((ans[0] != '2') && (ans[0] != '1') && (ans[0] != '0')) {
176
+            lastCommandStatus=INVALID_ANSWER;
177
+            throw (InvalidAnswerException + " raised in Robot::GetBatteryLevel. Invalid battery value (" + ans[0] +")\n");
178
+        }
179
+    } else {
180
+        lastCommandStatus=INVALID_ANSWER;
181
+        throw (InvalidAnswerException + " raised in Robot::GetBatteryLevel. Invalid answer length (" + to_string(ans.length())+")\n");
182
+    }
183
+
184
+    return ans[0];
185
+#else
186
+    return BATTERY_FULL;
187
+#endif /* __STUB__ */
188
+}
189
+
190
+string Robot::GetVersion() {
191
+#ifndef __STUB__
192
+    string ans;
193
+
194
+    SendCommand(string(1,ROBOT_CMD_GET_VERSION), &ans);
195
+    lastCommandStatus=SUCCESS;
196
+
197
+    if (ans.find("version")== string::npos) {
198
+        lastCommandStatus=INVALID_ANSWER;
199
+        throw (InvalidAnswerException + " raised in Robot::GetVersion. Invalid version (" + ans +")\n");
200
+    }
201
+
202
+    return ans;
203
+#else
204
+    return "1.3";
205
+#endif /* __STUB__ */
206
+}
207
+
208
+bool Robot::IsBusy() {
209
+#ifndef __STUB__
210
+    string ans;
211
+
212
+    SendCommand(string(1,ROBOT_CMD_IS_BUSY), &ans);
213
+    lastCommandStatus=SUCCESS;
214
+
215
+    if (ans.length()!=1) {
216
+        lastCommandStatus=INVALID_ANSWER;
217
+        throw (InvalidAnswerException + " raised in Robot::GetBatteryLevel. Invalid answer length (" + to_string(ans.length())+")\n");
218
+    }
219
+
220
+    if (ans[0]=='1')
221
+        return true;
222
+    else if (ans[0]=='0')
223
+        return false;
224
+    else {
225
+        lastCommandStatus=INVALID_ANSWER;
226
+        throw (InvalidAnswerException + " raised in Robot::IsBusy. Invalid value (" + ans[0] +")\n");
227
+    }
228
+#else
229
+    return false;
230
+#endif /* __STUB__ */
231
+}
232
+
233
+void Robot::CommunicationProlog() {}
234
+void Robot::CommunicationEpilog() {}
235
+
236
+/****************************/
237
+/* PRIVATE                  */
238
+/****************************/
239
+
240
+char Robot::SendCommand(string cmd, string *ans) {
241
+    string commandString;
242
+    commandString = this->AddChecksum(cmd);
243
+
244
+    this->CommunicationProlog(); // action avant le debut de la commande
245
+
246
+    ssize_t status = Send(commandString);
247
+
248
+    if (status == (ssize_t)commandString.length()) {
249
+        // Recuperation de la reponse
250
+        string commandResponse;
251
+        vector<char> endingChars;
252
+
253
+        endingChars.push_back('\r');
254
+        try {
255
+            commandResponse = Serial::Receive(endingChars,30);
256
+        } catch (string e) {
257
+            if (e.find("Timeout")!= string::npos)
258
+                lastCommandStatus= TIMEOUT_COMMAND;
259
+            else
260
+                lastCommandStatus=INVALID_ANSWER;
261
+
262
+            if (lastCommandStatus == TIMEOUT_COMMAND)
263
+                throw (Serial::TimeoutException + " raised in Robot::SendCommand. Timeout while receiving answer from robot.\n");
264
+            else
265
+                throw (e + " raised in Robot::SendCommand.\n");
266
+        }
267
+
268
+        this->CommunicationEpilog(); // Action a faire apres la commande
269
+
270
+        if (ValidateChecksum(&commandResponse, commandResponse)) {
271
+            ans->assign(commandResponse);
272
+        } else {
273
+            lastCommandStatus = INVALID_ANSWER;
274
+            throw InvalidAnswerException;
275
+        }
276
+
277
+        lastCommandStatus=SUCCESS;
278
+    } else {
279
+        lastCommandStatus=INVALID_COMMUNICATION_PORT;
280
+
281
+        throw IOErrorException;
282
+    }
283
+
284
+    return lastCommandStatus;
285
+}
286
+
287
+void Robot::CheckAnswer(string ans) {
288
+
289
+    if (ans.length()==1)
290
+    {
291
+        switch (ans.at(0)) {
292
+            case 'o':
293
+            case 'O':
294
+                lastCommandStatus=SUCCESS;
295
+                break;
296
+            case 'e':
297
+            case 'E':
298
+                lastCommandStatus=REJECTED_COMMAND;
299
+                break;
300
+            case 'c':
301
+            case 'C':
302
+                lastCommandStatus=INVALID_COMMAND;
303
+                break;
304
+            default:
305
+                lastCommandStatus = INVALID_ANSWER;
306
+                throw InvalidAnswerException;
307
+        }
308
+    } else {
309
+        lastCommandStatus = INVALID_ANSWER;
310
+        throw InvalidAnswerException;
311
+    }
312
+}
313
+
314
+string Robot::AddChecksum(string cmd) {
315
+    string commandWithChecksum(cmd);
316
+    char checksum=0;
317
+
318
+    commandWithChecksum.resize(cmd.length()+2, ' ');
319
+
320
+    for (size_t i=0; i<commandWithChecksum.length()-2; i++) {
321
+        checksum = checksum^commandWithChecksum.at(i);
322
+    }
323
+
324
+    commandWithChecksum.at(commandWithChecksum.length()-2) = checksum;
325
+    commandWithChecksum.at(commandWithChecksum.length()-1) = '\r';
326
+
327
+    return commandWithChecksum;
328
+}
329
+
330
+bool Robot::ValidateChecksum(string *answerWithoutChecksum, string answer) {
331
+    string localAnswer(answer, 0, answer.length()-1); // recopie de la chaine initiale, sans le dernier caractere (checksum)
332
+    char checksum=0;
333
+    bool status=false;
334
+
335
+    if (answer.length()<2) // trop court pour contenir un checksum
336
+        throw InvalidAnswerException;
337
+    else {
338
+        for (size_t i=0; i< answer.length()-1; i++) {
339
+            checksum = checksum^answer.at(i);
340
+        }
341
+
342
+        if (answer.at(answer.length()-1) == checksum) {
343
+            status=true;
344
+        }
345
+    }
346
+
347
+    answerWithoutChecksum->assign(localAnswer);
348
+    return status;
349
+}

+ 84
- 0
software/raspberry/superviseur-robot/src/Robot.h View File

@@ -0,0 +1,84 @@
1
+/*******************************************************************************
2
+ * Copyright (c) 2018 INSA - GEI, Toulouse, France.
3
+ * All rights reserved. This program and the accompanying materials
4
+ * are made available "AS IS", without any warranty of any kind.
5
+ *
6
+ * INSA assumes no responsibility for errors or omissions in the 
7
+ * software or documentation available. 
8
+ *
9
+ * Contributors:
10
+ *     Lucien Senaneuch - Initial API and implementation
11
+ *     Sebastien DI MERCURIO - Maintainer since Octobre 2018
12
+ *******************************************************************************/
13
+/**
14
+ * \file      robot.h
15
+ * \author    L.Senaneuch
16
+ * \version   1.0
17
+ * \date      06/06/2017
18
+ * \brief     Fonction permettant la communication avec le robot.
19
+ *
20
+ * \details   Ce fichier regroupe des fonctions facilitant la communication avec le robot en utilisant le port serie USART
21
+ */
22
+
23
+#ifndef __ROBOT_H__
24
+#define __ROBOT_H__
25
+
26
+#include <iostream>
27
+#include <string>
28
+#include <Serial.h>
29
+
30
+using namespace std;
31
+
32
+#define REJECTED_COMMAND                    -3
33
+#define INVALID_COMMAND                     -4
34
+#define TIMEOUT_COMMAND                     -5
35
+#define INVALID_ANSWER                      -6
36
+
37
+#define BATTERY_FULL                        2
38
+#define BATTERY_LOW                         1
39
+#define BATTERY_EMPTY                       0
40
+
41
+class Robot : public Serial {
42
+    public:
43
+        Robot();
44
+        virtual ~Robot();
45
+
46
+        char Open();
47
+        char Open(const char *path);
48
+        char Close();
49
+
50
+        int GetLastCommandStatus();
51
+
52
+        void Ping();
53
+        void Reset();
54
+
55
+        void StartWithoutWatchdog();
56
+        void StartWithWatchdog();
57
+        void ResetWatchdog();
58
+
59
+        void Move(int distance);
60
+        void Turn(int angle);
61
+
62
+        void PowerOff();
63
+
64
+        char GetBatteryLevel();
65
+        string GetVersion();
66
+        bool IsBusy();
67
+
68
+        // Ces deux methodes virtuelles sont a redefinir (surcharger) dans une classe qui etends la classe Robot
69
+        // Servez vous en pour faire une action avant (prologue) ou apres (epilogue) une commande au robot
70
+        virtual void CommunicationProlog();
71
+        virtual void CommunicationEpilog();
72
+
73
+        static const string InvalidAnswerException;
74
+    private:
75
+
76
+        int lastCommandStatus;
77
+
78
+        char SendCommand(string cmd, string *ans);
79
+        string AddChecksum(string cmd);
80
+        bool ValidateChecksum(string *answerWithoutChecksum, string answer);
81
+        void CheckAnswer(string ans);
82
+};
83
+
84
+#endif //__ROBOT_H__

+ 164
- 0
software/raspberry/superviseur-robot/src/Serial.cpp View File

@@ -0,0 +1,164 @@
1
+/*******************************************************************************
2
+ * Copyright (c) 2018 INSA - GEI, Toulouse, France.
3
+ * All rights reserved. This program and the accompanying materials
4
+ * are made available "AS IS", without any warranty of any kind.
5
+ *
6
+ * INSA assumes no responsibility for errors or omissions in the 
7
+ * software or documentation available. 
8
+ *
9
+ * Part of code Copyright ST Microelectronics.
10
+ *
11
+ * Contributors:
12
+ *     Lucien Senaneuch - Initial API and implementation
13
+ *     Sebastien DI MERCURIO - Maintainer since Octobre 2018
14
+ *******************************************************************************/
15
+
16
+#include <Serial.h>
17
+#include <unistd.h>
18
+#include <fcntl.h>
19
+#include <termios.h>
20
+
21
+#include <stdlib.h>
22
+
23
+#include <algorithm>
24
+
25
+const string Serial::TimeoutException = "Timeout exception";
26
+const string Serial::IOErrorException = "IO error exception";
27
+const string Serial::BufferOverflowException = "Buffer overflow exception";
28
+
29
+Serial::Serial() {
30
+    this->serialPortDescriptor=-1;
31
+}
32
+
33
+Serial::~Serial() {
34
+    this->Close();
35
+}
36
+
37
+char Serial::Open(void) {
38
+    return this->Open(DEFAULT_SERIAL_PORT, DEFAULT_BAUDRATE);
39
+}
40
+
41
+char Serial::Open(int baudrate) {
42
+    return this->Open(DEFAULT_SERIAL_PORT, baudrate);
43
+}
44
+
45
+char Serial::Open(const char *path, int baudrate) {
46
+#ifndef __STUB__
47
+    struct termios options;
48
+
49
+    if (this->IsOpen() == true) return COMMUNICATION_PORT_ALREADY_OPENED;
50
+
51
+    this->serialPortDescriptor = open(path, O_RDWR | O_NOCTTY | O_NDELAY);
52
+
53
+    if(this->serialPortDescriptor >= 0) {
54
+        fcntl(this->serialPortDescriptor, F_SETFL, 0);
55
+        tcgetattr(this->serialPortDescriptor, &options);
56
+        options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
57
+        cfsetospeed (&options, this->SetBaudrate(baudrate));
58
+        cfsetispeed (&options, this->SetBaudrate(baudrate));
59
+        options.c_cc[VMIN]=0;
60
+        options.c_cc[VTIME]=10;
61
+        tcsetattr(this->serialPortDescriptor, TCSANOW, &options);
62
+
63
+        return SUCCESS;
64
+    }
65
+    else {
66
+        std::cerr << "[Robot::Open] Can't open port " << path;
67
+        return INVALID_COMMUNICATION_PORT;
68
+    }
69
+#else
70
+    return SUCCESS;
71
+#endif
72
+}
73
+
74
+char Serial::Close(void) {
75
+#ifndef __STUB__
76
+    if (this->serialPortDescriptor<0) {
77
+        if (close(this->serialPortDescriptor) == 0)
78
+            return SUCCESS;
79
+        else return INVALID_COMMUNICATION_PORT;
80
+    } else return SUCCESS;
81
+#else
82
+    return SUCCESS;
83
+#endif
84
+}
85
+
86
+bool Serial::IsOpen() {
87
+    if(this->serialPortDescriptor >= 0)
88
+        return true;
89
+    else
90
+        return false;
91
+}
92
+
93
+ssize_t Serial::Send(string mes) {
94
+    ssize_t n;
95
+
96
+    n=write(this->serialPortDescriptor, (void*)mes.c_str(), mes.length());
97
+
98
+    if (n< (ssize_t)mes.length())
99
+        throw (IOErrorException + " raised in Serial::Send. Requested to send " + to_string(mes.length()) + " characters, sent only " + to_string(n) +"\n");
100
+    else
101
+        return n;
102
+}
103
+
104
+string Serial::Receive(int size) {
105
+    string mes;
106
+
107
+    while(mes.length() < (unsigned int)size){
108
+        mes += this->GetChar();
109
+    }
110
+
111
+    return mes;
112
+}
113
+
114
+string Serial::Receive(vector<char> endingChars,int maxLength) {
115
+    string mes;
116
+    char c;
117
+
118
+    bool characterFound = false;
119
+
120
+    do {
121
+        c= GetChar();
122
+
123
+        if (std::find(endingChars.begin(), endingChars.end(), c)!=endingChars.end()) //recherche du caractere dans la liste des caractere de fin
124
+            characterFound=true;
125
+        else {
126
+            mes += c;
127
+        }
128
+    } while ((mes.length()<(unsigned int)maxLength) && (characterFound==false));
129
+
130
+    if (mes.length()>=(unsigned int)maxLength) {
131
+        throw (BufferOverflowException + " raised in Serial::Receive. Received data exceed " + to_string(maxLength) + "chars\n");
132
+    }
133
+
134
+    return mes;
135
+}
136
+
137
+int Serial::SetBaudrate(int baudrate) {
138
+    switch(baudrate){
139
+        case 4800:
140
+            return baudrate = B4800;
141
+        case 9600:
142
+            return baudrate = B9600;
143
+        case 38400:
144
+            return baudrate = B38400;
145
+        case 57600:
146
+            return baudrate = B57600;
147
+        case 115200:
148
+            return baudrate = B115200;
149
+        default:
150
+            std::cerr << "Baudrate not supported" << std::endl;
151
+            return -1;
152
+    }
153
+}
154
+
155
+char Serial::GetChar() {
156
+    char c;
157
+
158
+    if (read(this->serialPortDescriptor, &c, 1) > 0)
159
+        return c;
160
+    else
161
+        throw (TimeoutException + " raised in Serial::GetChar\n");
162
+}
163
+
164
+

+ 49
- 0
software/raspberry/superviseur-robot/src/Serial.h View File

@@ -0,0 +1,49 @@
1
+/*
2
+ * Serial.h
3
+ *
4
+ *  Created on: 12 oct. 2018
5
+ *      Author: dimercur
6
+ */
7
+
8
+#ifndef SERIAL_H_
9
+#define SERIAL_H_
10
+
11
+#include <iostream>
12
+#include <string>
13
+#include <vector>
14
+
15
+using namespace std;
16
+
17
+#define SUCCESS                             0
18
+#define INVALID_COMMUNICATION_PORT          -1
19
+#define COMMUNICATION_PORT_ALREADY_OPENED   -2
20
+
21
+#define DEFAULT_SERIAL_PORT             "/dev/ttyS0"
22
+#define DEFAULT_BAUDRATE                9600
23
+
24
+class Serial {
25
+    public:
26
+        static const string TimeoutException;
27
+        static const string IOErrorException;
28
+        static const string BufferOverflowException;
29
+
30
+        Serial();
31
+        virtual ~Serial();
32
+
33
+        char Open(void);
34
+        char Open(int baudrate);
35
+        char Open(const char *path, int baudrate);
36
+        char Close(void);
37
+
38
+        bool IsOpen();
39
+        ssize_t Send(string mes);
40
+        string Receive(int size);
41
+        string Receive(vector<char> endingChars, int maxLength);
42
+
43
+    private:
44
+        int serialPortDescriptor;
45
+        int SetBaudrate(int baudrate);
46
+        char GetChar(); // read 1 char
47
+};
48
+
49
+#endif /* SERIAL_H_ */

+ 93
- 0
software/raspberry/superviseur-robot/src/TcpServer.cpp View File

@@ -0,0 +1,93 @@
1
+/*******************************************************************************
2
+ * Copyright (c) 2018 INSA - GEI, Toulouse, France.
3
+ * All rights reserved. This program and the accompanying materials
4
+ * are made available "AS IS", without any warranty of any kind.
5
+ *
6
+ * INSA assumes no responsibility for errors or omissions in the 
7
+ * software or documentation available. 
8
+ *
9
+ * Part of code Copyright ST Microelectronics.
10
+ *
11
+ * Contributors:
12
+ *     Lucien Senaneuch - Initial API and implementation
13
+ *     Sebastien DI MERCURIO - Maintainer since Octobre 2018
14
+ *******************************************************************************/
15
+
16
+
17
+#include "TcpServer.h"
18
+#include <netinet/in.h>
19
+#include <zconf.h>
20
+#include <vector>
21
+
22
+TcpServer::TcpServer() {
23
+    this->socketFD = -1;
24
+    this->socketClients.clear();
25
+}
26
+
27
+int TcpServer::Listen (int port) {
28
+    struct sockaddr_in server;
29
+
30
+    this->socketFD = socket(AF_INET, SOCK_STREAM, 0);
31
+    if(this->socketFD < 0){
32
+        throw invalid_argument("Can not create socket");
33
+    }
34
+
35
+    server.sin_addr.s_addr = INADDR_ANY;
36
+    server.sin_family = AF_INET;
37
+    server.sin_port = htons(port);
38
+
39
+    if(bind(this->socketFD, (struct sockaddr *) &server, sizeof(server)) < 0) {
40
+        throw invalid_argument("Can not bind socket");
41
+    }
42
+
43
+    listen(this->socketFD , NB_CONNECTION_MAX);
44
+
45
+    return this->socketFD;
46
+}
47
+
48
+int TcpServer::AcceptClient() {
49
+    struct sockaddr_in client;
50
+    int c = sizeof(struct sockaddr_in);
51
+
52
+    int fd = accept(this->socketFD,(struct sockaddr *) &client, (socklen_t*)&c);
53
+
54
+    if (fd >=0 )
55
+        this->socketClients.push_back(fd);
56
+    else throw invalid_argument("Accept failed in TcpServer::AcceptClient");
57
+
58
+    return fd;
59
+}
60
+
61
+int TcpServer::Send(int client, string mes) {
62
+    return write(client, mes.c_str(), mes.size());
63
+}
64
+
65
+string TcpServer::Receive(int client_fd, int size){
66
+    char tab[size];
67
+
68
+    if(recv(client_fd,tab,size,0) >0) {
69
+        tab[size] = 0;
70
+        return string(tab);
71
+    } else
72
+        return string();
73
+}
74
+
75
+int TcpServer::Broadcast(string mes) {
76
+    for (int socket : this->socketClients) {
77
+        int err = write(socket, mes.c_str(), mes.size());
78
+    }
79
+
80
+    return 0;
81
+}
82
+
83
+const vector<int> &TcpServer::getSocketClients() const {
84
+    return socketClients;
85
+}
86
+
87
+void TcpServer::SetSocketClients(const std::vector<int> &socketClients) {
88
+    this->socketClients = socketClients;
89
+}
90
+
91
+TcpServer::~TcpServer() {
92
+    close(this->socketFD);
93
+}

+ 35
- 0
software/raspberry/superviseur-robot/src/TcpServer.h View File

@@ -0,0 +1,35 @@
1
+//
2
+// Created by senaneuc on 12/06/18.
3
+//
4
+
5
+#ifndef TCP_SERVER_H_
6
+#define TCP_SERVER_H_
7
+
8
+#define NB_CONNECTION_MAX 5
9
+
10
+#include <iostream>
11
+#include <vector>
12
+
13
+using namespace std;
14
+
15
+class TcpServer {
16
+public:
17
+    TcpServer();
18
+    virtual ~TcpServer();
19
+
20
+    int Listen (int port);
21
+    int AcceptClient();
22
+    int Send(int clien_fd, string mes);
23
+    int Broadcast(string mes);
24
+    string Receive(int client_fd, int size);
25
+
26
+    const vector<int> &getSocketClients() const;
27
+
28
+    void SetSocketClients(const vector<int> &socketClients);
29
+
30
+private:
31
+    vector<int> socketClients;
32
+    int socketFD;
33
+};
34
+
35
+#endif /* TCP_SERVER_H_ */

+ 0
- 24
software/raspberry/superviseur-robot/src/definitions.h View File

@@ -14,30 +14,6 @@
14 14
 #ifndef DEFINITIONS_H
15 15
 #define DEFINITIONS_H
16 16
 
17
-#define OPEN_COM_DMB  'o'
18
-#define CLOSE_COM_DMB 'C'
19
-
20
-#define DMB_PING                'p'
21
-#define DMB_IDLE                'r'
22
-#define DMB_START_WITHOUT_WD    'u'
23
-#define DMB_START_WITH_WD       'W'
24
-#define DMB_RELOAD_WD           'w'
25
-#define DMB_GET_VBAT            'v'
26
-#define DMB_IS_BUSY             'b'
27
-#define DMB_MOVE                'M'
28
-#define DMB_TURN                'T'
29
-#define DMB_GO_FORWARD          'F'
30
-#define DMB_GO_BACK             'B'
31
-#define DMB_GO_LEFT             'L'
32
-#define DMB_GO_RIGHT            'R'
33
-#define DMB_STOP_MOVE           'S'
34
-
35
-#define ROBOT_TIMED_OUT -3
36
-#define ROBOT_UKNOWN_CMD -2
37
-#define ROBOT_ERROR  -1
38
-#define ROBOT_CHECKSUM  -4
39
-#define ROBOT_OK    0
40
-
41 17
 #define CAM_OPEN                    'A'
42 18
 #define CAM_CLOSE                   'I'
43 19
 #define CAM_ASK_ARENA               'y'

+ 1
- 1
software/raspberry/superviseur-robot/src/image.cpp View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * \file      imagerie.cpp
2
+ * \file      image.cpp
3 3
  * \author    L.Senaneuch
4 4
  * \version   1.0
5 5
  * \date      06/06/2017

+ 1
- 1
software/raspberry/superviseur-robot/src/image.h View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * \file      imagerie.h
2
+ * \file      image.h
3 3
  * \author    L.Senaneuch
4 4
  * \version   1.0
5 5
  * \date      06/06/2017

Loading…
Cancel
Save