Recherche de chemin rapide sur Arduino en C++

Bonjour,

J'ai un problème avec l'IDE Arduino sous Linux pour compiler le code source de l'algorithme A* donné à l'URL GitHub - vmatare/sm-astar: Simplified memory-bounded A* with a few memory optimizations qui permet de trouver un chemin en utilisant un minimum de mémoire

Celà se compile très bien sous ma box Linux via ce makefile

all : smastar

output.o : output.h output.cpp
	g++ -c output.cpp

sm-astar.o : sm-astar.h sm-astar.cpp
	g++ -c sm-astar.cpp

smastar : main.cpp output.o sm-astar.o
	g++ main.cpp output.o sm-astar.o -o smastar

clean :
	rm *.o

Et ca donne ça
(j'ai très légérement modifié le code dans FindPath() afin que l'affichage se fasse entièrement à la fin plutôt qu'a chaque pas)

yannoo@Thinkoo:~/Dev/SMAstar/v1$ make
g++ -c output.cpp
g++ -c sm-astar.cpp
g++ main.cpp output.o sm-astar.o -o smastar

yannoo@Thinkoo:~/Dev/SMAstar/v1$ time ./smastar
 012345678901234567890123456789012345678
#########################################
#S-#    .............#..#               # 0
#o-#   ..............#..#               # 1
#o-#  ...............#..#        T      # 2
#o-.# ...............#..#       -o-     # 3
#o-..#...............#..#       -o-     # 4
#o-...##############.#..#       -o-     # 5
#o-..................#..#       -o-     # 6
#o-.....###########..#..#       -o-     # 7
#o-.......# #...........#       -o-     # 8
#o-........#..########..#       -o-     # 9
#o-....###..............#       -o-     # 10
#o-....# ####################   -o-     # 11
#o-....#                         o-     # 12
#o-....#oooooooooooooooooooooooooo-     # 13
#o-....#o#############||||||||||||      # 14
#o-....#o#                              # 15
#o-....#o#                              # 16
#o-....#o#                              # 17
#oooooo#o#                              # 18
#|||||ooo#                              # 19
#########################################
 012345678901234567890123456789012345678
320 Nodes, 90 Leaves.
Path length: 68/600
Mem: 39.824 kB.


real	0m0,009s
user	0m0,009s
sys	0m0,000s

Mais par contre, cela ne veut pas compiler correctement via l'IDE Arduino :frowning:
(j'ai ajouté les fichiers sma-astar.h/.cpp et output.h/.cpp dans le projet SMAstar.ino)

J'ai tout d'abord dû faire un simple correctif afin de changer le type char en type int pour pouvoir y gérer les valeurs négatives

dans sm-astar.h

// static const char searchX_[4];
// static const char searchY_[4];
  static const int searchX_[4];
  static const int searchY_[4];

et dans sm-astar.cpp

// const char Map::searchX_[] = {1,  0, -1,  0};
// const char Map::searchY_[] = {0, -1,  0,  1};
const int Map::searchX_[] = {1,  0, -1,  0};
const int Map::searchY_[] = {0, -1,  0,  1};

et remplacé le main.c par ce code dans le fichier SMAstar.ino

#include "output.h"
#include "sm-astar.h"


#define BAUDS 115200

void test_SMAstar()
{
  unsigned char pMap[] =
  {
      1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 4
      1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 10
      1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 15
      1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
      1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // 20
  };//    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8
  
  int width = 39;
  int height = 20;
  std::vector<int> res;
  res.resize(600);

  int start_x = 0;
  int start_y = 0;
  int tgt_x = 32;
  int tgt_y = 2;

  int rv = FindPath(start_x, start_y, tgt_x, tgt_y, pMap, width, height, res.data(), res.size());
}

void setup() 
{
  Serial.begin(BAUDS);
  Serial.println("SMA star tests");
}

void loop() 
{
  // put your main code here, to run repeatedly:
   test_SMAstar();
}

Mais la compilation alors effectuée par l'IDE ne s'effectue pas correctement :frowning:
(aucun pb si je ne fait pas appel à la fonction test_SMAstar() mais c'est justement le but que de l'appeller pour l'executer)

Arduino : 1.8.15 (Linux), Carte : "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

/home/yannoo/Dev/Arduino/arduino-1.8.15/arduino-builder -dump-prefs -logger=machine -hardware /home/yannoo/Dev/Arduino/arduino-1.8.15/hardware -hardware /home/yannoo/.arduino15/packages -tools /home/yannoo/Dev/Arduino/arduino-1.8.15/tools-builder -tools /home/yannoo/Dev/Arduino/arduino-1.8.15/hardware/tools/avr -tools /home/yannoo/.arduino15/packages -built-in-libraries /home/yannoo/Dev/Arduino/arduino-1.8.15/libraries -libraries /home/yannoo/Arduino/libraries -fqbn=esp32:esp32:esp32:PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none -vid-pid=10C4_EA60 -ide-version=10815 -build-path /tmp/arduino_build_469246 -warnings=all -build-cache /tmp/arduino_cache_138300 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.mkspiffs.path=/home/yannoo/.arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=/home/yannoo/.arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-1.22.0-97-gc752ad5-5.2.0.path=/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0 -prefs=runtime.tools.esptool_py.path=/home/yannoo/.arduino15/packages/esp32/tools/esptool_py/3.0.0 -prefs=runtime.tools.esptool_py-3.0.0.path=/home/yannoo/.arduino15/packages/esp32/tools/esptool_py/3.0.0 -verbose /home/yannoo/Arduino/test_STL/SMAstar/SMAstar.ino
/home/yannoo/Dev/Arduino/arduino-1.8.15/arduino-builder -compile -logger=machine -hardware /home/yannoo/Dev/Arduino/arduino-1.8.15/hardware -hardware /home/yannoo/.arduino15/packages -tools /home/yannoo/Dev/Arduino/arduino-1.8.15/tools-builder -tools /home/yannoo/Dev/Arduino/arduino-1.8.15/hardware/tools/avr -tools /home/yannoo/.arduino15/packages -built-in-libraries /home/yannoo/Dev/Arduino/arduino-1.8.15/libraries -libraries /home/yannoo/Arduino/libraries -fqbn=esp32:esp32:esp32:PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none -vid-pid=10C4_EA60 -ide-version=10815 -build-path /tmp/arduino_build_469246 -warnings=all -build-cache /tmp/arduino_cache_138300 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.mkspiffs.path=/home/yannoo/.arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=/home/yannoo/.arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-1.22.0-97-gc752ad5-5.2.0.path=/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0 -prefs=runtime.tools.esptool_py.path=/home/yannoo/.arduino15/packages/esp32/tools/esptool_py/3.0.0 -prefs=runtime.tools.esptool_py-3.0.0.path=/home/yannoo/.arduino15/packages/esp32/tools/esptool_py/3.0.0 -verbose /home/yannoo/Arduino/test_STL/SMAstar/SMAstar.ino
Using board 'esp32' from platform in folder: /home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5
Using core 'esp32' from platform in folder: /home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5
bash -c "[ ! -f /home/yannoo/Arduino/test_STL/SMAstar/partitions.csv ] || cp -f /home/yannoo/Arduino/test_STL/SMAstar/partitions.csv /tmp/arduino_build_469246/partitions.csv"
bash -c "[ -f /tmp/arduino_build_469246/partitions.csv ] || cp /home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/partitions/default.csv /tmp/arduino_build_469246/partitions.csv"
Detecting libraries used...
/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/config -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_trace -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_update -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/asio -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bootloader_support -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/coap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/console -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/driver -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/efuse -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-tls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_adc_cal -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_event -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_ota -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_ringbuf -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_websocket_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/espcoredump -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ethernet -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/expat -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fatfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freemodbus -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freertos -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/heap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/idf_test -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/jsmn -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/json -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/libsodium -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/log -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/lwip -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mbedtls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mdns -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/micro-ecc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mqtt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/newlib -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nghttp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nimble -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nvs_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/openssl -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protobuf-c -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protocomm -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/pthread -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/sdmmc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/smartconfig_ack -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/soc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spi_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spiffs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcp_transport -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcpip_adapter -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ulp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/unity -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/vfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wear_levelling -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wifi_provisioning -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wpa_supplicant -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/xtensa-debug-module -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32-camera -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fb_gfx -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10815 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/cores/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/variants/esp32 /tmp/arduino_build_469246/sketch/SMAstar.ino.cpp -o /dev/null
/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/config -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_trace -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_update -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/asio -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bootloader_support -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/coap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/console -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/driver -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/efuse -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-tls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_adc_cal -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_event -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_ota -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_ringbuf -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_websocket_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/espcoredump -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ethernet -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/expat -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fatfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freemodbus -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freertos -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/heap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/idf_test -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/jsmn -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/json -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/libsodium -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/log -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/lwip -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mbedtls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mdns -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/micro-ecc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mqtt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/newlib -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nghttp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nimble -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nvs_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/openssl -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protobuf-c -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protocomm -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/pthread -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/sdmmc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/smartconfig_ack -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/soc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spi_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spiffs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcp_transport -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcpip_adapter -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ulp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/unity -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/vfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wear_levelling -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wifi_provisioning -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wpa_supplicant -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/xtensa-debug-module -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32-camera -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fb_gfx -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10815 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/cores/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/variants/esp32 /tmp/arduino_build_469246/sketch/output.cpp -o /dev/null
/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/config -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_trace -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_update -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/asio -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bootloader_support -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/coap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/console -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/driver -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/efuse -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-tls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_adc_cal -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_event -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_ota -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_ringbuf -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_websocket_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/espcoredump -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ethernet -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/expat -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fatfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freemodbus -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freertos -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/heap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/idf_test -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/jsmn -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/json -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/libsodium -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/log -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/lwip -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mbedtls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mdns -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/micro-ecc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mqtt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/newlib -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nghttp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nimble -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nvs_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/openssl -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protobuf-c -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protocomm -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/pthread -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/sdmmc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/smartconfig_ack -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/soc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spi_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spiffs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcp_transport -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcpip_adapter -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ulp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/unity -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/vfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wear_levelling -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wifi_provisioning -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wpa_supplicant -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/xtensa-debug-module -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32-camera -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fb_gfx -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10815 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/cores/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/variants/esp32 /tmp/arduino_build_469246/sketch/sm-astar.cpp -o /dev/null
Generating function prototypes...
/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/config -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_trace -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_update -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/asio -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bootloader_support -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/coap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/console -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/driver -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/efuse -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-tls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_adc_cal -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_event -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_ota -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_ringbuf -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_websocket_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/espcoredump -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ethernet -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/expat -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fatfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freemodbus -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freertos -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/heap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/idf_test -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/jsmn -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/json -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/libsodium -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/log -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/lwip -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mbedtls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mdns -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/micro-ecc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mqtt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/newlib -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nghttp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nimble -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nvs_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/openssl -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protobuf-c -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protocomm -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/pthread -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/sdmmc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/smartconfig_ack -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/soc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spi_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spiffs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcp_transport -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcpip_adapter -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ulp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/unity -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/vfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wear_levelling -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wifi_provisioning -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wpa_supplicant -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/xtensa-debug-module -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32-camera -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fb_gfx -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10815 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/cores/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/variants/esp32 /tmp/arduino_build_469246/sketch/SMAstar.ino.cpp -o /tmp/arduino_build_469246/preproc/ctags_target_for_gcc_minus_e.cpp
/home/yannoo/Dev/Arduino/arduino-1.8.15/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_469246/preproc/ctags_target_for_gcc_minus_e.cpp
Compilation du croquis...
/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/config -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_trace -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_update -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/asio -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bootloader_support -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/coap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/console -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/driver -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/efuse -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-tls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_adc_cal -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_event -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_ota -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_ringbuf -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_websocket_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/espcoredump -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ethernet -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/expat -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fatfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freemodbus -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freertos -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/heap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/idf_test -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/jsmn -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/json -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/libsodium -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/log -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/lwip -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mbedtls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mdns -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/micro-ecc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mqtt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/newlib -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nghttp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nimble -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nvs_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/openssl -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protobuf-c -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protocomm -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/pthread -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/sdmmc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/smartconfig_ack -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/soc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spi_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spiffs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcp_transport -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcpip_adapter -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ulp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/unity -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/vfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wear_levelling -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wifi_provisioning -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wpa_supplicant -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/xtensa-debug-module -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32-camera -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fb_gfx -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror=all -Wextra -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -MMD -c -DF_CPU=240000000L -DARDUINO=10815 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/cores/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/variants/esp32 /tmp/arduino_build_469246/sketch/SMAstar.ino.cpp -o /tmp/arduino_build_469246/sketch/SMAstar.ino.cpp.o
/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/config -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_trace -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_update -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/asio -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bootloader_support -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/coap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/console -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/driver -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/efuse -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-tls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_adc_cal -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_event -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_ota -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_ringbuf -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_websocket_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/espcoredump -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ethernet -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/expat -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fatfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freemodbus -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freertos -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/heap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/idf_test -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/jsmn -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/json -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/libsodium -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/log -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/lwip -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mbedtls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mdns -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/micro-ecc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mqtt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/newlib -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nghttp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nimble -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nvs_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/openssl -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protobuf-c -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protocomm -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/pthread -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/sdmmc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/smartconfig_ack -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/soc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spi_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spiffs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcp_transport -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcpip_adapter -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ulp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/unity -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/vfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wear_levelling -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wifi_provisioning -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wpa_supplicant -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/xtensa-debug-module -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32-camera -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fb_gfx -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror=all -Wextra -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -MMD -c -DF_CPU=240000000L -DARDUINO=10815 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/cores/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/variants/esp32 /tmp/arduino_build_469246/sketch/output.cpp -o /tmp/arduino_build_469246/sketch/output.cpp.o
/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/config -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_trace -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/app_update -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/asio -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bootloader_support -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/bt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/coap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/console -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/driver -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/efuse -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-tls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_adc_cal -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_event -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_http_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_ota -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_https_server -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_ringbuf -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp_websocket_client -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/espcoredump -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ethernet -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/expat -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fatfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freemodbus -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/freertos -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/heap -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/idf_test -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/jsmn -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/json -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/libsodium -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/log -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/lwip -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mbedtls -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mdns -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/micro-ecc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/mqtt -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/newlib -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nghttp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nimble -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/nvs_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/openssl -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protobuf-c -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/protocomm -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/pthread -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/sdmmc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/smartconfig_ack -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/soc -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spi_flash -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/spiffs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcp_transport -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/tcpip_adapter -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/ulp -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/unity -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/vfs -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wear_levelling -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wifi_provisioning -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/wpa_supplicant -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/xtensa-debug-module -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp32-camera -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/esp-face -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/include/fb_gfx -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror=all -Wextra -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -MMD -c -DF_CPU=240000000L -DARDUINO=10815 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"ESP32_DEV\"" "-DARDUINO_VARIANT=\"esp32\"" -DESP32 -DCORE_DEBUG_LEVEL=0 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/cores/esp32 -I/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/variants/esp32 /tmp/arduino_build_469246/sketch/sm-astar.cpp -o /tmp/arduino_build_469246/sketch/sm-astar.cpp.o
In file included from /home/yannoo/Arduino/test_STL/SMAstar/output.h:4:0,
                 from /home/yannoo/Arduino/test_STL/SMAstar/output.cpp:1:
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.h:73:24: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  const int    Offset() const;
                        ^
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.h:74:23: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  const float  FCost() const;
                       ^
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.h:75:23: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  const int    GCost() const;
                       ^
In file included from /home/yannoo/Arduino/test_STL/SMAstar/sm-astar.cpp:1:0:
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.h:73:24: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  const int    Offset() const;
                        ^
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.h:74:23: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  const float  FCost() const;
                       ^
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.h:75:23: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  const int    GCost() const;
                       ^
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.cpp:189:35: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
 inline const int   Node::Offset() const { return offset_; }
                                   ^
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.cpp:190:35: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
 inline const float Node::FCost()  const { return fCost_; }
                                   ^
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.cpp:191:35: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
 inline const int   Node::GCost()  const { return gCost_; }
                                   ^
In file included from /home/yannoo/Arduino/test_STL/SMAstar/output.h:4:0,
                 from /home/yannoo/Arduino/test_STL/SMAstar/SMAstar.ino:1:
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.h:73:24: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  const int    Offset() const;
                        ^
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.h:74:23: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  const float  FCost() const;
                       ^
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.h:75:23: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
  const int    GCost() const;
                       ^
/home/yannoo/Arduino/test_STL/SMAstar/SMAstar.ino: In function 'void test_SMAstar()':
/home/yannoo/Arduino/test_STL/SMAstar/SMAstar.ino:44:7: warning: unused variable 'rv' [-Wunused-variable]
   int rv = FindPath(start_x, start_y, tgt_x, tgt_y, pMap, width, height, res.data(), res.size());
       ^
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.cpp: In function 'int FindPath(int, int, int, int, const unsigned char*, int, int, int*, int)':
/home/yannoo/Arduino/test_STL/SMAstar/sm-astar.cpp:476:41: warning: 'mem_use' may be used uninitialized in this function [-Wmaybe-uninitialized]
  std::cout << "Mem: " << float(mem_use)/1000 << " kB." << std::endl << std::endl;
                                         ^
Compiling libraries...
Compiling core...
Using precompiled core: /tmp/arduino_cache_138300/core/core_12033bb7b0d7409bd5b406806e744196.a
Linking everything together...
/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-gcc -nostdlib -L/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/lib -L/home/yannoo/.arduino15/packages/esp32/hardware/esp32/1.0.5/tools/sdk/ld -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u esp_app_desc -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception -Wl,--start-group /tmp/arduino_build_469246/sketch/SMAstar.ino.cpp.o /tmp/arduino_build_469246/sketch/output.cpp.o /tmp/arduino_build_469246/sketch/sm-astar.cpp.o /tmp/arduino_cache_138300/core/core_12033bb7b0d7409bd5b406806e744196.a -lgcc -lapp_trace -llibsodium -lbt -lesp-tls -lmdns -lconsole -ljsmn -lesp_ringbuf -lpthread -ldriver -ldetection -lsoc -lc -lmesh -lwpa2 -ljson -ldl -lwear_levelling -lmicro-ecc -lcoexist -lface_detection -lnvs_flash -lwifi_provisioning -lfr -lnghttp -lesp32 -lnet80211 -lesp_http_server -ltcp_transport -llog -lespnow -lhal -lmqtt -lesp_websocket_client -lesp_http_client -lvfs -lbtdm_app -lapp_update -lpe -lprotocomm -lwps -lsdmmc -lesp_adc_cal -lwpa -lefuse -lcoap -lsmartconfig -limage_util -lspiffs -lulp -lunity -lface_recognition -lesp_https_server -lethernet -lspi_flash -lpp -lexpat -lfatfs -ltcpip_adapter -llwip -lcxx -lfreertos -lesp32-camera -lmbedtls -ldetection_cat_face -lm -lc_nano -lesp_event -lnewlib -lcore -lopenssl -lsmartconfig_ack -lwpa_supplicant -lbootloader_support -lasio -lesp_https_ota -lod -lespcoredump -lheap -lrtc -lprotobuf-c -lfb_gfx -lfreemodbus -lfd -lphy -lxtensa-debug-module -lstdc++ -Wl,--end-group -Wl,-EL -o /tmp/arduino_build_469246/SMAstar.ino.elf
/tmp/arduino_build_469246/sketch/output.cpp.o:(.literal._Z9RenderMapB5cxx11R3MapRKSt10shared_ptrI4NodeES5_+0x14): undefined reference to `Map::Passable(int, int) const'
/tmp/arduino_build_469246/sketch/output.cpp.o:(.literal._Z9RenderMapB5cxx11R3MapRKSt10shared_ptrI4NodeES5_+0x18): undefined reference to `Node::Children()'
/tmp/arduino_build_469246/sketch/output.cpp.o:(.literal._Z9RenderMapB5cxx11R3MapRKSt10shared_ptrI4NodeES5_+0x1c): undefined reference to `EqualByOffset<std::shared_ptr<Node> >::operator()(std::shared_ptr<Node> const&, std::shared_ptr<Node> const&) const'
/tmp/arduino_build_469246/sketch/output.cpp.o:(.literal._Z9RenderMapB5cxx11R3MapRKSt10shared_ptrI4NodeES5_+0x20): undefined reference to `Node::Offset() const'
/tmp/arduino_build_469246/sketch/output.cpp.o:(.literal._Z9RenderMapB5cxx11R3MapRKSt10shared_ptrI4NodeES5_+0x24): undefined reference to `Map::Y(int) const'
/tmp/arduino_build_469246/sketch/output.cpp.o:(.literal._Z9RenderMapB5cxx11R3MapRKSt10shared_ptrI4NodeES5_+0x28): undefined reference to `Map::X(int) const'
/tmp/arduino_build_469246/sketch/output.cpp.o:(.literal._Z9RenderMapB5cxx11R3MapRKSt10shared_ptrI4NodeES5_+0x2c): undefined reference to `Node::Parent()'
/tmp/arduino_build_469246/sketch/output.cpp.o: In function `RenderMap[abi:cxx11](Map&, std::shared_ptr<Node> const&, std::shared_ptr<Node> const&)':
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:38: undefined reference to `Map::Passable(int, int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:49: undefined reference to `Node::Children()'
/tmp/arduino_build_469246/sketch/output.cpp.o: In function `std::__detail::_Equal_helper<std::shared_ptr<Node>, std::shared_ptr<Node>, std::__detail::_Identity, EqualByOffset<std::shared_ptr<Node> >, unsigned int, true>::_S_equals(EqualByOffset<std::shared_ptr<Node> > const&, std::__detail::_Identity const&, std::shared_ptr<Node> const&, unsigned int, std::__detail::_Hash_node<std::shared_ptr<Node>, true>*)':
/home/yannoo/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/hashtable_policy.h:1322: undefined reference to `EqualByOffset<std::shared_ptr<Node> >::operator()(std::shared_ptr<Node> const&, std::shared_ptr<Node> const&) const'
/tmp/arduino_build_469246/sketch/output.cpp.o: In function `RenderMap[abi:cxx11](Map&, std::shared_ptr<Node> const&, std::shared_ptr<Node> const&)':
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:56: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:56: undefined reference to `Map::Y(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:56: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:56: undefined reference to `Map::X(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:62: undefined reference to `Node::Children()'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:63: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:63: undefined reference to `Map::Y(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:63: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:63: undefined reference to `Map::X(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:64: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:64: undefined reference to `Map::Y(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:64: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:64: undefined reference to `Map::Y(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:65: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:65: undefined reference to `Map::Y(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:65: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:65: undefined reference to `Map::X(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:67: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:67: undefined reference to `Map::Y(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:67: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:67: undefined reference to `Map::X(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:70: undefined reference to `Node::Parent()'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:71: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:71: undefined reference to `Map::Y(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:71: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:71: undefined reference to `Map::X(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:72: undefined reference to `Node::Parent()'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:75: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:75: undefined reference to `Map::Y(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:75: undefined reference to `Node::Offset() const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:75: undefined reference to `Map::X(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:79: undefined reference to `Map::Y(int) const'
/home/yannoo/Arduino/test_STL/SMAstar/output.cpp:79: undefined reference to `Map::X(int) const'
collect2: error: ld returned 1 exit status
exit status 1
Erreur de compilation pour la carte ESP32 Dev Module

Quelqu'un aurait une idée de la raison des problèmes rencontrés ?

Je pense qu'il s'agit d'un problème de références croisées ou un truc du style
(ce ne sont pas les warnings à la compilation qui me dérangent mais les erreurs "undefined reference to" au linkage)

sur quel type d'Arduino ?

(postez un zip avec tout le code)

C'est pour s"executer un ESP32
(ESP32 car j'y aurais besoin du wifi pour communiquer et faire faire les mises à jour en OTA + besoin de pas mal de mémoire pour stocker les maps des salles à y gérer)

Le lien pour accéder à l'archive ZIP Free Transfert - Service d'envoi de fichiers

postez le zip ici SVP en cliquant le bouton 'upload' de la barre d'outils

image

le voici

SMAstar.zip (20.7 KB)

c'est un peu fouillis... essayez de restructurer toutes les classes avec un .h pour leur interface et un .cpp pour leur implémentation. Assurez vous d'importer les .h là où vous en avez besoin

en première approche si vous mettez tout dans un fichier dans le bon ordre, ça compile avec quelques warnings (à corriger)

#include <iostream>
#include <limits>
#include <cstring>
#include <exception>
#include <numeric>
#include <set>
#include <vector>
#include <unordered_set>
#include <array>
#include <unordered_map>
#include <memory>
#include <cmath>

#ifndef MAX_MEM
#define MAX_MEM (1024ul*1024ul*1024ul)
#endif

class Node;
class Map;
struct CompareByCostEstimate;

template<class Ptr_t>
struct HashByOffset {
  size_t operator() (const Ptr_t &node) const;
};

template<class Ptr_t>
struct EqualByOffset : public std::binary_function<Ptr_t, Ptr_t, bool> {
  bool operator() (const Ptr_t &node1, const Ptr_t &node2) const;
};

typedef std::shared_ptr<Node> PNode;
typedef std::weak_ptr<Node> WeakPNode;
typedef std::vector<PNode> Path;

typedef std::unordered_set<PNode, HashByOffset<PNode>, EqualByOffset<PNode>> NodeSet;
typedef std::unordered_map<int, WeakPNode, HashByOffset<int>, EqualByOffset<int>> WeakNodeSet;
typedef std::set<PNode, CompareByCostEstimate> NodeQueue;


// Thanks to
// http://stackoverflow.com/questions/1903954/is-there-a-standard-sign-function-signum-sgn-in-c-c
template <typename T> int sgn(T val) {
  return (T(0) < val) - (val < T(0));
}


typedef struct {
  int x;
  int y;
} point_t;


#define _CART_TO_OFFSET(x, y, width) width * y + x


constexpr double pi() {
  return std::atan(1) * 4;
}


class Node {
  private:
    Node(const Map &map, const int x, const int y, const PNode &parent, WeakNodeSet &allNodes);
  public:
    ~Node();
    static PNode Spawn(const Map &map, const int x, const int y, const PNode &parent,
                       NodeQueue &queue, WeakNodeSet &allNodes);

    void Erase(NodeQueue &queue, bool eraseFromQ = true);
    bool SimplifyPath(const Map &map, NodeQueue &queue);
    std::vector<PNode> FullPath();
    NodeSet AllParents();

    const int    Offset() const;
    const float  FCost() const;
    const int    GCost() const;
    NodeSet     &Children();
    PNode        Parent();
    void         SetGCost(const int gCost, NodeQueue &queue);
    void         SetFCost(const float fCost, NodeQueue &queue);
    bool         Completed();
    void         Reset();
    unsigned long int ID() const;

    void Backup(NodeQueue &queue);

    PNode ExpandNext(const Map &map, NodeQueue &queue);

  private:
    static const point_t expandLeft_[4];
    static const point_t expandDown_[4];
    static const point_t expandUp_[4];
    static const point_t expandRight_[4];

    thread_local static unsigned long int count_;

    int offset_;
    int gCost_;
    float fCost_;
    PNode parent_;
    NodeSet children_;
    WeakNodeSet &allNodes_;
    int x_;
    int y_;
    unsigned char expandIdx_;
    unsigned long int id_;
};


struct CompareByCostEstimate : public std::binary_function<PNode, PNode, bool> {
  bool operator() (const PNode &node1, const PNode &node2) const {
    // Different nodes but same cost: put newer one in front.
    if (node1->FCost() == node2->FCost()) {
      if (node1->GCost() == node2->GCost())
        return node1->ID() > node2->ID();
      return node1->GCost() > node2->GCost();
    }

    return node1->FCost() < node2->FCost();
  }
};



class Map {
  public:
    Map(const unsigned char* pMap, const int nMapWidth, const int nMapHeight,
        const int targetX, const int targetY);

    int X(const int offset) const;
    int Y(const int offset) const;

    int   Offset(const int x, const int y) const;
    bool  Passable(const int x, const int y) const;
    float HCost(const int from) const;
    float HCost2(const int from) const;
    int   Height() const;
    int   Width() const;
    float Phi(const Node *) const;

    const int nMapWidth_, nMapHeight_;
    const int targetOffset_;
  private:
    const unsigned char *pMap_;

    // static const char searchX_[4];
    // static const char searchY_[4];
    static const int searchX_[4];
    static const int searchY_[4];
};


thread_local unsigned long int Node::count_ = 0;
const int Map::searchX_[] = {1,  0, -1,  0};
const int Map::searchY_[] = {0, -1,  0,  1};

const point_t Node::expandUp_[4]    = { {0, -1}, { -1, 0}, {1, 0}, {0, 1} }; // up-left-right-down
const point_t Node::expandLeft_[4]  = { { -1, 0}, {0, 1}, {0, -1}, {1, 0} }; // left-down-up-right
const point_t Node::expandDown_[4]  = { {0, 1}, {1, 0}, { -1, 0}, {0, -1} }; // down-right-left-up
const point_t Node::expandRight_[4] = { {1, 0}, {0, -1}, {0, 1}, { -1, 0} }; // right-up-down-left


template<class T> size_t HashByOffset<T>::operator() (const T &node) const
{
  return node->Offset();
}
///*
template<> size_t HashByOffset<const std::weak_ptr<Node> &>::operator() (const std::weak_ptr<Node> &node) const
{
  return node.lock()->Offset();
}
//*/
template<> size_t HashByOffset<int>::operator() (const int &i) const
{
  return i;
}

template size_t HashByOffset<PNode>::operator() (const PNode &node) const;
//template size_t HashByOffset<WeakPNode>::operator() (const WeakPNode &node) const;


template<class T> bool EqualByOffset<T>::operator() (
  const T &node1,
  const T &node2) const
{
  return node1->Offset() == node2->Offset();
}
///*
template<> bool EqualByOffset<std::weak_ptr<Node>>::operator() (
      const std::weak_ptr<Node> &node1,
      const std::weak_ptr<Node> &node2) const
{
  return node1.lock()->Offset() == node2.lock()->Offset();
}
//*/
template<> bool EqualByOffset<int>::operator() (const int &lhs, const int &rhs) const
{
  return lhs == rhs;
}

template bool EqualByOffset<const PNode &>::operator() (const PNode &node1, const PNode &node2) const;
//template bool EqualByOffset<const WeakPNode &>::operator() (const WeakPNode &node1, const WeakPNode &node2) const;



Node::Node(const Map &map, const int x, const int y, const PNode &parent, WeakNodeSet &allNodes) :
  offset_(map.Offset(x, y)), gCost_(parent ? parent->gCost_ + 1 : 0),
  fCost_(float(gCost_) + map.HCost(offset_)),
  parent_(parent),
  allNodes_(allNodes), x_(x), y_(y), expandIdx_(0),
  id_(count_++)
{}


Node::~Node()
{
  allNodes_.erase(this->offset_);
}


PNode Node::Spawn(const Map &map, const int x, const int y, const PNode &parent, NodeQueue &queue, WeakNodeSet &allNodes)
{
  WeakNodeSet::iterator n_it = allNodes.find(map.Offset(x, y));
  PNode rv(nullptr);
  if (n_it == allNodes.end()) {
    rv.reset(new Node(map, x, y, parent, allNodes));
    if (parent) {
      NodeSet::iterator pc_it = parent->Children().find(rv);
      if (pc_it != parent->Children().end()) {
        rv = *pc_it;
      } else {
        parent->children_.insert(rv);
      }
    }
    allNodes.insert(std::make_pair<int, WeakPNode>(rv->Offset(), rv));
  } else {
    rv = PNode(n_it->second);
    if (rv->Parent() != parent) {
      if (rv->GCost() < parent->GCost() + 1) {
        rv.reset();
      } else {
        if (parent->GCost() + 1 < rv->GCost())
          rv->SetGCost(parent->GCost() + 1, queue);
        rv->parent_->children_.erase(rv);
        rv->parent_ = parent;
        parent->children_.insert(rv);
      }
    }
    else
      rv.reset();
  }
  return std::move(rv);
}


NodeSet Node::AllParents()
{
  NodeSet rv;
  NodeSet p_parents = parent_->AllParents();
  if (parent_)
    rv.insert(parent_);
  rv.insert(p_parents.begin(), p_parents.end());
  return std::move(rv);
}


void Node::Erase(NodeQueue &queue, bool eraseFromQ)
{
  PNode sh_this(allNodes_.find(offset_)->second);
  while (!children_.empty()) {
    PNode c = *children_.begin();
    c->Erase(queue);
  }
  if (parent_) {
    parent_->children_.erase(sh_this);
  }
  if (eraseFromQ)
    queue.erase(sh_this);
}


bool Node::SimplifyPath(const Map &map, NodeQueue &queue)
{
  Path path(std::move(FullPath()));

  bool rv = false;
  Path::reverse_iterator path_it = path.rbegin();
  PNode n1, n2, n3;

  n2 = *path_it;
  n3 = *(++path_it);

  while (path_it + 1 != path.rend() && !rv) {
    n1 = n2;
    n2 = n3;
    char x = sgn(map.X(n2->offset_) - map.X(n1->offset_));
    char y = sgn(map.Y(n2->offset_) - map.Y(n1->offset_));

    while (++path_it != path.rend()) {
      n3 = *path_it;
      char next_x = sgn(map.X(n3->offset_) - map.X(n2->offset_));
      char next_y = sgn(map.Y(n3->offset_) - map.Y(n2->offset_));
      if (next_x == x && next_y == y && queue.find(n2) == queue.end()) {
        while (!n1->Children().empty()) {
          if ((*n1->Children().begin()) == n2)
            n1->Children().erase(n1->Children().begin());
          else
            (*n1->Children().begin())->Erase(queue);
        }
        n1->Children().insert(n3);
        n2->Children().erase(n3);
        n3->parent_ = n1;
        rv = true;
      } else {
        break;
      }
      n2 = n3;
    }
  }
  return rv;
}


std::vector<PNode> Node::FullPath()
{
  PNode n(allNodes_.find(offset_)->second);
  std::vector<PNode>rv;
  rv.push_back(n);
  while (n->Parent()) {
    n = n->Parent();
    rv.push_back(n);
  }
  return std::move(rv);
}


inline NodeSet    &Node::Children()     {
  return children_;
}
inline PNode       Node::Parent()       {
  return parent_;
}
inline const int   Node::Offset() const {
  return offset_;
}
inline const float Node::FCost()  const {
  return fCost_;
}
inline const int   Node::GCost()  const {
  return gCost_;
}
inline unsigned long int Node::ID() const {
  return id_;
}


inline void Node::SetGCost(int gCost, NodeQueue &queue)
{
  PNode sh_this(allNodes_.find(offset_)->second);
  bool in_q = queue.erase(sh_this) > 0;

  int change = this->gCost_ - gCost;
  this->gCost_ = gCost;
  fCost_ = fCost_ - change;

  if (in_q)
    queue.insert(sh_this);
}


inline void Node::SetFCost(float fCost, NodeQueue &queue)
{
  PNode sh_this(allNodes_.find(offset_)->second);
  bool in_q = queue.erase(sh_this) > 0;
  this->fCost_ = fCost;
  if (in_q)
    queue.insert(sh_this);
}


void Node::Backup(NodeQueue &queue)
{
  if (expandIdx_ > 3) {
    int best_f = std::numeric_limits<int>::max();
    for (const PNode &c : children_) {
      if (c->FCost() < best_f)
        best_f = c->FCost();
    }
    if (best_f < std::numeric_limits<int>::max() && best_f != FCost() ) {
      SetFCost(best_f, queue);
      if (parent_)
        parent_->Backup(queue);
    }
  }
}


PNode Node::ExpandNext(const Map &map, NodeQueue &queue)
{
  float phi = map.Phi(this);
  const point_t *expandSeq;

  if (phi >= 0.25 * pi() && phi < 0.75 * pi())
    expandSeq = Node::expandUp_;
  else if (phi >= 0.75 * pi() && phi < 1.25 * pi())
    expandSeq = Node::expandLeft_;
  else if (phi >= 1.25 * pi() && phi < 1.75 * pi())
    expandSeq = Node::expandDown_;
  else
    expandSeq = Node::expandRight_;

  PNode rv(nullptr);
  for (; !rv; ++expandIdx_) {
    if (expandIdx_ > 3) {
      return PNode(nullptr);
    }

    int x = map.X(Offset()) + expandSeq[expandIdx_].x;
    int y = map.Y(Offset()) + expandSeq[expandIdx_].y;

    if (!map.Passable(x, y))
      continue;

    if (parent_ && parent_->parent_) {
      unsigned int p_dx = std::abs(x - map.X(parent_->parent_->Offset()));
      unsigned int p_dy = std::abs(y - map.Y(parent_->parent_->Offset()));

      if ((p_dx == 0 && p_dy < 2) || (p_dx < 2 && p_dy == 0)) {
        continue;
      }
    }

    PNode sh_this(allNodes_.find(offset_)->second);

    rv = Spawn(map, x, y, sh_this, queue, allNodes_);
  }
  return std::move(rv);
}


bool Node::Completed()
{
  return expandIdx_ > 3;
}


void Node::Reset()
{
  expandIdx_ = 0;
}


Map::Map(const unsigned char* pMap, const int nMapWidth, const int nMapHeight,
         const int targetX, const int targetY) :
  nMapWidth_(nMapWidth),
  nMapHeight_(nMapHeight),
  targetOffset_(_CART_TO_OFFSET(targetX, targetY, nMapWidth)),
  pMap_(pMap)
{}

inline int Map::X(const int offset) const
{
  return offset % nMapWidth_;
}

inline int Map::Y(const int offset) const
{
  return offset / nMapWidth_;
}

inline int Map::Offset(const int x, const int y) const
{
  return _CART_TO_OFFSET(x, y, nMapWidth_);
}

int Map::Width() const
{
  return nMapWidth_;
}

int Map::Height() const
{
  return nMapHeight_;
}


inline bool Map::Passable(const int x, const int y) const
{
  return x >= 0 && y >= 0 && x < nMapWidth_ && y < nMapHeight_ && *(pMap_ + Offset(x, y));
}


float Map::HCost(const int from) const
{
  float dx = std::abs(((float)X(targetOffset_)) - X(from));
  float dy = std::abs(((float)Y(targetOffset_)) - Y(from));
  return dx + dy;
}


float Map::HCost2(const int from) const
{
  float dx = std::abs(((float)X(targetOffset_)) - X(from));
  float dy = std::abs(((float)Y(targetOffset_)) - Y(from));
  return std::sqrt(dx + dy);
}


/**
   @return Bearing of target seen from Node n, 0 <= result <= 2 pi
*/
float Map::Phi(const Node *n) const
{
  float dx = ((int)X(targetOffset_)) - X(n->Offset());
  float dy = ((int)Y(targetOffset_)) - Y(n->Offset());
  float phi = std::atan2(dy, dx);
  if (phi < 0) {
    phi = 2 * pi() + phi;
  }
  return phi;
}






/**
    @param nStartX and @param nStartY are the 0-based coordinates of the start position.
    @param nTargetX and @param nTargetY are the 0-based coordinates of the target position.
    @param pMap describes a grid of width nMapWidth and height nMapHeight. The grid
    is given in row-major order, each row is given in order of increasing x-coordinate,
    and the rows are given in order of increasing y-coordinate. Traversable locations of
    the grid are indicated by 1, and impassable locations are indicated by 0.
    Locations are considered to be adjacent horizontally and vertically but not diagonally.
    @param pOutBuffer is where you should store the positions visited in the found path, excluding
    the starting position but including the final position. Entries in pOutBuffer are
    indices into pMap. If there is more than one shortest path from Start to Target, any
    one of them will be accepted.
    @param nOutBufferSize is the maximum number of entries that can be written to pOutBuffer.

  @return The length of the shortest path between Start and Target, or −1
  if no such path exists.
  If the shortest path is longer than nOutBufferSize, the calling function might either
  give up or choose to call FindPath again with a larger output buffer.

  Constraints

    1 ≤ nMapWidth,nMapHeight,
    0 ≤ nStartX, nTargetX < nMapWidth,
    0 ≤ nStartY, nTargetY < nMapHeight,
    Both Start and Target are empty locations,
    nOutBufferSize ≥ 0.
*/
int FindPath(const int nStartX, const int nStartY,
             const int nTargetX, const int nTargetY,
             const unsigned char* pMap, const int nMapWidth, const int nMapHeight,
             int* pOutBuffer, const int nOutBufferSize)
{
  Map map = Map(pMap, nMapWidth, nMapHeight, nTargetX, nTargetY);

  if (nStartX == nTargetX && nStartY == nTargetY) {
    *pOutBuffer = map.Offset(nTargetX, nTargetY);
    return 0;
  }

  int rv = -1;

  NodeQueue queue;
  WeakNodeSet allNodes;
  PNode startNode = Node::Spawn(map, nStartX, nStartY, PNode(), queue, allNodes);
  queue.insert(startNode);
  size_t mem_use;

  const int target = map.Offset(nTargetX, nTargetY);

  std::string input;

  // YLP 27 october 2021 : add a copy of the last curNode values for to can access it outside the loop
  PNode lastNode(nullptr);

  while (!queue.empty()) {


    PNode curNode(*queue.begin());

    lastNode = curNode;

    if (curNode->Offset() == target) {
      rv = curNode->FCost();
      PNode n = curNode;
      int i = curNode->GCost() - 1;
      while (n->Parent() != startNode) {
        pOutBuffer[i--] = n->Offset();
        n = n->Parent();
      }
      break;
    }


    PNode nextNode(nullptr);
    if (curNode->FCost() < std::numeric_limits<float>::max())
      nextNode = curNode->ExpandNext(map, queue);

    if (curNode->Completed()) {
      curNode->Backup(queue);

      NodeSet::iterator c_it = curNode->Children().begin();
      while (c_it != curNode->Children().end() &&
             allNodes.find((*c_it)->Offset()) != allNodes.end())
        ++c_it;

      if (c_it == curNode->Children().end())
        queue.erase(curNode);
    }

    mem_use = allNodes.size() * sizeof(Node) + sizeof(PNode) * queue.size();

    if (nextNode) {
      if (nextNode->Offset() != target && nextNode->GCost() >= nOutBufferSize)
        nextNode->SetFCost(std::numeric_limits<unsigned int>::max(), queue);
      else if (curNode->FCost() > nextNode->FCost())
        nextNode->SetFCost(curNode->FCost(), queue);

      queue.insert(nextNode);

      // YLP 27 october 2021 : display only the result at the end of calculation
      // Paint(map, curNode, startNode);
      // std::cout << allNodes.size() << " Nodes, " << queue.size() << " Leaves." << std::endl;
      // std::cout << "Path length: " << curNode->GCost() << "/" << nOutBufferSize << std::endl;
      // std::cout << "Mem: " << float(mem_use)/1000 << " kB." << std::endl << std::endl;

      // if (input != "f") {
      //  std::cout << "Enter \"f\" to finish or press Enter for next step: ";
      //  std::getline(std::cin, input);
      //}
    }


    if (mem_use >= MAX_MEM) {
      if (!curNode->SimplifyPath(map, queue)) {
        NodeQueue::reverse_iterator q_rit = queue.rbegin();
        PNode n = *q_rit;
        n->Erase(queue);
        queue.insert(n->Parent());
      }
    }
  }

  // YLP 27 october 2021 : display now the entire path at the end of calculation instead to display it at each step
  Paint(map, lastNode, startNode);
  std::cout << allNodes.size() << " Nodes, " << queue.size() << " Leaves." << std::endl;
  std::cout << "Path length: " << lastNode->GCost() << "/" << nOutBufferSize << std::endl;
  std::cout << "Mem: " << float(mem_use) / 1000 << " kB." << std::endl << std::endl;


  startNode->Erase(queue);
  return rv;
}

std::vector<std::string> RenderMap(Map &map, const PNode &node, const PNode &startNode)
{
  std::vector<std::string> rv;
  for (int y = 0; y < map.Height(); ++y) {
    std::string line = "";
    for (int x = 0; x < map.Width(); ++x) {
      if (map.Passable(x, y))
        line += " ";
      else
        line += "#";
    }
    rv.push_back(line);
  }

  PNode n = startNode;
  NodeSet q;
  do {
    for (PNode c : n->Children()) {
      q.insert(c);
    }
    n.reset();
    if (!q.empty()) {
      n = *q.begin();
      q.erase(q.begin());
      rv[map.Y(n->Offset())][map.X(n->Offset())] = '.';
    }
  } while (n);

  n = node;
  while (n) {
    for (PNode c : n->Children()) {
      if (rv[map.Y(c->Offset())][map.X(c->Offset())] != 'o') {
        if (map.Y(n->Offset()) == map.Y(c->Offset()))
          rv[map.Y(c->Offset())][map.X(c->Offset())] = '-';
        else
          rv[map.Y(c->Offset())][map.X(c->Offset())] = '|';
      }
    }
    if (n->Parent()) {
      rv[map.Y(n->Offset())][map.X(n->Offset())] = 'o';
      n = n->Parent();
    }
    else {
      rv[map.Y(n->Offset())][map.X(n->Offset())] = 'S';
      break;
    }
  }
  rv[map.Y(map.targetOffset_)][map.X(map.targetOffset_)] = 'T';
  return rv;
}



void Paint(Map &map, const PNode &curNode, const PNode &startNode)
{
  std::vector<std::string> pic = RenderMap(map, curNode, startNode);

  std::cout << " ";
  for (int x = 0; x < map.Width(); ++x)
    std::cout << x % 10;
  std::cout << std::endl;

  std::cout << std::string(map.Width() + 2, '#') << std::endl;

  int c = 0;
  for (std::string &l : pic)
    std::cout << '#' << l << "# " << c++ << std::endl;

  std::cout << std::string(map.Width() + 2, '#') << std::endl;

  std::cout << " ";
  for (int x = 0; x < map.Width(); ++x)
    std::cout << x % 10;
  std::cout << std::endl;

}



// ------------------
#define BAUDS 115200

void test_SMAstar()
{
  unsigned char pMap[] =
  {
    1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 10
    1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 15
    1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 20
  };//    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8

  int width = 39;
  int height = 20;
  std::vector<int> res;
  res.resize(600);

  int start_x = 0;
  int start_y = 0;
  int tgt_x = 32;
  int tgt_y = 2;

  int rv = FindPath(start_x, start_y, tgt_x, tgt_y, pMap, width, height, res.data(), res.size());
}

void setup()
{
  Serial.begin(BAUDS);
  Serial.println("SMA star tests");
  test_SMAstar();
}

void loop()  {}

j'ai mis test_SMAstar(); à la fin du setup, je suppose qu'il n'est pas utile de l'appeler en boucle dans la loop()

Merci,

Je vais tout mettre dans un fichier comme indiqué

Pour les classes/fichiers .h/.cpp, je n'ai fait qu'incorporer au sketch les fichiers .h/.cpp qui sont sous GitHub - vmatare/sm-astar: Simplified memory-bounded A* with a few memory optimizations, ce n'est pas moi qui les ai créées

=> il y a une ruse concernant l'ordre de compilation / linkage des fichiers car j'ai remarqué que les onglets avaient toujours le même ordre quel que soit l'ordre dans lesquel j'ai importé les fichiers .
(les fichiers sont gérés/compilés par l'IDE Arduino par ordre alphabétiques ou un truc du style ?)

Car je préferais pouvoir y gérer les différentes classes dans plusieurs fichiers différents, histoire de ne pas avoir qu'un seul et énorme fichier "fourre-tout" ...

L'ordre est l'ordre alphabétique dans l'IDE
tous les .ino sont en fait fusionnés pour faire un grand .ino quand vous compilez (ici vous n'en avez qu'un seul)
sinon les .cpp sont compilés séparément et ensuite il y a la phase d'édition de liens
les .h sont "injectés" tels qu'ils sont quand vous faites un #include

PS je vous ai mis une version "regroupée" qui compile ci dessus. c'est moche mais c'est un point de départ :slight_smile:

Merci, ça se compile / link maintenant bien sous l'IDE Arduino :slight_smile:

Par contre, ça se plante et reboot continuellement :frowning:
(mais bon point, ça semble largement s'executer assez vite sur l'ESP32 pour tenir avec un calcul de chemin par seconde => c'était la limite de vitesse minimale de rafraichissement que je m'étais fixé)

6:50:49.490 -> Rebooting...
16:50:49.490 -> ets Jun  8 2016 00:22:57
16:50:49.490 -> 
16:50:49.490 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
16:50:49.490 -> configsip: 0, SPIWP:0xee
16:50:49.490 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
16:50:49.490 -> mode:DIO, clock div:1
16:50:49.490 -> load:0x3fff0018,len:4
16:50:49.490 -> load:0x3fff001c,len:1216
16:50:49.490 -> ho 0 tail 12 room 4
16:50:49.490 -> load:0x40078000,len:10944
16:50:49.490 -> load:0x40080400,len:6388
16:50:49.522 -> entry 0x400806b4
16:50:49.688 -> SMA star tests
16:50:49.821 ->  012345678901234567890123456789012345678
16:50:49.821 -> #########################################
16:50:49.821 -> #S-#    .............#..#               # 0
16:50:49.821 -> #o-#   ..............#..#               # 1
16:50:49.821 -> #o-#  ...............#..#        T      # 2
16:50:49.821 -> #o-.# ...............#..#       -o-     # 3
16:50:49.821 -> #o-..#...............#..#       -o-     # 4
16:50:49.854 -> #o-...##############.#..#       -o-     # 5
16:50:49.854 -> #o-..................#..#       -o-     # 6
16:50:49.854 -> #o-.....###########..#..#       -o-     # 7
16:50:49.854 -> #o-.......# #...........#       -o-     # 8
16:50:49.854 -> #o-........#..########..#       -o-     # 9
16:50:49.854 -> #o-....###..............#       -o-     # 10
16:50:49.854 -> #o-....# ####################   -o-     # 11
16:50:49.854 -> #o-....#                         o-     # 12
16:50:49.854 -> #o-....#oooooooooooooooooooooooooo-     # 13
16:50:49.901 -> #o-....#o#############||||||||||||      # 14
16:50:49.901 -> #o-....#o#                              # 15
16:50:49.901 -> #o-....#o#                              # 16
16:50:49.901 -> #o-....#o#                              # 17
16:50:49.901 -> #oooooo#o#                              # 18
16:50:49.901 -> #|||||ooo#                              # 19
16:50:49.901 -> #########################################
16:50:49.901 ->  012345678901234567890123456789012345678
16:50:49.901 -> 320 Nodes, 90 Leaves.
16:50:49.901 -> Path length: 68/600
16:50:49.901 -> Mem: 22.472 kB.
16:50:49.901 -> 
16:50:49.901 -> Guru Meditation Error: Core  1 panic'ed (Double exception)
16:50:49.924 -> Core 1 register dump:
16:50:49.924 -> PC      : 0x40080080  PS      : 0x00060b36  A0      : 0x800d1ff7  A1      : 0x3ffc636c  
16:50:49.924 -> A2      : 0x00002aaa  A3      : 0xa5a5a585  A4      : 0x800d1fd4  A5      : 0x3ffb0070  
16:50:49.924 -> A6      : 0x3ffc636c  A7      : 0x00000001  A8      : 0x3ffb955c  A9      : 0x3ffc59f8  
16:50:49.956 -> A10     : 0x00000000  A11     : 0x3ffb1990  A12     : 0x800e834c  A13     : 0x3ffb0050  
16:50:49.956 -> A14     : 0x3ffc636c  A15     : 0x40084024  SAR     : 0x00000002  EXCCAUSE: 0x00000002  
16:50:49.956 -> EXCVADDR: 0xa5a5a585  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0x00000000  
16:50:49.956 -> 
16:50:49.956 -> ELF file SHA256: 0000000000000000
16:50:49.956 -> 
16:50:49.956 -> Backtrace: 0x40080080:0x3ffc636c

=> une idée du problème ?

essayez de regarder là où il y a des boucles ou calculs récursifs et appelez yield(); dans ces fonctions pour quelle watchdog ne vienne pas vous "mordre"

sinon il se peut que vous utilisiez trop de mémoire - ce truc là

#define MAX_MEM (1024ul*1024ul*1024ul)

si c'est utilisé quelque part voudrait dire 1 Giga...

Un grand merci, j-M-L

Je vais analyser les sources et y rajouter quelques infos de débug

Le principal étant que ça se compile / link déjà très bien et que ça commence même déjà à "marchouiller" :slight_smile:

Puis j'essayerais de redécomposer ça en plusieurs fichiers afin que ce soit plus "facilement" maintenable en permettant les modifications uniquement dans des petits fichiers bien séparés plutôt que dans seul un fichier fourre-tout
(j'aimerais bien en faire une librairie afin de pouvoir l'utiliser dans d'autres projets sans être obligé de TOUT mettre dans un seul fichier => m'enfin bon, celà est une autre histoire et je verrais ça plus tard)

voici un autre code d'exemple tiré de ce site à peine modifié (rajout du setup() et loop(), changement du type de données dans le tableau pour ne prendre qu'un seul octet puisque l'on n'utilise réellement que 0 et 1)

// A C++ Program to implement A* Search Algorithm
#include <bits/stdc++.h>
using namespace std;

/* Description of the Grid-
  1--> The cell is not blocked
  0--> The cell is blocked */
#define ROW 9
#define COL 10



// Creating a shortcut for int, int pair type
typedef pair<int, int> Pair;

// Creating a shortcut for pair<int, pair<int, int>> type
typedef pair<double, pair<int, int> > pPair;

// A structure to hold the necessary parameters
struct cell {
  // Row and Column index of its parent
  // Note that 0 <= i <= ROW-1 & 0 <= j <= COL-1
  int parent_i, parent_j;
  // f = g + h
  double f, g, h;
};

// A Utility Function to check whether given cell (row, col)
// is a valid cell or not.
bool isValid(int row, int col)
{
  // Returns true if row number and column number
  // is in range
  return (row >= 0) && (row < ROW) && (col >= 0)
         && (col < COL);
}

// A Utility Function to check whether the given cell is
// blocked or not
bool isUnBlocked(uint8_t grid[][COL], int row, int col)
{
  // Returns true if the cell is not blocked else false
  return (grid[row][col] == 1);
}

// A Utility Function to check whether destination cell has
// been reached or not
bool isDestination(int row, int col, Pair dest)
{
  if (row == dest.first && col == dest.second)
    return (true);
  else
    return (false);
}

// A Utility Function to calculate the 'h' heuristics.
double calculateHValue(int row, int col, Pair dest)
{
  // Return using the distance formula
  return ((double)sqrt(
            (row - dest.first) * (row - dest.first)
            + (col - dest.second) * (col - dest.second)));
}

// A Utility Function to trace the path from the source
// to destination
void tracePath(cell cellDetails[][COL], Pair dest)
{
  Serial.printf("\nThe Path is ");
  int row = dest.first;
  int col = dest.second;

  stack<Pair> Path;

  while (!(cellDetails[row][col].parent_i == row
           && cellDetails[row][col].parent_j == col)) {
    Path.push(make_pair(row, col));
    int temp_row = cellDetails[row][col].parent_i;
    int temp_col = cellDetails[row][col].parent_j;
    row = temp_row;
    col = temp_col;
  }

  Path.push(make_pair(row, col));
  while (!Path.empty()) {
    pair<int, int> p = Path.top();
    Path.pop();
    Serial.printf("-> (%d,%d) ", p.first, p.second);
  }

  return;
}

// A Function to find the shortest path between
// a given source cell to a destination cell according
// to A* Search Algorithm
void aStarSearch(uint8_t grid[][COL], Pair src, Pair dest)
{
  // If the source is out of range
  if (isValid(src.first, src.second) == false) {
    Serial.printf("Source is invalid\n");
    return;
  }

  // If the destination is out of range
  if (isValid(dest.first, dest.second) == false) {
    Serial.printf("Destination is invalid\n");
    return;
  }

  // Either the source or the destination is blocked
  if (isUnBlocked(grid, src.first, src.second) == false
      || isUnBlocked(grid, dest.first, dest.second)
      == false) {
    Serial.printf("Source or the destination is blocked\n");
    return;
  }

  // If the destination cell is the same as source cell
  if (isDestination(src.first, src.second, dest)
      == true) {
    Serial.printf("We are already at the destination\n");
    return;
  }

  // Create a closed list and initialise it to false which
  // means that no cell has been included yet This closed
  // list is implemented as a boolean 2D array
  bool closedList[ROW][COL];
  memset(closedList, false, sizeof(closedList));

  // Declare a 2D array of structure to hold the details
  // of that cell
  cell cellDetails[ROW][COL];

  int i, j;

  for (i = 0; i < ROW; i++) {
    for (j = 0; j < COL; j++) {
      cellDetails[i][j].f = FLT_MAX;
      cellDetails[i][j].g = FLT_MAX;
      cellDetails[i][j].h = FLT_MAX;
      cellDetails[i][j].parent_i = -1;
      cellDetails[i][j].parent_j = -1;
    }
  }

  // Initialising the parameters of the starting node
  i = src.first, j = src.second;
  cellDetails[i][j].f = 0.0;
  cellDetails[i][j].g = 0.0;
  cellDetails[i][j].h = 0.0;
  cellDetails[i][j].parent_i = i;
  cellDetails[i][j].parent_j = j;

  /*
    Create an open list having information as-
    <f, <i, j>>
    where f = g + h,
    and i, j are the row and column index of that cell
    Note that 0 <= i <= ROW-1 & 0 <= j <= COL-1
    This open list is implemented as a set of pair of
    pair.*/
  set<pPair> openList;

  // Put the starting cell on the open list and set its
  // 'f' as 0
  openList.insert(make_pair(0.0, make_pair(i, j)));

  // We set this boolean value as false as initially
  // the destination is not reached.
  bool foundDest = false;

  while (!openList.empty()) {
    pPair p = *openList.begin();

    // Remove this vertex from the open list
    openList.erase(openList.begin());

    // Add this vertex to the closed list
    i = p.second.first;
    j = p.second.second;
    closedList[i][j] = true;

    /*
      Generating all the 8 successor of this cell

      N.W N N.E
      \ | /
        \ | /
      W----Cell----E
        / | \
        / | \
      S.W S S.E

      Cell-->Popped Cell (i, j)
      N --> North  (i-1, j)
      S --> South  (i+1, j)
      E --> East   (i, j+1)
      W --> West     (i, j-1)
      N.E--> North-East (i-1, j+1)
      N.W--> North-West (i-1, j-1)
      S.E--> South-East (i+1, j+1)
      S.W--> South-West (i+1, j-1)*/

    // To store the 'g', 'h' and 'f' of the 8 successors
    double gNew, hNew, fNew;

    //----------- 1st Successor (North) ------------

    // Only process this cell if this is a valid one
    if (isValid(i - 1, j) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i - 1, j, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i - 1][j].parent_i = i;
        cellDetails[i - 1][j].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }
      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i - 1][j] == false
               && isUnBlocked(grid, i - 1, j)
               == true) {
        gNew = cellDetails[i][j].g + 1.0;
        hNew = calculateHValue(i - 1, j, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i - 1][j].f == FLT_MAX
            || cellDetails[i - 1][j].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i - 1, j)));

          // Update the details of this cell
          cellDetails[i - 1][j].f = fNew;
          cellDetails[i - 1][j].g = gNew;
          cellDetails[i - 1][j].h = hNew;
          cellDetails[i - 1][j].parent_i = i;
          cellDetails[i - 1][j].parent_j = j;
        }
      }
    }

    //----------- 2nd Successor (South) ------------

    // Only process this cell if this is a valid one
    if (isValid(i + 1, j) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i + 1, j, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i + 1][j].parent_i = i;
        cellDetails[i + 1][j].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }
      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i + 1][j] == false
               && isUnBlocked(grid, i + 1, j)
               == true) {
        gNew = cellDetails[i][j].g + 1.0;
        hNew = calculateHValue(i + 1, j, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i + 1][j].f == FLT_MAX
            || cellDetails[i + 1][j].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i + 1, j)));
          // Update the details of this cell
          cellDetails[i + 1][j].f = fNew;
          cellDetails[i + 1][j].g = gNew;
          cellDetails[i + 1][j].h = hNew;
          cellDetails[i + 1][j].parent_i = i;
          cellDetails[i + 1][j].parent_j = j;
        }
      }
    }

    //----------- 3rd Successor (East) ------------

    // Only process this cell if this is a valid one
    if (isValid(i, j + 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i, j + 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i][j + 1].parent_i = i;
        cellDetails[i][j + 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i][j + 1] == false
               && isUnBlocked(grid, i, j + 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.0;
        hNew = calculateHValue(i, j + 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i][j + 1].f == FLT_MAX
            || cellDetails[i][j + 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i, j + 1)));

          // Update the details of this cell
          cellDetails[i][j + 1].f = fNew;
          cellDetails[i][j + 1].g = gNew;
          cellDetails[i][j + 1].h = hNew;
          cellDetails[i][j + 1].parent_i = i;
          cellDetails[i][j + 1].parent_j = j;
        }
      }
    }

    //----------- 4th Successor (West) ------------

    // Only process this cell if this is a valid one
    if (isValid(i, j - 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i, j - 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i][j - 1].parent_i = i;
        cellDetails[i][j - 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i][j - 1] == false
               && isUnBlocked(grid, i, j - 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.0;
        hNew = calculateHValue(i, j - 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i][j - 1].f == FLT_MAX
            || cellDetails[i][j - 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i, j - 1)));

          // Update the details of this cell
          cellDetails[i][j - 1].f = fNew;
          cellDetails[i][j - 1].g = gNew;
          cellDetails[i][j - 1].h = hNew;
          cellDetails[i][j - 1].parent_i = i;
          cellDetails[i][j - 1].parent_j = j;
        }
      }
    }

    //----------- 5th Successor (North-East)
    //------------

    // Only process this cell if this is a valid one
    if (isValid(i - 1, j + 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i - 1, j + 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i - 1][j + 1].parent_i = i;
        cellDetails[i - 1][j + 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i - 1][j + 1] == false
               && isUnBlocked(grid, i - 1, j + 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.414;
        hNew = calculateHValue(i - 1, j + 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i - 1][j + 1].f == FLT_MAX
            || cellDetails[i - 1][j + 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i - 1, j + 1)));

          // Update the details of this cell
          cellDetails[i - 1][j + 1].f = fNew;
          cellDetails[i - 1][j + 1].g = gNew;
          cellDetails[i - 1][j + 1].h = hNew;
          cellDetails[i - 1][j + 1].parent_i = i;
          cellDetails[i - 1][j + 1].parent_j = j;
        }
      }
    }

    //----------- 6th Successor (North-West)
    //------------

    // Only process this cell if this is a valid one
    if (isValid(i - 1, j - 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i - 1, j - 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i - 1][j - 1].parent_i = i;
        cellDetails[i - 1][j - 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i - 1][j - 1] == false
               && isUnBlocked(grid, i - 1, j - 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.414;
        hNew = calculateHValue(i - 1, j - 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i - 1][j - 1].f == FLT_MAX
            || cellDetails[i - 1][j - 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i - 1, j - 1)));
          // Update the details of this cell
          cellDetails[i - 1][j - 1].f = fNew;
          cellDetails[i - 1][j - 1].g = gNew;
          cellDetails[i - 1][j - 1].h = hNew;
          cellDetails[i - 1][j - 1].parent_i = i;
          cellDetails[i - 1][j - 1].parent_j = j;
        }
      }
    }

    //----------- 7th Successor (South-East)
    //------------

    // Only process this cell if this is a valid one
    if (isValid(i + 1, j + 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i + 1, j + 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i + 1][j + 1].parent_i = i;
        cellDetails[i + 1][j + 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i + 1][j + 1] == false
               && isUnBlocked(grid, i + 1, j + 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.414;
        hNew = calculateHValue(i + 1, j + 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i + 1][j + 1].f == FLT_MAX
            || cellDetails[i + 1][j + 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i + 1, j + 1)));

          // Update the details of this cell
          cellDetails[i + 1][j + 1].f = fNew;
          cellDetails[i + 1][j + 1].g = gNew;
          cellDetails[i + 1][j + 1].h = hNew;
          cellDetails[i + 1][j + 1].parent_i = i;
          cellDetails[i + 1][j + 1].parent_j = j;
        }
      }
    }

    //----------- 8th Successor (South-West)
    //------------

    // Only process this cell if this is a valid one
    if (isValid(i + 1, j - 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i + 1, j - 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i + 1][j - 1].parent_i = i;
        cellDetails[i + 1][j - 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i + 1][j - 1] == false
               && isUnBlocked(grid, i + 1, j - 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.414;
        hNew = calculateHValue(i + 1, j - 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i + 1][j - 1].f == FLT_MAX
            || cellDetails[i + 1][j - 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i + 1, j - 1)));

          // Update the details of this cell
          cellDetails[i + 1][j - 1].f = fNew;
          cellDetails[i + 1][j - 1].g = gNew;
          cellDetails[i + 1][j - 1].h = hNew;
          cellDetails[i + 1][j - 1].parent_i = i;
          cellDetails[i + 1][j - 1].parent_j = j;
        }
      }
    }
  }

  // When the destination cell is not found and the open
  // list is empty, then we conclude that we failed to
  // reach the destination cell. This may happen when the
  // there is no way to destination cell (due to
  // blockages)
  if (foundDest == false)
    Serial.printf("Failed to find the Destination Cell\n");

  return;
}

