mirror of
https://github.com/yoboujon/dumber.git
synced 2025-06-08 22:00:49 +02:00
Compare commits
20 commits
DUMBER-3_v
...
evoxx-dumb
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0121dc5707 | ||
![]() |
d89d36d040 | ||
![]() |
ce68e09679 | ||
![]() |
5b9656c67a | ||
fc2a05ab13 | |||
0792fc301d | |||
9df1899580 | |||
![]() |
8b39e4e099 | ||
866412162b | |||
61b7855f3c | |||
e018b5d0f4 | |||
5904a21007 | |||
![]() |
8f84e6d42e | ||
![]() |
80fa2240f8 | ||
![]() |
c67814a39b | ||
![]() |
b7fae99df4 | ||
![]() |
b75a775775 | ||
8d8dc0586f | |||
![]() |
7d8d4456aa | ||
![]() |
9a88a66cc1 |
19 changed files with 868 additions and 27 deletions
18
.vscode/c_cpp_properties.json
vendored
Normal file
18
.vscode/c_cpp_properties.json
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "linux-gcc-x64",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"compilerPath": "/usr/bin/gcc",
|
||||
"cStandard": "${default}",
|
||||
"cppStandard": "${default}",
|
||||
"intelliSenseMode": "linux-gcc-x64",
|
||||
"compilerArgs": [
|
||||
""
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
59
.vscode/settings.json
vendored
Normal file
59
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"C_Cpp_Runner.cCompilerPath": "gcc",
|
||||
"C_Cpp_Runner.cppCompilerPath": "g++",
|
||||
"C_Cpp_Runner.debuggerPath": "gdb",
|
||||
"C_Cpp_Runner.cStandard": "",
|
||||
"C_Cpp_Runner.cppStandard": "",
|
||||
"C_Cpp_Runner.msvcBatchPath": "",
|
||||
"C_Cpp_Runner.useMsvc": false,
|
||||
"C_Cpp_Runner.warnings": [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Wpedantic",
|
||||
"-Wshadow",
|
||||
"-Wformat=2",
|
||||
"-Wcast-align",
|
||||
"-Wconversion",
|
||||
"-Wsign-conversion",
|
||||
"-Wnull-dereference"
|
||||
],
|
||||
"C_Cpp_Runner.msvcWarnings": [
|
||||
"/W4",
|
||||
"/permissive-",
|
||||
"/w14242",
|
||||
"/w14287",
|
||||
"/w14296",
|
||||
"/w14311",
|
||||
"/w14826",
|
||||
"/w44062",
|
||||
"/w44242",
|
||||
"/w14905",
|
||||
"/w14906",
|
||||
"/w14263",
|
||||
"/w44265",
|
||||
"/w14928"
|
||||
],
|
||||
"C_Cpp_Runner.enableWarnings": true,
|
||||
"C_Cpp_Runner.warningsAsError": false,
|
||||
"C_Cpp_Runner.compilerArgs": [],
|
||||
"C_Cpp_Runner.linkerArgs": [],
|
||||
"C_Cpp_Runner.includePaths": [],
|
||||
"C_Cpp_Runner.includeSearch": [
|
||||
"*",
|
||||
"**/*"
|
||||
],
|
||||
"C_Cpp_Runner.excludeSearch": [
|
||||
"**/build",
|
||||
"**/build/**",
|
||||
"**/.*",
|
||||
"**/.*/**",
|
||||
"**/.vscode",
|
||||
"**/.vscode/**"
|
||||
],
|
||||
"C_Cpp_Runner.useAddressSanitizer": false,
|
||||
"C_Cpp_Runner.useUndefinedSanitizer": false,
|
||||
"C_Cpp_Runner.useLeakSanitizer": false,
|
||||
"C_Cpp_Runner.showCompilationTime": false,
|
||||
"C_Cpp_Runner.useLinkTimeOptimization": false,
|
||||
"C_Cpp_Runner.msvcSecureNoWarnings": false
|
||||
}
|
|
@ -8,3 +8,6 @@ Depot du projet de temps reel 4eme année au departement GEI de l'INSA Toulouse.
|
|||
- doc: contient les sujets de TD et TP
|
||||
- aruco_markers: Script de generation des tags (aruco) utilisés sur les robots
|
||||
|
||||
|
||||
/home/xenomai/.netbeans/remote/10.105.0.144/insa-10577-Linux-x86_64/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/dist/Debug__RPI_/GNU-Linux
|
||||
|
||||
|
|
|
@ -41,9 +41,21 @@
|
|||
kind="IMPORTANT_FILES_FOLDER">
|
||||
<itemPath>./Makefile</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="TestFiles"
|
||||
displayName="Test Files"
|
||||
projectFiles="false"
|
||||
kind="TEST_LOGICAL_FOLDER">
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
projectFiles="false"
|
||||
kind="IMPORTANT_FILES_FOLDER">
|
||||
<itemPath>./Makefile</itemPath>
|
||||
</logicalFolder>
|
||||
</logicalFolder>
|
||||
<sourceRootList>
|
||||
<Elem>lib</Elem>
|
||||
<Elem>lib</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile>./Makefile</projectmakefile>
|
||||
<confs>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</conf>
|
||||
<conf name="Debug__RPI_" type="1">
|
||||
<toolsSet>
|
||||
<developmentServer>xenomai@10.105.1.7:22</developmentServer>
|
||||
<developmentServer>xenomai@10.105.0.146:22</developmentServer>
|
||||
<platform>2</platform>
|
||||
</toolsSet>
|
||||
<dbx_gdbdebugger version="1">
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
</data>
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||
<group/>
|
||||
<group>
|
||||
<file>file:/home/boujon/Documents/dumber/software/raspberry/superviseur-robot/tasks.cpp</file>
|
||||
<file>file:/home/boujon/Documents/dumber/software/raspberry/superviseur-robot/tasks.h</file>
|
||||
</group>
|
||||
</open-files>
|
||||
</project-private>
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
#Tue Mar 26 14:16:07 CET 2024
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/main.cpp=c1711457904172
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/private/Makefile-variables.mk=c1711457904197
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__PC_.mk=c1711458297850
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/Makefile=c1711457904018
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/comrobot.h=c1711457904155
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/messages.h=c1711457904169
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__RPI_.mk=c1711458297867
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/.gitignore=c1711457904114
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Package-Debug__PC_.bash=c1711457904187
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/tasks.h=c1711457904245
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/README.md=c1711457904021
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/project.xml=c1711458720366
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-impl.mk=c1711457904182
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/superviseur.doxygen=c1711457904238
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/README.md=c1711457904124
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/tasks.cpp=c1711457904242
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/comrobot.cpp=c1711457904151
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/.dep.inc=c1711458948692
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/img.h=c1711457904162
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/camera.h=c1711457904141
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/test.cpp=c1711457904135
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/img.cpp=c1711457904159
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/base64.h=c1711457904130
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/compile-and-run-test=c1711457904132
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/commonitor.h=c1711457904148
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/wrapper.c=c1711457904248
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/camera.cpp=c1711457904138
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/messages.cpp=c1711457904165
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/gdbsudo.sh=c1711457904109
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/base64.cpp=c1711457904127
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/LICENSE=c1711457904121
|
||||
VERSION=1.3
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/commonitor.cpp=c1711457904144
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-variables.mk=c1711457904185
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Package-Debug__RPI_.bash=c1711457904190
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/.gitignore=c1711457904015
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/project.properties=c1711457904230
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/.gitignore=c1711457904118
|
|
@ -0,0 +1,39 @@
|
|||
#Thu Apr 04 18:04:54 CEST 2024
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/main.cpp=c1712238648769
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__PC_.mk=c1712238648773
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/private/Makefile-variables.mk=c1712238648790
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/Makefile=c1712238648634
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/comrobot.h=c1712238648755
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/messages.h=c1712238648766
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__RPI_.mk=c1712238648775
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/.gitignore=c1712238648721
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Package-Debug__PC_.bash=c1712238648782
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/tasks.h=c1712246527533
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/README.md=c1712238648637
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/project.xml=c1712238648826
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-impl.mk=c1712238648778
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/superviseur.doxygen=c1712238648829
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/README.md=c1712238648730
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/tasks.cpp=c1712246689680
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/comrobot.cpp=c1712238648753
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/.dep.inc=c1712238648629
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/img.h=c1712238648760
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/camera.h=c1712238648744
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/test.cpp=c1712238648739
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/img.cpp=c1712238648758
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/base64.h=c1712238648735
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/compile-and-run-test=c1712238648737
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/commonitor.h=c1712238648750
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/wrapper.c=c1712238648838
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/camera.cpp=c1712238648742
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/messages.cpp=c1712238648763
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/gdbsudo.sh=c1712238648718
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/base64.cpp=c1712238648733
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/LICENSE=c1712238648728
|
||||
VERSION=1.3
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/commonitor.cpp=c1712238648747
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-variables.mk=c1712238648780
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Package-Debug__RPI_.bash=c1712238648784
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/.gitignore=c1712238648632
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/project.properties=c1712238648823
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/.gitignore=c1712238648726
|
|
@ -0,0 +1,39 @@
|
|||
#Tue Mar 26 16:47:57 CET 2024
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/main.cpp=c1711457904172
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/private/Makefile-variables.mk=c1711457904197
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__PC_.mk=c1711458297850
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/Makefile=c1711457904018
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/comrobot.h=c1711457904155
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/messages.h=c1711457904169
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__RPI_.mk=c1711458297867
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/.gitignore=c1711457904114
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Package-Debug__PC_.bash=c1711457904187
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/tasks.h=c1711467801732
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/README.md=c1711457904021
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/project.xml=c1711458720366
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-impl.mk=c1711457904182
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/superviseur.doxygen=c1711457904238
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/README.md=c1711457904124
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/tasks.cpp=c1711468071294
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/comrobot.cpp=c1711457904151
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/img.h=c1711457904162
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/.dep.inc=c1711458948692
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/camera.h=c1711457904141
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/test.cpp=c1711457904135
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/img.cpp=c1711457904159
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/base64.h=c1711457904130
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/compile-and-run-test=c1711457904132
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/commonitor.h=c1711457904148
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/wrapper.c=c1711457904248
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/camera.cpp=c1711457904138
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/messages.cpp=c1711457904165
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/gdbsudo.sh=c1711457904109
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/base64.cpp=c1711457904127
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/LICENSE=c1711457904121
|
||||
VERSION=1.3
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/commonitor.cpp=c1711457904144
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-variables.mk=c1711457904185
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Package-Debug__RPI_.bash=c1711457904190
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/.gitignore=c1711457904015
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/project.properties=c1711457904230
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/.gitignore=c1711457904118
|
|
@ -0,0 +1,39 @@
|
|||
#Tue May 07 19:37:34 CEST 2024
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/main.cpp=c1712238648769
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__PC_.mk=c1712238648773
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/private/Makefile-variables.mk=c1712238648790
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/Makefile=c1712238648634
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/comrobot.h=c1712238648755
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/messages.h=c1712238648766
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-Debug__RPI_.mk=c1712238648775
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/.gitignore=c1712238648721
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Package-Debug__PC_.bash=c1712238648782
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/tasks.h=c1715102079582
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/README.md=c1712238648637
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/project.xml=c1712238648826
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-impl.mk=c1712238648778
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/superviseur.doxygen=c1712238648829
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/README.md=c1712238648730
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/tasks.cpp=c1715103442554
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/comrobot.cpp=c1712238648753
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/.dep.inc=c1712238648629
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/img.h=c1712238648760
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/camera.h=c1712238648744
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/test.cpp=c1712238648739
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/img.cpp=c1712238648758
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/base64.h=c1712238648735
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/compile-and-run-test=c1712238648737
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/commonitor.h=c1712238648750
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/wrapper.c=c1712238648838
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/camera.cpp=c1712238648742
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/messages.cpp=c1712238648763
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/gdbsudo.sh=c1712238648718
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/base64.cpp=c1712238648733
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/LICENSE=c1712238648728
|
||||
VERSION=1.3
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/commonitor.cpp=c1712238648747
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Makefile-variables.mk=c1712238648780
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/Package-Debug__RPI_.bash=c1712238648784
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/.gitignore=c1712238648632
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/nbproject/project.properties=c1712238648823
|
||||
/home/marin-muller/Documents/4A/Robot/dumber/software/raspberry/superviseur-robot/lib/base64/.gitignore=c1712238648726
|
|
@ -1,2 +1,2 @@
|
|||
#Tue Nov 13 11:04:27 CET 2018
|
||||
#Tue May 14 13:44:12 CEST 2024
|
||||
project.license=gpl30
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<make-dep-projects/>
|
||||
<sourceRootList>
|
||||
<sourceRootElem>lib</sourceRootElem>
|
||||
<sourceRootElem>lib</sourceRootElem>
|
||||
</sourceRootList>
|
||||
<confList>
|
||||
<confElem>
|
||||
|
|
|
@ -17,15 +17,26 @@
|
|||
|
||||
#include "tasks.h"
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
// Déclaration des priorités des taches
|
||||
// Task priority: higher has the best priority
|
||||
#define PRIORITY_TSERVER 30
|
||||
#define PRIORITY_TOPENCOMROBOT 20
|
||||
#define PRIORITY_TMOVE 20
|
||||
#define PRIORITY_TSENDTOMON 22
|
||||
#define PRIORITY_TRECEIVEFROMMON 25
|
||||
#define PRIORITY_TSTARTROBOT 20
|
||||
|
||||
// Added Priorities
|
||||
// Camera is the most important as it has the most demanding timing request (10ms)
|
||||
#define PRIORITY_TCAMERA 21
|
||||
// Battery has a timing request of 500ms which is not important
|
||||
#define PRIORITY_TBATTERY 19
|
||||
// These priorities are for "Semaphored" tasks, not periodic.
|
||||
// Their priority is lower.
|
||||
#define PRIORITY_TSETCAMERA 18
|
||||
#define PRIOTITY_TARENA 17
|
||||
#define PRIOTITY_TPOSITION 16
|
||||
|
||||
/*
|
||||
* Some remarks:
|
||||
|
@ -37,7 +48,7 @@
|
|||
* 3- Data flow is probably not optimal
|
||||
*
|
||||
* 4- Take into account that ComRobot::Write will block your task when serial buffer is full,
|
||||
* time for internal buffer to flush
|
||||
* time for interponal buffer to flush
|
||||
*
|
||||
* 5- Same behavior existe for ComMonitor::Write !
|
||||
*
|
||||
|
@ -73,6 +84,28 @@ void Tasks::Init() {
|
|||
cerr << "Error mutex create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Added Mutexes
|
||||
if (err = rt_mutex_create(&mutex_batteryGet, NULL)) {
|
||||
cerr << "Error mutex create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_mutex_create(&mutex_cameraStatus, NULL)) {
|
||||
cerr << "Error mutex create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_mutex_create(&mutex_camera, NULL)) {
|
||||
cerr << "Error mutex create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_mutex_create(&mutex_arena, NULL)) {
|
||||
cerr << "Error mutex create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_mutex_create(&mutex_arenaStatus, NULL)) {
|
||||
cerr << "Error mutex create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
cout << "Mutexes created successfully" << endl << flush;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
@ -94,6 +127,20 @@ void Tasks::Init() {
|
|||
cerr << "Error semaphore create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Added Semaphores
|
||||
if (err = rt_sem_create(&sem_instantBattery, NULL, 0, S_FIFO)) {
|
||||
cerr << "Error semaphore create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_sem_create(&sem_manageCamera, NULL, 0, S_FIFO)) {
|
||||
cerr << "Error semaphore create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_sem_create(&sem_arenaChoice, NULL, 0, S_FIFO)) {
|
||||
cerr << "Error semaphore create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
cout << "Semaphores created successfully" << endl << flush;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
@ -123,6 +170,28 @@ void Tasks::Init() {
|
|||
cerr << "Error task create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
// Added tasks
|
||||
if (err = rt_task_create(&th_batteryPeriodic, "th_batteryPeriodic", 0, PRIORITY_TBATTERY, 0)) {
|
||||
cerr << "Error task create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_task_create(&th_battery, "th_battery", 0, PRIORITY_TBATTERY, 0)) {
|
||||
cerr << "Error task create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_task_create(&th_cameraManage, "th_cameraManage", 0, PRIORITY_TSETCAMERA, 0)) {
|
||||
cerr << "Error task create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_task_create(&th_cameraImage, "th_cameraImage", 0, PRIORITY_TCAMERA, 0)) {
|
||||
cerr << "Error task create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_task_create(&th_arenaChoice, "th_arenaChoice", 0, PRIOTITY_TARENA, 0)) {
|
||||
cerr << "Error task create: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
cout << "Tasks created successfully" << endl << flush;
|
||||
|
||||
/**************************************************************************************/
|
||||
|
@ -168,6 +237,28 @@ void Tasks::Run() {
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Added Tasks
|
||||
if (err = rt_task_start(&th_batteryPeriodic, (void(*)(void*)) & Tasks::BatteryPeriodicTask, this)) {
|
||||
cerr << "Error task start: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_task_start(&th_battery, (void(*)(void*)) & Tasks::BatteryTask, this)) {
|
||||
cerr << "Error task start: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_task_start(&th_cameraManage, (void(*)(void*)) & Tasks::ManageCameraTask, this)) {
|
||||
cerr << "Error task start: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_task_start(&th_cameraImage, (void(*)(void*)) & Tasks::ImageCameraTask, this)) {
|
||||
cerr << "Error task start: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (err = rt_task_start(&th_arenaChoice, (void(*)(void*)) & Tasks::ArenaChoiceTask, this)) {
|
||||
cerr << "Error task start: " << strerror(-err) << endl << flush;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
cout << "Tasks launched" << endl << flush;
|
||||
}
|
||||
|
||||
|
@ -276,6 +367,77 @@ void Tasks::ReceiveFromMonTask(void *arg) {
|
|||
move = msgRcv->GetID();
|
||||
rt_mutex_release(&mutex_move);
|
||||
}
|
||||
|
||||
// Added messages
|
||||
// Battery
|
||||
else if (msgRcv->CompareID(MESSAGE_ROBOT_BATTERY_GET)) {
|
||||
rt_mutex_acquire(&mutex_batteryGet, TM_INFINITE);
|
||||
batteryEnabled = true;
|
||||
rt_mutex_release(&mutex_batteryGet);
|
||||
|
||||
// Calling BatteryTask, unblocking the thread.
|
||||
rt_sem_v(&sem_instantBattery);
|
||||
}
|
||||
// Camera
|
||||
else if (msgRcv->CompareID(MESSAGE_CAM_OPEN)) {
|
||||
rt_mutex_acquire(&mutex_cameraStatus, TM_INFINITE);
|
||||
if(CameraStatusEnum::CLOSED == cameraStatus)
|
||||
cameraStatus = CameraStatusEnum::OPENING;
|
||||
rt_mutex_release(&mutex_cameraStatus);
|
||||
|
||||
// Calling manageCamera, unblocking the thread.
|
||||
rt_sem_v(&sem_manageCamera);
|
||||
}
|
||||
else if (msgRcv->CompareID(MESSAGE_CAM_CLOSE)) {
|
||||
rt_mutex_acquire(&mutex_cameraStatus, TM_INFINITE);
|
||||
if(CameraStatusEnum::OPENED == cameraStatus)
|
||||
cameraStatus = CameraStatusEnum::CLOSING;
|
||||
rt_mutex_release(&mutex_cameraStatus);
|
||||
|
||||
// Calling manageCamera, unblocking the thread.
|
||||
rt_sem_v(&sem_manageCamera);
|
||||
}
|
||||
// Arena
|
||||
else if (msgRcv->CompareID(MESSAGE_CAM_ASK_ARENA)) {
|
||||
rt_mutex_acquire(&mutex_arenaStatus, TM_INFINITE);
|
||||
if(ArenaStatusEnum::NONE == arenaStatus)
|
||||
arenaStatus = ArenaStatusEnum::SEARCHING;
|
||||
rt_mutex_release(&mutex_arenaStatus);
|
||||
|
||||
// Calling arenaChoice, unblocking the thread.
|
||||
rt_sem_v(&sem_arenaChoice);
|
||||
}
|
||||
else if (msgRcv->CompareID(MESSAGE_CAM_ARENA_CONFIRM)) {
|
||||
rt_mutex_acquire(&mutex_arenaStatus, TM_INFINITE);
|
||||
if(ArenaStatusEnum::SEARCHED == arenaStatus)
|
||||
arenaStatus = ArenaStatusEnum::CONFIRM;
|
||||
rt_mutex_release(&mutex_arenaStatus);
|
||||
|
||||
// Calling arenaChoice, unblocking the thread.
|
||||
rt_sem_v(&sem_arenaChoice);
|
||||
}
|
||||
else if (msgRcv->CompareID(MESSAGE_CAM_ARENA_INFIRM)) {
|
||||
rt_mutex_acquire(&mutex_arenaStatus, TM_INFINITE);
|
||||
if(ArenaStatusEnum::SEARCHED == arenaStatus)
|
||||
arenaStatus = ArenaStatusEnum::INFIRM;
|
||||
rt_mutex_release(&mutex_arenaStatus);
|
||||
|
||||
// Calling arenaChoice, unblocking the thread.
|
||||
rt_sem_v(&sem_arenaChoice);
|
||||
}
|
||||
else if (msgRcv->CompareID(MESSAGE_CAM_POSITION_COMPUTE_START)){
|
||||
rt_mutex_acquire(&mutex_positionEnabled, TM_INFINITE);
|
||||
positionEnabled = true;
|
||||
rt_mutex_release(&mutex_positionEnabled);
|
||||
}
|
||||
else if (msgRcv->CompareID(MESSAGE_CAM_POSITION_COMPUTE_STOP)){
|
||||
rt_mutex_acquire(&mutex_positionEnabled, TM_INFINITE);
|
||||
positionEnabled = false;
|
||||
rt_mutex_release(&mutex_positionEnabled);
|
||||
}
|
||||
else if (msgRcv->CompareID(MESSAGE_CAM_IMAGE)) {
|
||||
//?
|
||||
}
|
||||
delete(msgRcv); // mus be deleted manually, no consumer
|
||||
}
|
||||
}
|
||||
|
@ -336,7 +498,7 @@ void Tasks::StartRobotTask(void *arg) {
|
|||
cout << ")" << endl;
|
||||
|
||||
cout << "Movement answer: " << msgSend->ToString() << endl << flush;
|
||||
WriteInQueue(&q_messageToMon, msgSend); // msgSend will be deleted by sendToMon
|
||||
WriteInQueue(&q_messageToMon, msgSend); // msgSend will be deleted by sendToMon
|
||||
|
||||
if (msgSend->GetID() == MESSAGE_ANSWER_ACK) {
|
||||
rt_mutex_acquire(&mutex_robotStarted, TM_INFINITE);
|
||||
|
@ -364,7 +526,7 @@ void Tasks::MoveTask(void *arg) {
|
|||
|
||||
while (1) {
|
||||
rt_task_wait_period(NULL);
|
||||
cout << "Periodic movement update";
|
||||
//cout << "Periodic movement update";
|
||||
rt_mutex_acquire(&mutex_robotStarted, TM_INFINITE);
|
||||
rs = robotStarted;
|
||||
rt_mutex_release(&mutex_robotStarted);
|
||||
|
@ -376,10 +538,10 @@ void Tasks::MoveTask(void *arg) {
|
|||
cout << " move: " << cpMove;
|
||||
|
||||
rt_mutex_acquire(&mutex_robot, TM_INFINITE);
|
||||
robot.Write(new Message((MessageID)cpMove));
|
||||
robot.Write(new Message((MessageID) cpMove));
|
||||
rt_mutex_release(&mutex_robot);
|
||||
}
|
||||
cout << endl << flush;
|
||||
//cout << endl << flush;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -415,3 +577,298 @@ Message *Tasks::ReadInQueue(RT_QUEUE *queue) {
|
|||
return msg;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* Added Tasks */
|
||||
/************************************************************************/
|
||||
|
||||
void Tasks::BatteryPeriodicTask(void * arg) {
|
||||
// Variables
|
||||
int rs(0);
|
||||
bool be(false);
|
||||
|
||||
cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
|
||||
// Synchronization barrier (waiting that all tasks are starting)
|
||||
rt_sem_p(&sem_barrier, TM_INFINITE);
|
||||
|
||||
|
||||
// Periodic task set to 500ms
|
||||
rt_task_set_periodic(NULL, TM_NOW, 500000000);
|
||||
|
||||
while (1) {
|
||||
rt_task_wait_period(NULL);
|
||||
this->SendBattery(rs,be);
|
||||
}
|
||||
}
|
||||
|
||||
void Tasks::BatteryTask(void * arg) {
|
||||
// Variables
|
||||
int rs(0);
|
||||
bool be(false);
|
||||
|
||||
cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
|
||||
// Synchronization barrier (waiting that all tasks are starting)
|
||||
rt_sem_p(&sem_barrier, TM_INFINITE);
|
||||
|
||||
while(1)
|
||||
{
|
||||
// Called when semaphore arenChoice incremented
|
||||
rt_sem_p(&sem_instantBattery, TM_INFINITE);
|
||||
this->SendBattery(rs,be);
|
||||
}
|
||||
}
|
||||
|
||||
void Tasks::ManageCameraTask(void * arg)
|
||||
{
|
||||
// Variables
|
||||
int rs(0);
|
||||
CameraStatusEnum cs(CameraStatusEnum::CLOSED);
|
||||
|
||||
// Checking if all tasks started
|
||||
cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
|
||||
rt_sem_p(&sem_barrier, TM_INFINITE);
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
// Called when semaphore manageCamera incremented
|
||||
rt_sem_p(&sem_manageCamera, TM_INFINITE);
|
||||
|
||||
// Check the status of the camera and store it in a local variable
|
||||
rt_mutex_acquire(&mutex_cameraStatus, TM_INFINITE);
|
||||
cs = cameraStatus;
|
||||
rt_mutex_release(&mutex_cameraStatus);
|
||||
|
||||
// Opening the camera
|
||||
if(CameraStatusEnum::OPENING == cs)
|
||||
{
|
||||
const MessageID tempMessage = this->OpenCamera();
|
||||
WriteInQueue(&q_messageToMon, new Message(tempMessage));
|
||||
}
|
||||
// Closing the camera
|
||||
if(CameraStatusEnum::CLOSING == cs)
|
||||
{
|
||||
this->CloseCamera();
|
||||
WriteInQueue(&q_messageToMon, new Message(MESSAGE_ANSWER_ACK));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Tasks::ImageCameraTask(void * arg)
|
||||
{
|
||||
// Variables
|
||||
CameraStatusEnum cs = CameraStatusEnum::CLOSED;
|
||||
Arena a = Arena();
|
||||
std::vector<MessagePosition*> msgPos = {};
|
||||
MessageImg *msgImg = nullptr;
|
||||
bool pe = false;
|
||||
std::list<Position> listPos = {};
|
||||
|
||||
cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
|
||||
// Synchronization barrier (waiting that all tasks are starting)
|
||||
rt_sem_p(&sem_barrier, TM_INFINITE);
|
||||
|
||||
// Periodic task set to 10ms
|
||||
rt_task_set_periodic(NULL, TM_NOW, 100000000);
|
||||
|
||||
while(1)
|
||||
{
|
||||
rt_task_wait_period(NULL);
|
||||
|
||||
// Check the status of the camera
|
||||
rt_mutex_acquire(&mutex_cameraStatus, TM_INFINITE);
|
||||
const CameraStatusEnum cs = cameraStatus;
|
||||
rt_mutex_release(&mutex_cameraStatus);
|
||||
|
||||
// Gathering arena
|
||||
rt_mutex_acquire(&mutex_arena, TM_INFINITE);
|
||||
a = arena;
|
||||
rt_mutex_release(&mutex_arena);
|
||||
|
||||
rt_mutex_acquire(&mutex_positionEnabled, TM_INFINITE);
|
||||
pe = positionEnabled;
|
||||
rt_mutex_release(&mutex_positionEnabled);
|
||||
|
||||
// Only gather image if opened
|
||||
if(CameraStatusEnum::OPENED == cs)
|
||||
{
|
||||
// Gathering an image from the camera
|
||||
rt_mutex_acquire(&mutex_camera, TM_INFINITE);
|
||||
Img * img = new Img(cam->Grab());
|
||||
rt_mutex_release(&mutex_camera);
|
||||
|
||||
// If arena has been found, draw overlay
|
||||
if(!a.IsEmpty())
|
||||
img->DrawArena(a);
|
||||
|
||||
// Gathering position
|
||||
if(pe)
|
||||
{
|
||||
// Gather every robot available
|
||||
listPos = img->SearchRobot(a);
|
||||
// For every position, draw the robot and send the message
|
||||
for(auto l : listPos)
|
||||
{
|
||||
img->DrawRobot(l);
|
||||
msgPos.emplace_back(new MessagePosition(MESSAGE_CAM_POSITION, l));
|
||||
}
|
||||
}
|
||||
|
||||
msgImg= new MessageImg(MESSAGE_CAM_IMAGE, img);
|
||||
rt_mutex_acquire(&mutex_monitor, TM_INFINITE);
|
||||
// Writing every message position
|
||||
for(auto mp : msgPos)
|
||||
monitor.Write(mp);
|
||||
// Writing every message image
|
||||
monitor.Write(msgImg);
|
||||
rt_mutex_release(&mutex_monitor);
|
||||
|
||||
// clearing the vector because all its values are unassigned
|
||||
msgPos.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Tasks::ArenaChoiceTask(void * arg)
|
||||
{
|
||||
// Variables
|
||||
Img* img = nullptr;
|
||||
Arena a;
|
||||
ArenaStatusEnum as(ArenaStatusEnum::NONE);
|
||||
|
||||
cout << "Start " << __PRETTY_FUNCTION__ << endl << flush;
|
||||
rt_sem_p(&sem_barrier, TM_INFINITE);
|
||||
|
||||
while(1)
|
||||
{
|
||||
// Called when semaphore arenChoice incremented
|
||||
rt_sem_p(&sem_arenaChoice, TM_INFINITE);
|
||||
|
||||
// Check the status of the arena
|
||||
rt_mutex_acquire(&mutex_arenaStatus, TM_INFINITE);
|
||||
as = arenaStatus;
|
||||
rt_mutex_release(&mutex_arenaStatus);
|
||||
|
||||
// ASK_ARENA
|
||||
if(as == ArenaStatusEnum::SEARCHING)
|
||||
{
|
||||
// Change status for next command
|
||||
rt_mutex_acquire(&mutex_arenaStatus, TM_INFINITE);
|
||||
arenaStatus = ArenaStatusEnum::SEARCHED;
|
||||
rt_mutex_release(&mutex_arenaStatus);
|
||||
|
||||
rt_mutex_acquire(&mutex_cameraStatus, TM_INFINITE);
|
||||
const CameraStatusEnum cs = cameraStatus;
|
||||
rt_mutex_release(&mutex_cameraStatus);
|
||||
|
||||
// Only search if camera is already opened
|
||||
if(CameraStatusEnum::OPENED == cs)
|
||||
{
|
||||
// Prepare to close the camera
|
||||
rt_mutex_acquire(&mutex_cameraStatus, TM_INFINITE);
|
||||
cameraStatus = CameraStatusEnum::CLOSING;
|
||||
rt_mutex_release(&mutex_cameraStatus);
|
||||
|
||||
// Gathering last image
|
||||
rt_mutex_acquire(&mutex_camera, TM_INFINITE);
|
||||
img = new Img(cam->Grab());
|
||||
rt_mutex_release(&mutex_camera);
|
||||
// Closing camera when prompted
|
||||
this->CloseCamera();
|
||||
// Putting the arena overlay if found
|
||||
a = img->SearchArena();
|
||||
}
|
||||
|
||||
if(a.IsEmpty())
|
||||
WriteInQueue(&q_messageToMon, new Message(MESSAGE_ANSWER_NACK));
|
||||
// If arena is not empty show the arena
|
||||
else {
|
||||
// Adding overlay on the image
|
||||
img->DrawArena(a);
|
||||
// Sending it to the writing queue
|
||||
MessageImg *msgImg = new MessageImg(MESSAGE_CAM_IMAGE, img);
|
||||
rt_mutex_acquire(&mutex_monitor, TM_INFINITE);
|
||||
monitor.Write(msgImg);
|
||||
rt_mutex_release(&mutex_monitor);
|
||||
WriteInQueue(&q_messageToMon, new Message(MESSAGE_ANSWER_ACK));
|
||||
}
|
||||
}
|
||||
|
||||
// ARENA_CONFIRM / INFIRM
|
||||
if((ArenaStatusEnum::CONFIRM == as) || (ArenaStatusEnum::INFIRM == as))
|
||||
{
|
||||
rt_mutex_acquire(&mutex_arena, TM_INFINITE);
|
||||
arena = a;
|
||||
rt_mutex_release(&mutex_arena);
|
||||
|
||||
// empty the temporary arena
|
||||
a = Arena();
|
||||
// Re-open the camera (showing overlay if arena is stored)
|
||||
rt_mutex_acquire(&mutex_cameraStatus, TM_INFINITE);
|
||||
cameraStatus = CameraStatusEnum::OPENING;
|
||||
rt_mutex_release(&mutex_cameraStatus);
|
||||
this->OpenCamera();
|
||||
|
||||
// Change the status of the arena to default value
|
||||
rt_mutex_acquire(&mutex_arenaStatus, TM_INFINITE);
|
||||
arenaStatus = ArenaStatusEnum::NONE;
|
||||
rt_mutex_release(&mutex_arenaStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* Added functions */
|
||||
/************************************************************************/
|
||||
|
||||
void Tasks::SendBattery(int& rs, bool& be)
|
||||
{
|
||||
// Verify that the robot has started
|
||||
rt_mutex_acquire(&mutex_robotStarted, TM_INFINITE);
|
||||
rs = robotStarted;
|
||||
rt_mutex_release(&mutex_robotStarted);
|
||||
|
||||
// Checking if battery should be gathered
|
||||
rt_mutex_acquire(&mutex_batteryGet, TM_INFINITE);
|
||||
be = batteryEnabled;
|
||||
rt_mutex_release(&mutex_batteryGet);
|
||||
|
||||
if ((rs != 0) && be) {
|
||||
// Acquire the battery level and send it to the message queue
|
||||
rt_mutex_acquire(&mutex_robot, TM_INFINITE);
|
||||
Message* msg = robot.Write(new Message(MESSAGE_ROBOT_BATTERY_GET));
|
||||
rt_mutex_release(&mutex_robot);
|
||||
WriteInQueue(&q_messageToMon, msg);
|
||||
}
|
||||
}
|
||||
|
||||
MessageID Tasks::OpenCamera()
|
||||
{
|
||||
cout << "Called " << __PRETTY_FUNCTION__ << endl << flush;
|
||||
// Opening camera
|
||||
rt_mutex_acquire(&mutex_camera, TM_INFINITE);
|
||||
const bool isOpened = cam->Open();
|
||||
rt_mutex_release(&mutex_camera);
|
||||
|
||||
// Changing status if succeeded
|
||||
if(isOpened)
|
||||
{
|
||||
rt_mutex_acquire(&mutex_cameraStatus, TM_INFINITE);
|
||||
cameraStatus = CameraStatusEnum::OPENED;
|
||||
rt_mutex_release(&mutex_cameraStatus);
|
||||
}
|
||||
return (isOpened ? MESSAGE_ANSWER_ACK : MESSAGE_ANSWER_NACK);
|
||||
}
|
||||
|
||||
void Tasks::CloseCamera()
|
||||
{
|
||||
cout << "\n\nCalled " << __PRETTY_FUNCTION__ << "\n\n" << flush;
|
||||
// Closing Camera
|
||||
rt_mutex_acquire(&mutex_camera, TM_INFINITE);
|
||||
cam->Close();
|
||||
rt_mutex_release(&mutex_camera);
|
||||
|
||||
// Changing Status
|
||||
rt_mutex_acquire(&mutex_cameraStatus, TM_INFINITE);
|
||||
cameraStatus = CameraStatusEnum::CLOSED;
|
||||
rt_mutex_release(&mutex_cameraStatus);
|
||||
}
|
|
@ -36,6 +36,33 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
* @brief The monitor can change the shared data 'cameraStatus' to
|
||||
* either 'OPENING' or 'CLOSING'. ManageCamera() will be awake afterwards.
|
||||
* Then the variable can switch state to open or close the camera.
|
||||
* Default value should be 'CLOSED'.
|
||||
*/
|
||||
enum class CameraStatusEnum {
|
||||
CLOSED,
|
||||
OPENING,
|
||||
OPENED,
|
||||
CLOSING
|
||||
};
|
||||
|
||||
/**
|
||||
* @ref CameraStatusEnum "Same principle"
|
||||
* @brief The arena can change the shared data 'arenaStatus' to
|
||||
* either 'SEARCHING', 'CONFIRM' or 'INFIRM'. The other status will be
|
||||
* changed by the task ArenaChoice().
|
||||
*/
|
||||
enum class ArenaStatusEnum {
|
||||
NONE,
|
||||
SEARCHING,
|
||||
SEARCHED,
|
||||
CONFIRM,
|
||||
INFIRM
|
||||
};
|
||||
|
||||
class Tasks {
|
||||
public:
|
||||
/**
|
||||
|
@ -67,6 +94,23 @@ private:
|
|||
int robotStarted = 0;
|
||||
int move = MESSAGE_ROBOT_STOP;
|
||||
|
||||
/************************************************************************/
|
||||
/* Added variables */
|
||||
/************************************************************************/
|
||||
|
||||
// when gathering battery, set to true
|
||||
bool batteryEnabled = false;
|
||||
// current status of the camera
|
||||
CameraStatusEnum cameraStatus = CameraStatusEnum::CLOSED;
|
||||
// camera object
|
||||
Camera* cam = new Camera(sm, 10);
|
||||
// current status of the arena
|
||||
ArenaStatusEnum arenaStatus = ArenaStatusEnum::NONE;
|
||||
// arena object (overlay of the arena on the img)
|
||||
Arena arena;
|
||||
// when gathering position, set to true
|
||||
bool positionEnabled = false;
|
||||
|
||||
/**********************************************************************/
|
||||
/* Tasks */
|
||||
/**********************************************************************/
|
||||
|
@ -77,6 +121,12 @@ private:
|
|||
RT_TASK th_startRobot;
|
||||
RT_TASK th_move;
|
||||
|
||||
RT_TASK th_batteryPeriodic;
|
||||
RT_TASK th_battery;
|
||||
RT_TASK th_cameraManage;
|
||||
RT_TASK th_cameraImage;
|
||||
RT_TASK th_arenaChoice;
|
||||
|
||||
/**********************************************************************/
|
||||
/* Mutex */
|
||||
/**********************************************************************/
|
||||
|
@ -85,6 +135,21 @@ private:
|
|||
RT_MUTEX mutex_robotStarted;
|
||||
RT_MUTEX mutex_move;
|
||||
|
||||
// Added mutexes
|
||||
|
||||
// Locking the variable 'robotBatteryGet'
|
||||
RT_MUTEX mutex_batteryGet;
|
||||
// Locking the variable 'cameraStatus'
|
||||
RT_MUTEX mutex_cameraStatus;
|
||||
// Locking the variable 'cam'
|
||||
RT_MUTEX mutex_camera;
|
||||
// Locking the variable 'arena'
|
||||
RT_MUTEX mutex_arena;
|
||||
// Locking the variable 'arenaStatus'
|
||||
RT_MUTEX mutex_arenaStatus;
|
||||
// Locking the variable 'positionEnabled'
|
||||
RT_MUTEX mutex_positionEnabled;
|
||||
|
||||
/**********************************************************************/
|
||||
/* Semaphores */
|
||||
/**********************************************************************/
|
||||
|
@ -93,6 +158,15 @@ private:
|
|||
RT_SEM sem_serverOk;
|
||||
RT_SEM sem_startRobot;
|
||||
|
||||
// Added semaphores
|
||||
|
||||
// Used when we want to show the battery once.
|
||||
RT_SEM sem_instantBattery;
|
||||
// Used to call ManageCameraTask (non-periodic)
|
||||
RT_SEM sem_manageCamera;
|
||||
// Used to call ArenaChoiceTask (non-periodic)
|
||||
RT_SEM sem_arenaChoice;
|
||||
|
||||
/**********************************************************************/
|
||||
/* Message queues */
|
||||
/**********************************************************************/
|
||||
|
@ -132,6 +206,61 @@ private:
|
|||
*/
|
||||
void MoveTask(void *arg);
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/* Added Tasks */
|
||||
/************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief [periodic: 500ms]
|
||||
* Task managing the battery. When prompted will get the battery
|
||||
* from the robot and resend it to the monitor.
|
||||
*/
|
||||
void BatteryPeriodicTask(void * arg);
|
||||
void BatteryTask(void * arg);
|
||||
|
||||
/**
|
||||
* @brief Task managing the camera opening and closing. Will check what
|
||||
* state the camera has and change depending on what the monitor asks.
|
||||
*/
|
||||
void ManageCameraTask(void * arg);
|
||||
|
||||
/**
|
||||
* @brief [periodic: 10ms]
|
||||
* Task Managing the image received by the camera. Will send each frame
|
||||
* if camera's state is opened.
|
||||
*/
|
||||
void ImageCameraTask(void * arg);
|
||||
|
||||
/**
|
||||
* @brief Task managing the Arena.
|
||||
* Will search for a camera and overlay if found.
|
||||
* Will store the arena and then show it afterwards.
|
||||
*/
|
||||
void ArenaChoiceTask(void * arg);
|
||||
|
||||
|
||||
void FindPositionTask(void * arg);
|
||||
|
||||
/************************************************************************/
|
||||
/* Added functions */
|
||||
/************************************************************************/
|
||||
|
||||
void SendBattery(int& rs, bool& be);
|
||||
|
||||
/**
|
||||
* @brief Thread safe. Will open the camera and change the status if succeeded.
|
||||
*
|
||||
* @return MessageID returns MESSAGE_ANSWER_ACK if successful, NACK if not.
|
||||
*/
|
||||
MessageID OpenCamera();
|
||||
|
||||
/**
|
||||
* @brief Thread safe. Will close the camera and change the status.
|
||||
*/
|
||||
void CloseCamera();
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* Queue services */
|
||||
/**********************************************************************/
|
||||
|
@ -149,7 +278,10 @@ private:
|
|||
*/
|
||||
Message *ReadInQueue(RT_QUEUE *queue);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // __TASKS_H__
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue