IDF release/v4.4 6a7d83af19

* Update toolchain to 2021r2 (#5828)
* Update C3 libs to support only ECO3 and newer
This commit is contained in:
Me No Dev 2021-11-04 14:22:34 +02:00 committed by GitHub
parent caa8d07aaf
commit 418ac74be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
319 changed files with 5807 additions and 221 deletions

View File

@ -36,17 +36,17 @@
{
"packager": "esp32",
"name": "riscv32-esp-elf-gcc",
"version": "gcc8_4_0-esp-2021r1"
"version": "gcc8_4_0-esp-2021r2"
},
{
"packager": "esp32",
"name": "xtensa-esp32-elf-gcc",
"version": "gcc8_4_0-esp-2021r1"
"version": "gcc8_4_0-esp-2021r2"
},
{
"packager": "esp32",
"name": "xtensa-esp32s2-elf-gcc",
"version": "gcc8_4_0-esp-2021r1"
"version": "gcc8_4_0-esp-2021r2"
},
{
"packager": "esp32",
@ -69,124 +69,166 @@
"tools": [
{
"name": "riscv32-esp-elf-gcc",
"version": "gcc8_4_0-esp-2021r1",
"version": "gcc8_4_0-esp-2021r2",
"systems": [
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz",
"checksum": "SHA-256:3459618f33bbd5f54d7d7783e807cb6eef6472a220f2f1eb3faced735b9d13bb",
"size": "152812483"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz",
"checksum": "SHA-256:812d735063da9d063b374b59f55832a96c41fbd27ddaef19000a75de8607ba21",
"size": "106837189"
},
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz",
"checksum": "SHA-256:712f1fbc3e08304a6f32aa18b346b16bbcb413b507b3d4c7c3211bf0d7dc4813",
"size": "103273444"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz",
"checksum": "SHA-256:24b9e54b348bbd5fb816fc4c52abb47337c702beecdbba840750b7cfb9d38069",
"size": "151726623"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz",
"checksum": "SHA-256:80a3342cda2cd4b6b75ebb2b36d5d12fce7d375cfadadcff01ec3a907f0a16a2",
"size": "103058744"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz",
"checksum": "SHA-256:954d340ebffef12a2ce9be1ea004e6f45a8863f1e6f41f46fd3f04f58499627c",
"size": "155430963"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz",
"checksum": "SHA-256:7f0162a81558ab0ed09d6c5d356def25b5cb3d5c2d61358f20152fa260ccc8ae",
"size": "109447789"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-macos.tar.gz",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-macos.tar.gz",
"checksum": "SHA-256:612fb3a3f84f703222327bd16581df8f80fda8cdf137637fe5d611587d1b664e",
"size": "159836199"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-macos.tar.gz",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-macos.tar.gz",
"checksum": "SHA-256:3ff7e5427907cf8e271c1f959b70fb01e39625c3caf61a6567e7b38aa0c11578",
"size": "113672945"
},
{
"host": "i686-mingw32",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/riscv32-esp-elf-gcc8_4_0-esp-2021r1-win32.zip",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r1-win32.zip",
"checksum": "SHA-256:5711eb407ffe44adddbd1281b6b575a5645e7193ca78faefa27dc5bc5b662bec",
"size": "191266312"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-win32.zip",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-win32.zip",
"checksum": "SHA-256:c8ff08883c1456c278fad85e1c43b7c6e251d525683214168655550e85c5b82e",
"size": "140809778"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/riscv32-esp-elf-gcc8_4_0-esp-2021r2-win64.zip",
"archiveFileName": "riscv32-esp-elf-gcc8_4_0-esp-2021r2-win64.zip",
"checksum": "SHA-256:6c04cb4728db928ec6473e63146b695b6dec686a0d40dd73dd3353f05247b19e",
"size": "142365782"
}
]
},
{
"name": "xtensa-esp32-elf-gcc",
"version": "gcc8_4_0-esp-2021r1",
"version": "gcc8_4_0-esp-2021r2",
"systems": [
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz",
"checksum": "SHA-256:44a0b467b9d2b759ab48b2f27aed684581f33c96e2842992781c4e045992c5b0",
"size": "86361217"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz",
"checksum": "SHA-256:3eb3d68b27fa6ba5af6f88da21cb8face9be0094daaa8960793cfe570ab785ff",
"size": "90565318"
},
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz",
"checksum": "SHA-256:aa534be24e45e06b7080a6a3bb8cd9e3cfb818f5f8bce2244d7cfb5e91336541",
"size": "86860292"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz",
"checksum": "SHA-256:fdacdb2a7bbf6293bcafda9b52463a4da8a2f3b7e1df9f83d35ff9d1efa22012",
"size": "84520407"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz",
"checksum": "SHA-256:f0e49ce06fe7833ff5d76961dc2dac5449d320f823bb8c05a302cf85a3a6eb04",
"size": "86183421"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz",
"checksum": "SHA-256:e2024096492dfaa50fc6ac336cd8faa2e395e8cebb617753eab0b5f16d3dd0dc",
"size": "88375391"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz",
"checksum": "SHA-256:06de09b74652de43e5b22db3b7fc992623044baa75e9faaab68317a986715ba3",
"size": "92582250"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-macos.tar.gz",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-macos.tar.gz",
"checksum": "SHA-256:7bbc6a2b94f009cd8a3351b9c7acf7a5caa1c4d3700500ead60f84965386a61b",
"size": "93357296"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-macos.tar.gz",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-macos.tar.gz",
"checksum": "SHA-256:96443f69c8569417c780ee749d91ef33cffe22153fffa30a0fbf12107d87381b",
"size": "97808961"
},
{
"host": "i686-mingw32",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win32.zip",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r1-win32.zip",
"checksum": "SHA-256:e4f9fdda192abfc9807e3e7fcd6e9fea30c1a0cf3f3c5a5c961b5114fc8c9b7e",
"size": "105603626"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win32.zip",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win32.zip",
"checksum": "SHA-256:076a4171bdc33e5ced3952efffb233d70263dfa760e636704050597a9edf61db",
"size": "112578260"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win64.zip",
"archiveFileName": "xtensa-esp32-elf-gcc8_4_0-esp-2021r2-win64.zip",
"checksum": "SHA-256:c35b7998f7f503e0cb22055d1e279ae14b6b0e09bb3ff3846b17d552ece9c247",
"size": "115278695"
}
]
},
{
"name": "xtensa-esp32s2-elf-gcc",
"version": "gcc8_4_0-esp-2021r1",
"version": "gcc8_4_0-esp-2021r2",
"systems": [
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-amd64.tar.gz",
"checksum": "SHA-256:b127baccfe6949ee7eaf3d0782ea772750a9b8e2732b16ce6bcc9dcd91f7209a",
"size": "86687290"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-amd64.tar.gz",
"checksum": "SHA-256:a6e0947c92b823ca04f062522249f0a428357e0b056f1ff4c6bcabef83cf63a7",
"size": "90901736"
},
{
"host": "aarch64-linux-gnu",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-arm64.tar.gz",
"checksum": "SHA-256:d2e5600fc194b508bd393b236a09fd62ed70afb6c36619d4b106b696a56ca66d",
"size": "87176557"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-armel.tar.gz",
"checksum": "SHA-256:7ca0d240f11e1c53c01a56257b0c968f876ab405142d1068d8c9b456d939554c",
"size": "84916701"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-armel.tar.gz",
"checksum": "SHA-256:3fff4199e986dd74660f17ca27d9414cb98f1b911a7f13bb3b22e784cb1156cf",
"size": "86581102"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-linux-i686.tar.gz",
"checksum": "SHA-256:9941f993ff84d1c606b45ffbeeb7bcdc5a72cf24e787bb9230390510fe3511c6",
"size": "88699953"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-linux-i686.tar.gz",
"checksum": "SHA-256:7732f9fb371d36b6b324820e300beecc33c2719921a61cf1cdb5bc625016b346",
"size": "92875986"
},
{
"host": "x86_64-apple-darwin",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-macos.tar.gz",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-macos.tar.gz",
"checksum": "SHA-256:4b55b1a9ca7fc945be6fc3513802b6cece9264bee4cbca76013569cec2695973",
"size": "93757895"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-macos.tar.gz",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-macos.tar.gz",
"checksum": "SHA-256:e6dd32782fcff8f633299b97d1c671d6b6513390aca2ddbd7543c2cc62e72d7e",
"size": "98212907"
},
{
"host": "i686-mingw32",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r1/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r1-win32.zip",
"checksum": "SHA-256:c94ec1e45c81b7e4944d216bab4aa41d46849768d7761fd691661dab1a3df828",
"size": "106013515"
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win32.zip",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win32.zip",
"checksum": "SHA-256:41b917b35f6fbe7d30b7de91c32cf348c406acfa729a1eabc450d040dc46fbe2",
"size": "113022469"
},
{
"host": "x86_64-mingw32",
"url": "https://github.com/espressif/crosstool-NG/releases/download/esp-2021r2/xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win64.zip",
"archiveFileName": "xtensa-esp32s2-elf-gcc8_4_0-esp-2021r2-win64.zip",
"checksum": "SHA-256:a764c1a0ee743d69f8cbfadbe4426a2c15c0e233b0894244c7cadf3b4d7dd32a",
"size": "115696999"
}
]
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -673,5 +673,5 @@
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
#define CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP
#define CONFIG_ARDUINO_IDF_COMMIT "2720d45e71"
#define CONFIG_ARDUINO_IDF_COMMIT "6a7d83af19"
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"