void setup() {
  Serial.begin(115200);
  
  uint8_t grid[ROW][COL] = {
    { 1, 0, 1, 1, 1, 1, 0, 1, 1, 1 },
    { 1, 1, 1, 0, 1, 1, 1, 0, 1, 1 },
    { 1, 1, 1, 0, 1, 1, 0, 1, 0, 1 },
    { 0, 0, 1, 0, 1, 0, 0, 0, 0, 1 },
    { 1, 1, 1, 0, 1, 1, 1, 0, 1, 0 },
    { 1, 0, 1, 1, 1, 1, 0, 1, 0, 0 },
    { 1, 0, 0, 0, 0, 1, 0, 0, 0, 1 },
    { 1, 0, 1, 1, 1, 1, 0, 1, 1, 1 },
    { 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 }
  };

  // Source is the left-most bottom-most corner
  Pair src = make_pair(8, 6);

  // Destination is the left-most top-most corner
  Pair dest = make_pair(0, 0);

  aStarSearch(grid, src, dest);
}

void loop() {}

si vous le faites tourner sur ESP32 il vous dira (console à 115200 bauds)

The destination cell is found
The Path is -> (8,6) -> (7,5) -> (6,5) -> (5,4) -> (5,3) -> (4,2) -> (3,2) -> (2,1) -> (1,0) -> (0,0) 

