generated from LesKaribous/Project-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Init repo based on "Karibous-2024-PAMI" repo extract.
- Loading branch information
1 parent
18b1010
commit 6244d10
Showing
20 changed files
with
1,378 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
# Project-Template | ||
Template de projet avec documentation | ||
# Minimal-PAMI | ||
|
||
*"Minimal-PAMI"* est le firmware minimal pour tester les PAMIs de notre équipe [Les Karibous](leskaribous.fr) pour la [Coupe De France de robotique](coupederobotique.fr). Un PAMI, c'est quoi ? C'est un *Petit Automate Mobile Indépendant*. En d'autres termes, un petit robot complémentaire au robot principal de l'équipe. | ||
|
||
Nous pouvons avoir plusieurs PAMIs sur le terrain tant qu'ils respectent les règles de la coupe. | ||
|
||
## Fonctionnalités | ||
|
||
Notre architecture Hardware est basée sur un ESP32-S3 et une carte custom. Le PAMI dispose de deux moteurs pas-à-pas pour se mouvoir et de deux capteurs de proximité de type VL53. Il est également équipé d'un actionneur (servomoteur) ainsi que d'un écran Oled | ||
|
||
Vous pouvez retrouver plus d'informations sur l'architecture du PAMI sur notre site [leskaribous.fr](leskaribous.fr). | ||
|
||
## Firmware | ||
|
||
Le code est ce qu'on appel, dans notre équipe, un *"code-minimal"*. Il n'a pas pour vocation de rester indéfiniment voir d'être utilisé en match à la coupe. Il créé dans le but de tester toutes les fonctionnalités d'un robot ou d'une plateforme avant de passer sur un code plus complet. | ||
|
||
Plus simple que nos firmwares définitifs, il permet au *"hardware-boy"* de pouvoir mettre en fonctionnement et de tester le robot. | ||
|
||
Bon... ça c'est en théorie... En pratique il se peut que ce code aille à la coupe... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"build": { | ||
"arduino": { | ||
"ldscript": "esp32s3_out.ld", | ||
"memory_type": "qio_qspi" | ||
}, | ||
"core": "esp32", | ||
"extra_flags": [ | ||
"-DARDUINO_RUNNING_CORE=1", | ||
"-DARDUINO_EVENT_RUNNING_CORE=1", | ||
"-DESP32S3_DEV", | ||
"-DARDUINO_USB_MODE=1", | ||
"-DARDUINO_USB_CDC_ON_BOOT=1" | ||
], | ||
"f_cpu": "240000000L", | ||
"f_flash": "80000000L", | ||
"flash_mode": "qio", | ||
"hwids": [ | ||
[ | ||
"0x303A", | ||
"0x1001" | ||
] | ||
], | ||
"mcu": "esp32s3", | ||
"variant": "esp32s3" | ||
}, | ||
"connectivity": [ | ||
"wifi", | ||
"bluetooth" | ||
], | ||
"debug": { | ||
"default_tool": "esp-builtin", | ||
"onboard_tools": [ | ||
"esp-builtin" | ||
], | ||
"openocd_target": "esp32s3.cfg" | ||
}, | ||
"frameworks": [ | ||
"arduino", | ||
"espidf" | ||
], | ||
"name": "Espressif ESP32-S3-1-N4", | ||
"upload": { | ||
"flash_size": "4MB", | ||
"maximum_ram_size": 327680, | ||
"maximum_size": 4194304, | ||
"require_upload_port": true, | ||
"speed": 460800 | ||
}, | ||
"url": "https://www.gotronic.fr/art-module-cms-esp32-s3-wroom-1-n4-35764.htm", | ||
"vendor": "Espressif" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
This directory is intended for project header files. | ||
|
||
A header file is a file containing C declarations and macro definitions | ||
to be shared between several project source files. You request the use of a | ||
header file in your project source file (C, C++, etc) located in `src` folder | ||
by including it, with the C preprocessing directive `#include'. | ||
|
||
```src/main.c | ||
|
||
#include "header.h" | ||
|
||
int main (void) | ||
{ | ||
... | ||
} | ||
``` | ||
|
||
Including a header file produces the same results as copying the header file | ||
into each source file that needs it. Such copying would be time-consuming | ||
and error-prone. With a header file, the related declarations appear | ||
in only one place. If they need to be changed, they can be changed in one | ||
place, and programs that include the header file will automatically use the | ||
new version when next recompiled. The header file eliminates the labor of | ||
finding and changing all the copies as well as the risk that a failure to | ||
find one copy will result in inconsistencies within a program. | ||
|
||
In C, the usual convention is to give header files names that end with `.h'. | ||
It is most portable to use only letters, digits, dashes, and underscores in | ||
header file names, and at most one dot. | ||
|
||
Read more about using header files in official GCC documentation: | ||
|
||
* Include Syntax | ||
* Include Operation | ||
* Once-Only Headers | ||
* Computed Includes | ||
|
||
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
This directory is intended for project specific (private) libraries. | ||
PlatformIO will compile them to static libraries and link into executable file. | ||
|
||
The source code of each library should be placed in a an own separate directory | ||
("lib/your_library_name/[here are source files]"). | ||
|
||
For example, see a structure of the following two libraries `Foo` and `Bar`: | ||
|
||
|--lib | ||
| | | ||
| |--Bar | ||
| | |--docs | ||
| | |--examples | ||
| | |--src | ||
| | |- Bar.c | ||
| | |- Bar.h | ||
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html | ||
| | | ||
| |--Foo | ||
| | |- Foo.c | ||
| | |- Foo.h | ||
| | | ||
| |- README --> THIS FILE | ||
| | ||
|- platformio.ini | ||
|--src | ||
|- main.c | ||
|
||
and a contents of `src/main.c`: | ||
``` | ||
#include <Foo.h> | ||
#include <Bar.h> | ||
|
||
int main (void) | ||
{ | ||
... | ||
} | ||
|
||
``` | ||
|
||
PlatformIO Library Dependency Finder will find automatically dependent | ||
libraries scanning project source files. | ||
|
||
More information about PlatformIO Library Dependency Finder | ||
- https://docs.platformio.org/page/librarymanager/ldf.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
; PlatformIO Project Configuration File | ||
; | ||
; Build options: build flags, source filter | ||
; Upload options: custom upload port, speed and extra flags | ||
; Library options: dependencies, extra library storages | ||
; Advanced options: extra scripting | ||
; | ||
; Please visit documentation for the other options and examples | ||
; https://docs.platformio.org/page/projectconf.html | ||
|
||
[env:ESP32-S3-WROOM-1-N4] | ||
platform = espressif32 | ||
board = ESP32-S3-WROOM-1-N4 | ||
board_build.mcu = esp32s3 | ||
board_build.f_cpu = 240000000L | ||
framework = arduino | ||
build_unflags = -std=gnu++11 | ||
build_flags = | ||
-std=gnu++17 | ||
monitor_speed = 115200 | ||
monitor_dtr = 1 | ||
upload_speed = 921600 | ||
upload_flags = | ||
--before=default_reset | ||
--after=hard_reset | ||
lib_deps = | ||
olikraus/U8g2@^2.35.8 | ||
adafruit/Adafruit NeoPixel@^1.12.0 | ||
roboticsbrno/ServoESP32@^1.1.1 | ||
pololu/VL53L0X@^1.3.1 | ||
waspinator/AccelStepper@^1.64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// actuators.h | ||
#include "actuators.h" | ||
|
||
Servo servoAntenne; | ||
int frequency = 200; // Hz | ||
|
||
void initActuators(){ | ||
servoAntenne.attach( | ||
pinServo, | ||
Servo::CHANNEL_NOT_ATTACHED, | ||
Servo::DEFAULT_MIN_ANGLE, | ||
Servo::DEFAULT_MAX_ANGLE, | ||
Servo::DEFAULT_MIN_PULSE_WIDTH_US, | ||
Servo::DEFAULT_MAX_PULSE_WIDTH_US, | ||
frequency | ||
); | ||
} | ||
|
||
void antennasUp(){ | ||
servoAntenne.write(ANTENNA_UP); | ||
//debug("Antenna 120 (up)"); | ||
} | ||
|
||
void antennasDown(){ | ||
servoAntenne.write(ANTENNA_DOWN); | ||
//debug("Antenna 45 (down)"); | ||
} | ||
|
||
void testAntennas(){ | ||
antennasDown(); | ||
delay(1000); | ||
antennasUp(); | ||
delay(1000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// actuators.h | ||
#ifndef ACTUATORS_H | ||
#define ACTUATORS_H | ||
|
||
#include <Arduino.h> | ||
#include <Servo.h> // use ServoESP32 lib - Version 1.1.1 - See https://github.com/RoboticsBrno/ServoESP32/issues/26 if compilation issues - On linux , use 1.1.0 | ||
|
||
#include "pins.h" | ||
#include "ihm.h" | ||
|
||
#define ANTENNA_UP 120 | ||
#define ANTENNA_DOWN 45 | ||
|
||
// Déclaration des fonctions | ||
void initActuators(); | ||
void antennasDown(); | ||
void antennasUp(); | ||
void testAntennas(); | ||
|
||
#endif // ACTUATORS_H |
Oops, something went wrong.