View File

@ -0,0 +1,208 @@
// Copyright 2020-2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef _ekf_h_
#define _ekf_h_
#include <stdint.h>
#include <stdbool.h>
#include <math.h>
#include <stdint.h>
#include <mat.h>
class ekf {
public:
// x - amount of states in EKF. x[n] = F*x[n-1] + G*u + W. Size of matrix F
// w - amount of control measurements and noise inputs. Size of matrix G
ekf(int x, int w);
virtual ~ekf();
virtual void Process(float *u, float dt);
virtual void Init() = 0;
// x[n] = F*x[n-1] + G*u + W
int NUMX; // number of states, X is the state vector (size of F matrix)
int NUMW; // size of G matrix
// System state vector
dspm::Mat &X;
// linearized system matrices
dspm::Mat &F;
dspm::Mat &G;
// covariance matrix and state vector
dspm::Mat &P;
// input noise and measurement noise variances
dspm::Mat &Q;
/**
* Runge-Kutta state update method.
* The method calculates derivatives of input vector x and control measurements u
* Re
* @param[in] x: state vector
* @param[in] u: control measurement
* @param[in] dt: time interval from last update in seconds
*/
void RungeKutta(dspm::Mat &x, float *u, float dt);
// System Dependent methods:
/**
* Derivative of state vector X
* Re
* @param[in] x: state vector
* @param[in] u: control measurement
* @return
* - derivative of input vector x and u
*/
virtual dspm::Mat StateXdot(dspm::Mat &x, float *u) = 0;
/**
* Calculation of system state matrices F and G
* @param[in] x: state vector
* @param[in] u: control measurement
*/
virtual void LinearizeFG(dspm::Mat &x, float *u) = 0;
//
// System independent methods
/**
* Calculates covariance prediction matrux P.
* Update matrix P
* @param[in] dt: time interval from last update
*/
virtual void CovariancePrediction(float dt);
/**
* Update of current state by measured values.
* Optimized method for non correlated values
* Calculate Kalman gain and update matrix P and vector X.
* @param[in] H: derivative matrix
* @param[in] measured: array of measured values
* @param[in] expected: array of expected values
* @param[in] R: measurement noise covariance values
*/
virtual void Update(dspm::Mat &H, float *measured, float *expected, float *R);
/**
* Update of current state by measured values.
* This method just as a reference for research purpose.
* Not used in real calculations.
* @param[in] H: derivative matrix
* @param[in] measured: array of measured values
* @param[in] expected: array of expected values
* @param[in] R: measurement noise covariance values
*/
virtual void UpdateRef(dspm::Mat &H, float *measured, float *expected, float *R);
float *HP;
float *Km;
public:
// Additional universal helper methods
/**
* Convert quaternion to rotation matrix.
* @param[in] q: quaternion
*
* @return
* - rotation matrix 3x3
*/
static dspm::Mat quat2rotm(float q[4]);
/**
* Convert rotation matrix to quaternion.
* @param[in] R: rotation matrix
*
* @return
* - quaternion 4x1
*/
static dspm::Mat rotm2quat(dspm::Mat &R);
/**
* Convert quaternion to Euler angels.
* @param[in] R: quaternion
*
* @return
* - Euler angels 3x1
*/
static dspm::Mat quat2eul(const float q[4]);
/**
* Convert Euler angels to rotation matrix.
* @param[in] xyz: Euler angels
*
* @return
* - rotation matrix 3x3
*/
static dspm::Mat eul2rotm(float xyz[3]);
/**
* Convert rotation matrix to Euler angels.
* @param[in] rotm: rotation matrix
*
* @return
* - Euler angels 3x1
*/
static dspm::Mat rotm2eul(dspm::Mat &rotm);
/**
* Df/dq: Derivative of vector by quaternion.
* @param[in] vector: input vector
* @param[in] quat: quaternion
*
* @return
* - Derivative matrix 3x4
*/
static dspm::Mat dFdq(dspm::Mat &vector, dspm::Mat &quat);
/**
* Df/dq: Derivative of vector by inverted quaternion.
* @param[in] vector: input vector
* @param[in] quat: quaternion
*
* @return
* - Derivative matrix 3x4
*/
static dspm::Mat dFdq_inv(dspm::Mat &vector, dspm::Mat &quat);
/**
* Make skew-symmetric matrix of vector.
* @param[in] w: source vector
*
* @return
* - skew-symmetric matrix 4x4
*/
static dspm::Mat SkewSym4x4(float *w);
// q product
// Rl = [q(1) - q(2) - q(3) - q(4); ...
// q(2) q(1) - q(4) q(3); ...
// q(3) q(4) q(1) - q(2); ...
// q(4) - q(3) q(2) q(1); ...
/**
* Make right quaternion-product matrices.
* @param[in] q: source quaternion
*
* @return
* - right quaternion-product matrix 4x4
*/
static dspm::Mat qProduct(float *q);
};
#endif // _ekf_h_