qui correspond au chemin enter la cellule verte et bleue
image

essayez votre code avec une matrice plus petite, si ça passe c'est que vous avez un souci de mémoire sans doute (la stack n'est pas énorme sur un ESP32 avec Arduino)

j'ai essayé mon code avec votre matrice et ça plantait aussi, confirmant le souci mémoire.

En déplaçant la grille ainsi que les 2 tableaux locaux de la fonction de recherche (alloués sur la pile) pour les mettre en variables globales (alloués en mémoire générale / tas) alors ça fonctionne

j'ai rajouté une mesure du temps d'exploration et le programme me dit

The destination cell is found

The Path is -> (0,0) -> (1,1) -> (2,1) -> (3,2) -> (4,3) -> (5,4) -> (6,5) -> (7,5) -> (8,5) -> (9,5) -> (10,5) -> (11,5) -> (12,5) -> (13,5) -> (14,5) -> (15,5) -> (16,5) -> (17,5) -> (18,5) -> (19,6) -> (18,7) -> (17,7) -> (16,7) -> (15,7) -> (14,7) -> (13,8) -> (12,9) -> (12,10) -> (12,11) -> (12,12) -> (12,13) -> (12,14) -> (12,15) -> (12,16) -> (12,17) -> (12,18) -> (12,19) -> (12,20) -> (12,21) -> (12,22) -> (12,23) -> (12,24) -> (12,25) -> (12,26) -> (12,27) -> (11,28) -> (10,28) -> (9,29) -> (8,29) -> (7,30) -> (6,30) -> (5,31) -> (4,31) -> (3,32) -> (2,32)
Temps de recherche: 56734 µs