View File

@ -0,0 +1,83 @@
// Copyright 2020-2021 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef _ekf_imu13states_H_
#define _ekf_imu13states_H_
#include "ekf.h"
/**
* @brief This class is used to process and calculate attitude from imu sensors.
*
* The class use state vector with 13 follows values
* X[0..3] - attitude quaternion
* X[4..6] - gyroscope bias error, rad/sec
* X[7..9] - magnetometer vector value - magn_ampl
* X[10..12] - magnetometer offset value - magn_offset
*
* where, reference magnetometer value = magn_ampl*rotation_matrix' + magn_offset
*/
class ekf_imu13states: public ekf {
public:
ekf_imu13states();
virtual ~ekf_imu13states();
virtual void Init();
// Method calculates Xdot values depends on U
// U - gyroscope values in radian per seconds (rad/sec)
virtual dspm::Mat StateXdot(dspm::Mat &x, float *u);
virtual void LinearizeFG(dspm::Mat &x, float *u);
// Methods for tests only.
void Test();
void TestFull(bool enable_att);
// Initial reference valies magnetometer and accelerometer
dspm::Mat mag0;
dspm::Mat accel0;
int NUMU; // number of control measurements
/**
* Update part of system state by reference measurements accelerometer and magnetometer.
* Only attitude and gyro bias will be updated.
* This method should be used as main method after calibration.
*
* @param[in] accel_data: accelerometer measurement vector XYZ in g, where 1 g ~ 9.81 m/s^2
* @param[in] magn_data: magnetometer measurement vector XYZ
* @param[in] R: measurement noise covariance values for diagonal covariance matrix. Then smaller value, then more you trust them.
*/
void UpdateRefMeasurement(float *accel_data, float *magn_data, float R[6]);
/**
* Update full system state by reference measurements accelerometer and magnetometer.
* This method should be used at calibration phase.
*
* @param[in] accel_data: accelerometer measurement vector XYZ in g, where 1 g ~ 9.81 m/s^2
* @param[in] magn_data: magnetometer measurement vector XYZ
* @param[in] R: measurement noise covariance values for diagonal covariance matrix. Then smaller value, then more you trust them.
*/
void UpdateRefMeasurementMagn(float *accel_data, float *magn_data, float R[6]);
/**
* Update system state by reference measurements accelerometer, magnetometer and attitude quaternion.
* This method could be used when system on constant state or in initialization phase.
* @param[in] accel_data: accelerometer measurement vector XYZ in g, where 1 g ~ 9.81 m/s^2
* @param[in] magn_data: magnetometer measurement vector XYZ
* @param[in] attitude: attitude quaternion
* @param[in] R: measurement noise covariance values for diagonal covariance matrix. Then smaller value, then more you trust them.
*/
void UpdateRefMeasurement(float *accel_data, float *magn_data, float *attitude, float R[10]);
};
#endif // _ekf_imu13states_H_