➜ donc environ 60ms pour le calcul de ce chemin, largement dans les clous pour vos besoins.
(les indices imprimés par le code commencent à 0 - (0,0) est le coin en haut à gauche. L'affichage se fait en (LIGNE, COLONNE) donc un peu contre intuitif par rapport à la notation habituelle (x,y)

voici le code

// A C++ Program to implement A* Search Algorithm
// extracted and modified slightly (stack constraints) from https://www.geeksforgeeks.org/a-search-algorithm/

#include <bits/stdc++.h>
using namespace std;

/* Description of the Grid-
  1--> The cell is not blocked
  0--> The cell is blocked */
#define ROW 21
#define COL 39

// Creating a shortcut for int, int pair type
typedef pair<int, int> Pair;

// Creating a shortcut for pair<int, pair<int, int>> type
typedef pair<double, pair<int, int> > pPair;

// A structure to hold the necessary parameters
struct cell {
  // Row and Column index of its parent
  // Note that 0 <= i <= ROW-1 & 0 <= j <= COL-1
  int parent_i, parent_j;
  // f = g + h
  double f, g, h;
};

uint8_t grid[ROW][COL] = {
  {1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 1
  {1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 5
  {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 10
  {1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 15
  {1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
  {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 20
  {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, // 21
};

// Create a closed list and initiali
bool closedList[ROW][COL];

// Source
Pair src = make_pair(0, 0);

// Destination
Pair dest = make_pair(2, 32);

// Declare a 2D array of structure to hold the details
// of that cell
cell cellDetails[ROW][COL];

// A Utility Function to check whether given cell (row, col)
// is a valid cell or not.
bool isValid(int row, int col)
{
  // Returns true if row number and column number
  // is in range
  return (row >= 0) && (row < ROW) && (col >= 0)
         && (col < COL);
}

// A Utility Function to check whether the given cell is
// blocked or not
bool isUnBlocked(uint8_t grid[][COL], int row, int col)
{
  // Returns true if the cell is not blocked else false
  return (grid[row][col] == 1);
}

// A Utility Function to check whether destination cell has
// been reached or not
bool isDestination(int row, int col, Pair dest)
{
  if (row == dest.first && col == dest.second)
    return (true);
  else
    return (false);
}

// A Utility Function to calculate the 'h' heuristics.
double calculateHValue(int row, int col, Pair dest)
{
  // Return using the distance formula
  return ((double)sqrt(
            (row - dest.first) * (row - dest.first)
            + (col - dest.second) * (col - dest.second)));
}

// A Utility Function to trace the path from the source
// to destination
void tracePath(cell cellDetails[][COL], Pair dest)
{
  Serial.printf("\nThe Path is ");
  int row = dest.first;
  int col = dest.second;

  stack<Pair> Path;

  while (!(cellDetails[row][col].parent_i == row
           && cellDetails[row][col].parent_j == col)) {
    Path.push(make_pair(row, col));
    int temp_row = cellDetails[row][col].parent_i;
    int temp_col = cellDetails[row][col].parent_j;
    row = temp_row;
    col = temp_col;
  }

  Path.push(make_pair(row, col));
  while (!Path.empty()) {
    pair<int, int> p = Path.top();
    Path.pop();
    Serial.printf("-> (%d,%d) ", p.first, p.second);
  }
  Serial.println();
  return;
}

// A Function to find the shortest path between
// a given source cell to a destination cell according
// to A* Search Algorithm
void aStarSearch(uint8_t grid[][COL], Pair src, Pair dest)
{
  // If the source is out of range
  if (isValid(src.first, src.second) == false) {
    Serial.printf("Source is invalid\n");
    return;
  }

  // If the destination is out of range
  if (isValid(dest.first, dest.second) == false) {
    Serial.printf("Destination is invalid\n");
    return;
  }

  // Either the source or the destination is blocked
  if (isUnBlocked(grid, src.first, src.second) == false
      || isUnBlocked(grid, dest.first, dest.second)
      == false) {
    Serial.printf("Source or the destination is blocked\n");
    return;
  }

  // If the destination cell is the same as source cell
  if (isDestination(src.first, src.second, dest)
      == true) {
    Serial.printf("We are already at the destination\n");
    return;
  }

  // use the closed list and initialise it to false which
  // means that no cell has been included yet This closed
  // list is implemented as a boolean 2D array

  memset(closedList, false, sizeof(closedList));


  int i, j;

  for (i = 0; i < ROW; i++) {
    for (j = 0; j < COL; j++) {
      cellDetails[i][j].f = FLT_MAX;
      cellDetails[i][j].g = FLT_MAX;
      cellDetails[i][j].h = FLT_MAX;
      cellDetails[i][j].parent_i = -1;
      cellDetails[i][j].parent_j = -1;
    }
  }

  // Initialising the parameters of the starting node
  i = src.first, j = src.second;
  cellDetails[i][j].f = 0.0;
  cellDetails[i][j].g = 0.0;
  cellDetails[i][j].h = 0.0;
  cellDetails[i][j].parent_i = i;
  cellDetails[i][j].parent_j = j;

  /*
    Create an open list having information as-
    <f, <i, j>>
    where f = g + h,
    and i, j are the row and column index of that cell
    Note that 0 <= i <= ROW-1 & 0 <= j <= COL-1
    This open list is implemented as a set of pair of
    pair.*/
  set<pPair> openList;

  // Put the starting cell on the open list and set its
  // 'f' as 0
  openList.insert(make_pair(0.0, make_pair(i, j)));

  // We set this boolean value as false as initially
  // the destination is not reached.
  bool foundDest = false;

  while (!openList.empty()) {
    pPair p = *openList.begin();

    // Remove this vertex from the open list
    openList.erase(openList.begin());

    // Add this vertex to the closed list
    i = p.second.first;
    j = p.second.second;
    closedList[i][j] = true;

    /*
      Generating all the 8 successor of this cell

      N.W N N.E
      \ | /
        \ | /
      W----Cell----E
        / | \
        / | \
      S.W S S.E

      Cell-->Popped Cell (i, j)
      N --> North  (i-1, j)
      S --> South  (i+1, j)
      E --> East   (i, j+1)
      W --> West     (i, j-1)
      N.E--> North-East (i-1, j+1)
      N.W--> North-West (i-1, j-1)
      S.E--> South-East (i+1, j+1)
      S.W--> South-West (i+1, j-1)*/

    // To store the 'g', 'h' and 'f' of the 8 successors
    double gNew, hNew, fNew;

    //----------- 1st Successor (North) ------------

    // Only process this cell if this is a valid one
    if (isValid(i - 1, j) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i - 1, j, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i - 1][j].parent_i = i;
        cellDetails[i - 1][j].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }
      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i - 1][j] == false
               && isUnBlocked(grid, i - 1, j)
               == true) {
        gNew = cellDetails[i][j].g + 1.0;
        hNew = calculateHValue(i - 1, j, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i - 1][j].f == FLT_MAX
            || cellDetails[i - 1][j].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i - 1, j)));

          // Update the details of this cell
          cellDetails[i - 1][j].f = fNew;
          cellDetails[i - 1][j].g = gNew;
          cellDetails[i - 1][j].h = hNew;
          cellDetails[i - 1][j].parent_i = i;
          cellDetails[i - 1][j].parent_j = j;
        }
      }
    }

    //----------- 2nd Successor (South) ------------

    // Only process this cell if this is a valid one
    if (isValid(i + 1, j) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i + 1, j, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i + 1][j].parent_i = i;
        cellDetails[i + 1][j].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }
      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i + 1][j] == false
               && isUnBlocked(grid, i + 1, j)
               == true) {
        gNew = cellDetails[i][j].g + 1.0;
        hNew = calculateHValue(i + 1, j, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i + 1][j].f == FLT_MAX
            || cellDetails[i + 1][j].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i + 1, j)));
          // Update the details of this cell
          cellDetails[i + 1][j].f = fNew;
          cellDetails[i + 1][j].g = gNew;
          cellDetails[i + 1][j].h = hNew;
          cellDetails[i + 1][j].parent_i = i;
          cellDetails[i + 1][j].parent_j = j;
        }
      }
    }

    //----------- 3rd Successor (East) ------------

    // Only process this cell if this is a valid one
    if (isValid(i, j + 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i, j + 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i][j + 1].parent_i = i;
        cellDetails[i][j + 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i][j + 1] == false
               && isUnBlocked(grid, i, j + 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.0;
        hNew = calculateHValue(i, j + 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i][j + 1].f == FLT_MAX
            || cellDetails[i][j + 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i, j + 1)));

          // Update the details of this cell
          cellDetails[i][j + 1].f = fNew;
          cellDetails[i][j + 1].g = gNew;
          cellDetails[i][j + 1].h = hNew;
          cellDetails[i][j + 1].parent_i = i;
          cellDetails[i][j + 1].parent_j = j;
        }
      }
    }

    //----------- 4th Successor (West) ------------

    // Only process this cell if this is a valid one
    if (isValid(i, j - 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i, j - 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i][j - 1].parent_i = i;
        cellDetails[i][j - 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i][j - 1] == false
               && isUnBlocked(grid, i, j - 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.0;
        hNew = calculateHValue(i, j - 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i][j - 1].f == FLT_MAX
            || cellDetails[i][j - 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i, j - 1)));

          // Update the details of this cell
          cellDetails[i][j - 1].f = fNew;
          cellDetails[i][j - 1].g = gNew;
          cellDetails[i][j - 1].h = hNew;
          cellDetails[i][j - 1].parent_i = i;
          cellDetails[i][j - 1].parent_j = j;
        }
      }
    }

    //----------- 5th Successor (North-East)
    //------------

    // Only process this cell if this is a valid one
    if (isValid(i - 1, j + 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i - 1, j + 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i - 1][j + 1].parent_i = i;
        cellDetails[i - 1][j + 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i - 1][j + 1] == false
               && isUnBlocked(grid, i - 1, j + 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.414;
        hNew = calculateHValue(i - 1, j + 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i - 1][j + 1].f == FLT_MAX
            || cellDetails[i - 1][j + 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i - 1, j + 1)));

          // Update the details of this cell
          cellDetails[i - 1][j + 1].f = fNew;
          cellDetails[i - 1][j + 1].g = gNew;
          cellDetails[i - 1][j + 1].h = hNew;
          cellDetails[i - 1][j + 1].parent_i = i;
          cellDetails[i - 1][j + 1].parent_j = j;
        }
      }
    }

    //----------- 6th Successor (North-West)
    //------------

    // Only process this cell if this is a valid one
    if (isValid(i - 1, j - 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i - 1, j - 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i - 1][j - 1].parent_i = i;
        cellDetails[i - 1][j - 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i - 1][j - 1] == false
               && isUnBlocked(grid, i - 1, j - 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.414;
        hNew = calculateHValue(i - 1, j - 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i - 1][j - 1].f == FLT_MAX
            || cellDetails[i - 1][j - 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i - 1, j - 1)));
          // Update the details of this cell
          cellDetails[i - 1][j - 1].f = fNew;
          cellDetails[i - 1][j - 1].g = gNew;
          cellDetails[i - 1][j - 1].h = hNew;
          cellDetails[i - 1][j - 1].parent_i = i;
          cellDetails[i - 1][j - 1].parent_j = j;
        }
      }
    }

    //----------- 7th Successor (South-East)
    //------------

    // Only process this cell if this is a valid one
    if (isValid(i + 1, j + 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i + 1, j + 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i + 1][j + 1].parent_i = i;
        cellDetails[i + 1][j + 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i + 1][j + 1] == false
               && isUnBlocked(grid, i + 1, j + 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.414;
        hNew = calculateHValue(i + 1, j + 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i + 1][j + 1].f == FLT_MAX
            || cellDetails[i + 1][j + 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i + 1, j + 1)));

          // Update the details of this cell
          cellDetails[i + 1][j + 1].f = fNew;
          cellDetails[i + 1][j + 1].g = gNew;
          cellDetails[i + 1][j + 1].h = hNew;
          cellDetails[i + 1][j + 1].parent_i = i;
          cellDetails[i + 1][j + 1].parent_j = j;
        }
      }
    }

    //----------- 8th Successor (South-West)
    //------------

    // Only process this cell if this is a valid one
    if (isValid(i + 1, j - 1) == true) {
      // If the destination cell is the same as the
      // current successor
      if (isDestination(i + 1, j - 1, dest) == true) {
        // Set the Parent of the destination cell
        cellDetails[i + 1][j - 1].parent_i = i;
        cellDetails[i + 1][j - 1].parent_j = j;
        Serial.printf("The destination cell is found\n");
        tracePath(cellDetails, dest);
        foundDest = true;
        return;
      }

      // If the successor is already on the closed
      // list or if it is blocked, then ignore it.
      // Else do the following
      else if (closedList[i + 1][j - 1] == false
               && isUnBlocked(grid, i + 1, j - 1)
               == true) {
        gNew = cellDetails[i][j].g + 1.414;
        hNew = calculateHValue(i + 1, j - 1, dest);
        fNew = gNew + hNew;

        // If it isn’t on the open list, add it to
        // the open list. Make the current square
        // the parent of this square. Record the
        // f, g, and h costs of the square cell
        //       OR
        // If it is on the open list already, check
        // to see if this path to that square is
        // better, using 'f' cost as the measure.
        if (cellDetails[i + 1][j - 1].f == FLT_MAX
            || cellDetails[i + 1][j - 1].f > fNew) {
          openList.insert(make_pair(
                            fNew, make_pair(i + 1, j - 1)));

          // Update the details of this cell
          cellDetails[i + 1][j - 1].f = fNew;
          cellDetails[i + 1][j - 1].g = gNew;
          cellDetails[i + 1][j - 1].h = hNew;
          cellDetails[i + 1][j - 1].parent_i = i;
          cellDetails[i + 1][j - 1].parent_j = j;
        }
      }
    }
  }

  // When the destination cell is not found and the open
  // list is empty, then we conclude that we failed to
  // reach the destination cell. This may happen when the
  // there is no way to destination cell (due to
  // blockages)
  if (foundDest == false)
    Serial.printf("Failed to find the Destination Cell\n");

  return;
}