View File

@ -52,6 +52,27 @@ public:
* @param[in] src: source matrix
*/
Mat(const Mat &src);
/**
* Make copy of matrix.
* @param[in] src: source matrix
* @param[in] row_pos: start row position of destination matrix
* @param[in] col_pos: start col position of destination matrix
*/
void Copy(const Mat &src, int row_pos, int col_pos);
/**
* Make copy of matrix.
* @param[in] row_start: start row position of source matrix to copy
* @param[in] row_size: size of wor elements of source matrix to copy
* @param[in] col_start: start col position of source matrix to copy
* @param[in] col_size: size of wor elements of source matrix to copy
*
* @return
* - result matrix size row_size x col_size
*/
Mat Get(int row_start, int row_size, int col_start, int col_size);
/**
* Copy operator
*
@ -356,10 +377,18 @@ public:
int length; /*!< Total amount of data in data array*/
static float abs_tol; /*!< Max acceptable absolute tolerance*/
/**
* Find determinant
* @param[in] n: element number in first row
*
* @return
* - determinant value
*/
float det(int n);
private:
Mat cofactor(int row, int col, int n);
float det(int n);
Mat adjoint();
Mat cofactor(int row, int col, int n);
Mat adjoint();
void allocate(); // Allocate buffer
Mat expHelper(const Mat &m, int num);

View File

@ -91,9 +91,10 @@ namespace dl
typedef enum
{
CONSTANT,
EDGE,
REFLECT,
SYMMETRIC,
PADDING_EMPTY,
PADDING_CONSTANT,
PADDING_EDGE,
PADDING_REFLECT,
PADDING_SYMMETRIC,
} padding_mode_t;
} // namespace dl

View File

@ -72,7 +72,7 @@ namespace dl
{
this->output = new Tensor<feature_t>;
}
this->output->set_exponent(this->output_exponent);
this->output->set_exponent(input0.exponent);
this->output->set_shape(this->output_shape);
this->output->free_element();
}

View File

@ -0,0 +1,169 @@
#pragma once
#include "dl_nn_pad.hpp"
#include "dl_layer_base.hpp"
namespace dl
{
namespace layer
{
/**
* @brief Pad.
*
* @tparam feature_t supports int16_t and int8_t,
* - int16_t: stands for operation in int16_t quantize
* - int8_t: stands for operation in int8_t quantize
*/
template <typename feature_t>
class Pad : public Layer
{
private:
std::vector<int> paddings;
std::vector<feature_t> constant_values;
padding_mode_t mode;
Tensor<feature_t> *output; /*<! output ptr of Pad >*/
std::vector<int> output_shape; /*<! output shape of Pad >*/
public:
Pad(std::vector<int> paddings,
std::vector<feature_t> constant_values = {0},
padding_mode_t mode = PADDING_CONSTANT,
const char *name = "Pad") : Layer(name),
paddings(paddings),
constant_values(constant_values),
mode(mode)
{
this->output = new Tensor<feature_t>;
}
/**
* @brief Destroy the Pad object.
*
*/
~Pad()
{
if (this->output != NULL)
{
delete this->output;
}
}
/**
* @brief Update output padding and input padding.
*
* @param input as an input
* @param print_shape whether to print the output shape.
*/
void build(Tensor<feature_t> &input, bool print_shape = false)
{
assert(this->paddings.size() > 0);
int input_dims = input.shape.size();
int padding_dims = input_dims * 2;
if (this->paddings.size() == 1)
{
std::vector<int> _paddings(padding_dims, 0);
for (int i = 0; i < padding_dims; ++i)
{
_paddings[i] = this->paddings[0];
}
this->paddings = _paddings;
}
else if (this->paddings.size() == 2)
{
std::vector<int> _paddings(padding_dims, 0);
for (int i = 0; i < input_dims; ++i)
{
_paddings[2 * i] = this->paddings[0];
_paddings[2 * i + 1] = this->paddings[1];
}
this->paddings = _paddings;
}
else
{
assert(this->paddings.size() == padding_dims);
}
if (this->mode == PADDING_CONSTANT)
{
if (this->constant_values.size() == 1)
{
std::vector<feature_t> _constant_values(padding_dims, 0);
for (int i = 0; i < padding_dims; ++i)
{
_constant_values[i] = this->constant_values[0];
}
this->constant_values = _constant_values;
}
else if (this->constant_values.size() == 2)
{
std::vector<feature_t> _constant_values(padding_dims, 0);
for (int i = 0; i < input_dims; ++i)
{
_constant_values[2 * i] = this->constant_values[0];
_constant_values[2 * i + 1] = this->constant_values[1];
}
this->constant_values = _constant_values;
}
else
{
assert(constant_values.size() == padding_dims);
}
}
this->output_shape = input.shape;
for (int i = 0; i < input_dims; ++i)
{
this->output_shape[i] += (this->paddings[2 * i] + this->paddings[2 * i + 1]);
}
this->output->set_shape(this->output_shape);
this->output->set_exponent(input.exponent);
this->output->free_element();
if (print_shape)
{
std::cout << this->name << " | ";
this->output->print_shape();
}
}
/**
* @brief Get the output
*
* @return Tensor<feature_t>& Pad result
*/
Tensor<feature_t> &get_output()
{
return *this->output;
}
/**
* @brief Call Pad operation
*
* @param input as an input.
* @param autoload_enable one of true or false,
* - true: load input and output from PSRAM to CACHE automatically
* - false: do not
* @param assign_core not effective yet
* @return Pad result
*/
Tensor<feature_t> &call(Tensor<feature_t> &input, const std::vector<int> &assign_core = CONFIG_DEFAULT_ASSIGN_CORE)
{
DL_LOG_LAYER_LATENCY_INIT();
DL_LOG_LAYER_LATENCY_START();
if (this->output->shape != this->output_shape)
{
this->output->set_shape(this->output_shape);
}
this->output->malloc_element();
this->output->set_exponent(input.exponent);
DL_LOG_LAYER_LATENCY_END(this->name, "apply");
DL_LOG_LAYER_LATENCY_START();
nn::pad(*this->output, input, this->paddings, this->constant_values, this->mode, assign_core);
DL_LOG_LAYER_LATENCY_END(this->name, "pad");
return *this->output;
}
};
} // namespace layer
} // namespace dl