void setup() {
  Serial.begin(115200);
  unsigned long t0 = micros();
  aStarSearch(grid, src, dest);
  unsigned long t1 = micros();
  Serial.printf("Temps de recherche: %lu µs", t1 - t0);
}

void loop() {}

Génial et encore merci J-M-L

Ca se compile sans problème sur l'IDE Arduino et tourne très bien sur l'ESP32 :slight_smile: :slight_smile:

03:10:32.015 -> The destination cell is found
03:10:32.015 -> 
03:10:32.015 -> The Path is -> (0,0) -> (1,1) -> (2,1) -> (3,2) -> (4,3) -> (5,4) -> (6,5) -> (7,5) -> (8,5) -> (9,5) -> (10,5) -> (11,5) -> (12,5) -> (13,5) -> (14,5) -> (15,5) -> (16,5) -> (17,5) -> (18,5) -> (19,6) -> (18,7) -> (17,7) -> (16,7) -> (15,7) -> (14,7) -> (13,8) -> (12,9) -> (12,10) -> (12,11) -> (12,12) -> (12,13) -> (12,14) -> (12,15) -> (12,16) -> (12,17) -> (12,18) -> (12,19) -> (12,20) -> (12,21) -> (12,22) -> (12,23) -> (12,24) -> (12,25) -> (12,26) -> (12,27) -> (11,28) -> (10,28) -> (9,29) -> (8,29) -> (7,30) -> (6,30) -> (5,31) -> (4,31) -> (3,32) -> (2,32) 
03:10:32.051 -> Temps de recherche: 56912 µs