View File

@ -0,0 +1,120 @@
#pragma once
#include "dl_constant.hpp"
#include "dl_variable.hpp"
#include "dl_nn.hpp"
namespace dl
{
namespace nn
{
/**
* @brief pad(input)
*
* @tparam feature_t
* @param output as an output
* @param input as an input
* @param paddings number of values padded to the edges of each dim
* @param constant_values used in PADDING_CONSTANT, the values to set the padded values for each dim
* @param mode One of the following: PADDING_EMPTY, PADDING_CONSTANT, PADDING_EDGE, PADDING_REFLECT, PADDING_SYMMETRIC
* @param assign_core not effective yet
*/
template <typename feature_t>
void pad(Tensor<feature_t> &output,
Tensor<feature_t> &input,
std::vector<int> paddings,
std::vector<feature_t> constant_values,
padding_mode_t mode,
const std::vector<int> &assign_core = CONFIG_DEFAULT_ASSIGN_CORE);
/**
* @brief
*
* @tparam feature_t
* @param input as an input
* @param paddings number of values padded to the edges of each dim
* @param constant_values used in PADDING_CONSTANT, the values to set the padded values for each dim
* @param mode One of the following: PADDING_EMPTY, PADDING_CONSTANT, PADDING_EDGE, PADDING_REFLECT, PADDING_SYMMETRIC
* @param assign_core not effective yet
* @return Tensor<feature_t> the padded Tensor
*/
template <typename feature_t>
Tensor<feature_t> pad(Tensor<feature_t> &input,
std::vector<int> paddings,
std::vector<feature_t> constant_values,
padding_mode_t mode,
const std::vector<int> &assign_core = CONFIG_DEFAULT_ASSIGN_CORE)
{
DL_LOG_NN_LATENCY_INIT();
DL_LOG_NN_LATENCY_START();
assert(paddings.size() > 0);
int input_dims = input.shape.size();
int padding_dims = input_dims * 2;
std::vector<int> _paddings(padding_dims, 0);
if (paddings.size() == 1)
{
for (int i = 0; i < padding_dims; ++i)
{
_paddings[i] = paddings[0];
}
}
else if (paddings.size() == 2)
{
for (int i = 0; i < input_dims; ++i)
{
_paddings[2 * i] = paddings[0];
_paddings[2 * i + 1] = paddings[1];
}
}
else
{
assert(paddings.size() == padding_dims);
_paddings = paddings;
}
std::vector<feature_t> _constant_values(padding_dims, 0);
if (mode == PADDING_CONSTANT)
{
if (constant_values.size() == 1)
{
for (int i = 0; i < padding_dims; ++i)
{
_constant_values[i] = constant_values[0];
}
}
else if (constant_values.size() == 2)
{
for (int i = 0; i < input_dims; ++i)
{
_constant_values[2 * i] = constant_values[0];
_constant_values[2 * i + 1] = constant_values[1];
}
}
else
{
assert(constant_values.size() == padding_dims);
_constant_values = constant_values;
}
}
std::vector<int> output_shape = input.shape;
for (int i = 0; i < input_dims; ++i)
{
output_shape[i] += (_paddings[2 * i] + _paddings[2 * i + 1]);
}
Tensor<feature_t> output;
output.set_exponent(input.exponent).set_shape(output_shape).malloc_element();
DL_LOG_NN_LATENCY_END("apply");
DL_LOG_NN_LATENCY_START();
pad(output, input, _paddings, _constant_values, mode, assign_core);
DL_LOG_NN_LATENCY_END("pad");
return output;
}
} // namespace nn
} // namespace dl

View File

@ -71,7 +71,7 @@ namespace dl
}
/**
* @brief
* @brief copy the element of the input Tensor.
*
* @param input an input Tensor
* @param deep one of true or false
@ -258,6 +258,56 @@ namespace dl
return this->element[index];
}
/**
* @brief Set the all the element to value.
*
* @param value target value
* @return Tensor<T>& self
*/
Tensor<T> &set_value(T value);
/**
* @brief Set the the element to value
*
* @param value target value, it will be broadcast automatically.
* @return Tensor<T>& self
*/
Tensor<T> &set_value(Tensor<T> &value);
/**
* @brief Set the sliced element to value
*
* @param axis_index_range range of slices
* @param value target value
* @return Tensor<T>& self
*/
Tensor<T> &set_value(std::vector<int> axis_index_range, T value);
/**
* @brief Set the sliced element to value
*
* @param axis_index_range range of slices
* @param value target value, it will be broadcast automatically.
* @return Tensor<T>& self
*/
Tensor<T> &set_value(std::vector<int> axis_index_range, Tensor<T> &value);
/**
* @brief Extracts a slice from the Tensor.
*
* @param axis_index_range range of slices
* @return Tensor<T> output
*/
Tensor<T> slice(std::vector<int> axis_index_range);
/**
* @brief Reverses specific dims of the tensor.
*
* @param axis The dims to be reversed
* @return Tensor<T>&
*/
Tensor<T> &reverse(std::vector<int> axis);
/**
* @brief Get the size of Tensor.
*
@ -491,5 +541,16 @@ namespace dl
return *this;
}
}
static Tensor<T> arange(int size)
{
Tensor<T> output;
output.set_auto_free(true).set_exponent(0).set_shape({size}).malloc_element();
for (int i = 0; i < size; ++i)
{
output.element[i] = i;
}
return output;
}
};
} // namespace dl

View File

@ -85,6 +85,13 @@ uint8_t phy_dig_reg_backup(bool backup_en, uint32_t *mem_addr);
void phy_freq_mem_backup(bool backup_en, uint32_t *mem);
#endif
#if CONFIG_ESP_PHY_ENABLE_USB
/**
* @brief Enable or disable USB when phy init.
*/
void phy_bbpll_en_usb(bool en);
#endif
#ifdef __cplusplus
}
#endif

View File

@ -4,8 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
// Allow for this warning suppression only in IDF_CI_BUILD
#if !defined(ESP_OPENSSL_SUPPRESS_LEGACY_WARNING) || !defined(IDF_CI_BUILD)
#if !defined(ESP_OPENSSL_SUPPRESS_LEGACY_WARNING)
#warning "OpenSSL component will be removed from ESP-IDF in v5.0, please use esp_tls instead"
#endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tools/sdk/esp32/ld/libmfn.a Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
/* Automatically generated file; DO NOT EDIT */
/* Espressif IoT Development Framework Linker Script */
/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32/sections.ld.in */
/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32/sections.ld.in */
/*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More