56912 µs = 56.912 ms = un peu plus de 17 Hz => pas de problème, ca va largement assez vite :slight_smile: :slight_smile:

Je vais tout d'abord déplacer la fonction aStarSearch() et le timing associé de la fonction Setup() à la fonction loop() en y ajoutant une petite tempo car je pense que 10 Hz seront amplement suffisant

Je pense que je n'aurais par la suite même plus besoin de cette tempo car je prévois d'y rajouter des fonctions de réception/traitement/émission de signaux infrarouges pour commander le trajet de robots jouets en simulant les touches des télécommandes par l' ESP32, ainsi que la possibilté que la carte soit régulièrement mise à jour afin d'y simuler les déplacements entre plusieurs salles
(il y aura une map distincte pour chacune des salles composants la maison/appartement => la map principale où sera recherchée le chemin sera une composition effectuée en temps réel en fonction de la position du robot et des différentes salles qui lui sont relativement proche + de la position d'éventuels autres robots afin qu'ils ne se rentrent pas dedans)
[s'y rajoutera aussi la gestion d'une sortie sonore via un circuit MAX98357A connecté en I2S sur l'ESP32 de chacun des robots + d'autres trucs comme la possibilité de mise à jour en OTA, de donner aux robots la possibilité de blablater entre eux ou de lire le contenu d'un sîte d'information histoire de leur donner un semblant d'intelligence]

Sympa comme projet !

Merci,

Mon projet est d'avoir une escorte de robots jouets pour mon robot-aspirateur

Il y aura 3 ou 4 robots jouets qui escorteront le robot aspirateur et qui joueront des rôles de "gardes du corps / escorte" complêtement déjantés qui se feront des dialogues "à la n'importe nawak" entres eux mais auront néanmoins de temps en temps des éclairs de lucidité et donneront des informations pertinentes

Par exemple, l'un aura un capteur de température/humidité et
donnera de temps en temps la température et le degré d'humidité à l'endroit où il se trouve, une autre aura un détecteur de mouvement/son et ira en avant du robot pour jouer l'espion avant de rentrer dans une salle en détectant alors la présence d'éventuelles personnes et dira alors une ou deux conneries en plus d'empêcher le robot-aspirateur et le reste de l' escorte de venir dans la salle si une ou plusieurs personnes y sont déjà afin de ne pas les déranger et un autre aura un détecteur de poussière afin d'automatiquement appeler le robot aspirateur pour venir y faire le ménage s'il détecte une endroit sale/poussièreux
(tous auront une sortie son afin de pouvoir se faire la discute (cf. un dialogue à la petit nègre du style "Moi avoir froid -> Moi demander monter température chauffage" (en fait, l'un aura bêtement détecté que la température est basse et l'autre demandera alors de monter le chauffage histoire de paraître intelligents/vivants :smiley: :smiley: ) , diffuser une chaîne de radio ou une musique/chanson préselectionnée et je prévois même qu'ils puissent automatiquement changer la chaîne de TV affichée sur ma TV relié à la Freebox et/ou de demander la diffusion sonore d'une info sur mes Google Home lorsque l'un deux aura détecté une information importante via une fil d'info ou Google News par exemples

=> m'enfin bon, je pense que j'ai déjà largement de quoi bien m'occuper pendant cet hiver avec tout ça :smiley: :smiley:

et sans doute plus !!
n'hésitez à revenir poster une vidéo du système en fonction quand ce sera prêt

OK, pas de problème, avec plaisir

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.