├── docs ├── homepage.md └── config.md ├── boards ├── .clang-format ├── DM_MC_01 │ ├── README.md │ ├── Drivers │ │ ├── STM32F4xx_HAL_Driver │ │ │ ├── License.md │ │ │ └── LICENSE.txt │ │ └── CMSIS │ │ │ ├── Device │ │ │ └── ST │ │ │ │ └── STM32F4xx │ │ │ │ └── LICENSE.txt │ │ │ └── Include │ │ │ └── cmsis_version.h │ ├── Middlewares │ │ └── Third_Party │ │ │ └── FreeRTOS │ │ │ └── Source │ │ │ └── LICENSE │ ├── Core │ │ └── Inc │ │ │ ├── gpio.h │ │ │ ├── crc.h │ │ │ ├── rtc.h │ │ │ ├── adc.h │ │ │ ├── i2c.h │ │ │ ├── can.h │ │ │ ├── spi.h │ │ │ ├── dma.h │ │ │ ├── tim.h │ │ │ └── usart.h │ └── DSP │ │ └── Source │ │ └── ControllerFunctions │ │ ├── arm_pid_reset_q15.c │ │ ├── arm_pid_reset_q31.c │ │ └── arm_pid_reset_f32.c ├── DJI_Board_TypeA │ ├── Drivers │ │ ├── CMSIS │ │ │ ├── Device │ │ │ │ └── ST │ │ │ │ │ └── STM32F4xx │ │ │ │ │ └── Include │ │ │ │ │ └── stm32f4xx.h │ │ │ └── Include │ │ │ │ └── cmsis_version.h │ │ └── STM32F4xx_HAL_Driver │ │ │ └── License.md │ ├── Middlewares │ │ └── Third_Party │ │ │ ├── FreeRTOS │ │ │ └── Source │ │ │ │ └── CMSIS_RTOS_V2 │ │ │ │ └── cmsis_os2.c │ │ │ └── FatFs │ │ │ └── src │ │ │ └── integer.h │ ├── FATFS │ │ ├── Target │ │ │ ├── fatfs_platform.c │ │ │ ├── fatfs_platform.h │ │ │ └── sd_diskio.h │ │ └── App │ │ │ ├── fatfs.h │ │ │ └── fatfs.c │ ├── Core │ │ ├── Src │ │ │ └── sys.c │ │ └── Inc │ │ │ ├── gpio.h │ │ │ ├── adc.h │ │ │ ├── i2c.h │ │ │ ├── sdio.h │ │ │ ├── dma.h │ │ │ ├── sys.h │ │ │ ├── can.h │ │ │ ├── spi.h │ │ │ ├── tim.h │ │ │ └── usart.h │ └── DSP │ │ └── Source │ │ └── ControllerFunctions │ │ ├── arm_pid_reset_q15.c │ │ ├── arm_pid_reset_q31.c │ │ └── arm_pid_reset_f32.c └── DJI_Board_TypeC │ ├── Drivers │ ├── CMSIS │ │ ├── Device │ │ │ └── ST │ │ │ │ └── STM32F4xx │ │ │ │ └── LICENSE.txt │ │ └── Include │ │ │ └── cmsis_version.h │ └── STM32F4xx_HAL_Driver │ │ └── LICENSE.txt │ ├── Middlewares │ └── Third_Party │ │ └── FreeRTOS │ │ └── Source │ │ └── LICENSE │ ├── Core │ └── Inc │ │ ├── gpio.h │ │ ├── can.h │ │ ├── i2c.h │ │ ├── spi.h │ │ ├── dma.h │ │ ├── usart.h │ │ └── tim.h │ └── DSP │ └── Source │ └── ControllerFunctions │ ├── arm_pid_reset_q15.c │ ├── arm_pid_reset_q31.c │ └── arm_pid_reset_f32.c ├── shared ├── third_party │ ├── .clang-format │ ├── eigen-3.3.9 │ │ ├── Eigen │ │ │ ├── Eigen │ │ │ ├── src │ │ │ │ ├── Core │ │ │ │ │ ├── util │ │ │ │ │ │ ├── NonMPL2.h │ │ │ │ │ │ └── ReenableStupidWarnings.h │ │ │ │ │ ├── functors │ │ │ │ │ │ └── TernaryFunctors.h │ │ │ │ │ ├── DiagonalProduct.h │ │ │ │ │ ├── arch │ │ │ │ │ │ ├── AVX │ │ │ │ │ │ │ └── TypeCasting.h │ │ │ │ │ │ └── Default │ │ │ │ │ │ │ └── Settings.h │ │ │ │ │ └── SelfCwiseBinaryOp.h │ │ │ │ ├── misc │ │ │ │ │ ├── lapacke_mangling.h │ │ │ │ │ └── RealSvd2x2.h │ │ │ │ └── SparseCore │ │ │ │ │ ├── SparseFuzzy.h │ │ │ │ │ └── SparseRedux.h │ │ │ ├── Dense │ │ │ ├── CMakeLists.txt │ │ │ ├── StdList │ │ │ ├── StdDeque │ │ │ ├── StdVector │ │ │ ├── Householder │ │ │ ├── Sparse │ │ │ ├── Jacobi │ │ │ ├── QtAlignedMalloc │ │ │ ├── MetisSupport │ │ │ ├── PardisoSupport │ │ │ ├── SPQRSupport │ │ │ ├── SparseQR │ │ │ ├── Cholesky │ │ │ ├── QR │ │ │ ├── UmfPackSupport │ │ │ ├── SparseCholesky │ │ │ ├── LU │ │ │ ├── SVD │ │ │ ├── PaStiXSupport │ │ │ └── SparseLU │ │ ├── README.md │ │ ├── .hgeol │ │ ├── COPYING.README │ │ └── COPYING.BSD │ └── MahonyAHRS.h ├── libraries │ ├── filtering.cc │ └── supercap.h └── bsp │ ├── bsp_error_handler.cc │ ├── bsp_laser.cc │ ├── bsp_relay.cc │ └── bsp_laser.h ├── .clang-format ├── examples ├── imu │ ├── visualize_2019a.slx │ ├── magCal.m │ └── CMakeLists.txt ├── usb │ └── CMakeLists.txt ├── laser │ └── CMakeLists.txt ├── oled │ └── CMakeLists.txt ├── sdio │ └── CMakeLists.txt ├── buzzer │ └── CMakeLists.txt ├── fortress │ └── CMakeLists.txt ├── sensor │ └── CMakeLists.txt ├── stepper │ └── CMakeLists.txt ├── supercap │ └── CMakeLists.txt ├── turret │ └── CMakeLists.txt ├── autoaim │ └── CMakeLists.txt ├── brt_encoder │ └── CMakeLists.txt ├── referee │ └── CMakeLists.txt ├── ultrasonic │ └── CMakeLists.txt ├── eigen │ └── CMakeLists.txt ├── chassis │ └── CMakeLists.txt ├── lidar07 │ └── CMakeLists.txt ├── sbus │ └── CMakeLists.txt ├── relay │ └── CMakeLists.txt ├── unitree_motor │ └── CMakeLists.txt ├── can_bridge │ └── CMakeLists.txt ├── steering │ └── CMakeLists.txt ├── protocol │ └── CMakeLists.txt ├── hero │ └── CMakeLists.txt ├── led │ ├── CMakeLists.txt │ └── mc01.cc ├── rtos │ └── CMakeLists.txt ├── dbus │ └── CMakeLists.txt ├── gimbal │ └── CMakeLists.txt └── motor │ └── HERO_SERVO.cc ├── .gitattributes ├── .clangd ├── debug └── OpenOCD │ ├── st-link-v2.cfg │ ├── st-link-v2-1.cfg │ ├── cmsis-dap.cfg │ └── stlink_f4.cfg ├── .github └── workflows │ └── main.yml ├── vehicles ├── CMakeLists.txt ├── Hero │ └── CMakeLists.txt ├── Fortress │ └── CMakeLists.txt ├── Sentry │ └── CMakeLists.txt └── Steering │ ├── CMakeLists.txt │ └── config.md └── CMakeLists.txt /docs/homepage.md: -------------------------------------------------------------------------------- 1 | ## iRM Embedded 2022 Document 2 | 3 | -------------------------------------------------------------------------------- /boards/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /shared/third_party/.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | 5 | ColumnLimit: 0 6 | DerivePointerAlignment: false 7 | --- 8 | -------------------------------------------------------------------------------- /examples/imu/visualize_2019a.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illini-robomaster/iRM_Embedded_2026/HEAD/examples/imu/visualize_2019a.slx -------------------------------------------------------------------------------- /boards/DM_MC_01/README.md: -------------------------------------------------------------------------------- 1 | # IMPORTANT Notes 2 | 3 | ## USART3 is configured manually, Please check the code when modify DM_MC01_general.ioc by STM32CubeMX -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # enforce linux style line endings 2 | * text=lf 3 | 4 | *.c text 5 | *.cc text 6 | *.cpp text 7 | *.h text 8 | *.hpp text 9 | 10 | *.cmake text 11 | *.txt text 12 | -------------------------------------------------------------------------------- /.clangd: -------------------------------------------------------------------------------- 1 | CompileFlags: 2 | CompilationDatabase: build 3 | QueryDriver: [arm-none-eabi-*] 4 | Add: [-ferror-limit=0, -D__weak=__attribute__((weak)), -D__packed=__attribute__((__packed__))] 5 | Remove: [-m*, -f*] -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illini-robomaster/iRM_Embedded_2026/HEAD/boards/DJI_Board_TypeA/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/README.md: -------------------------------------------------------------------------------- 1 | **Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.** 2 | 3 | For more information go to http://eigen.tuxfamily.org/. 4 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/illini-robomaster/iRM_Embedded_2026/HEAD/boards/DJI_Board_TypeA/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/.hgeol: -------------------------------------------------------------------------------- 1 | [patterns] 2 | *.sh = LF 3 | *.MINPACK = CRLF 4 | scripts/*.in = LF 5 | debug/msvc/*.dat = CRLF 6 | debug/msvc/*.natvis = CRLF 7 | unsupported/test/mpreal/*.* = CRLF 8 | ** = native 9 | 10 | [repository] 11 | native = LF 12 | -------------------------------------------------------------------------------- /debug/OpenOCD/st-link-v2.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32F4 discovery board with a single STM32F407VGT6 chip. 2 | # http://www.st.com/internet/evalboard/product/252419.jsp 3 | 4 | set WORKAREASIZE 0x200000 5 | 6 | source [find interface/stlink-v2.cfg] 7 | 8 | source [find target/stm32f4x.cfg] 9 | 10 | reset_config srst_nogate 11 | -------------------------------------------------------------------------------- /debug/OpenOCD/st-link-v2-1.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32F4 discovery board with a single STM32F407VGT6 chip. 2 | # http://www.st.com/internet/evalboard/product/252419.jsp 3 | 4 | set WORKAREASIZE 0x200000 5 | 6 | source [find interface/stlink-v2-1.cfg] 7 | 8 | source [find target/stm32f4x.cfg] 9 | 10 | reset_config srst_nogate 11 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Drivers/STM32F4xx_HAL_Driver/License.md: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 STMicroelectronics 2 | 3 | This software component is licensed by STMicroelectronics under the **BSD-3-Clause** license. You may not use this file except in compliance with this license. You may obtain a copy of the license [here](https://opensource.org/licenses/BSD-3-Clause). -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Drivers/STM32F4xx_HAL_Driver/License.md: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 STMicroelectronics 2 | 3 | This software component is licensed by STMicroelectronics under the **BSD-3-Clause** license. You may not use this file except in compliance with this license. You may obtain a copy of the license [here](https://opensource.org/licenses/BSD-3-Clause). -------------------------------------------------------------------------------- /boards/DM_MC_01/Drivers/CMSIS/Device/ST/STM32F4xx/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This software component is provided to you as part of a software package and 2 | applicable license terms are in the Package_license file. If you received this 3 | software component outside of a package or without applicable license terms, 4 | the terms of the Apache-2.0 license shall apply. 5 | You may obtain a copy of the Apache-2.0 at: 6 | https://opensource.org/licenses/Apache-2.0 7 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Drivers/STM32F4xx_HAL_Driver/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This software component is provided to you as part of a software package and 2 | applicable license terms are in the Package_license file. If you received this 3 | software component outside of a package or without applicable license terms, 4 | the terms of the BSD-3-Clause license shall apply. 5 | You may obtain a copy of the BSD-3-Clause at: 6 | https://opensource.org/licenses/BSD-3-Clause 7 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Drivers/CMSIS/Device/ST/STM32F4xx/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This software component is provided to you as part of a software package and 2 | applicable license terms are in the Package_license file. If you received this 3 | software component outside of a package or without applicable license terms, 4 | the terms of the Apache-2.0 license shall apply. 5 | You may obtain a copy of the Apache-2.0 at: 6 | https://opensource.org/licenses/Apache-2.0 7 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Drivers/STM32F4xx_HAL_Driver/LICENSE.txt: -------------------------------------------------------------------------------- 1 | This software component is provided to you as part of a software package and 2 | applicable license terms are in the Package_license file. If you received this 3 | software component outside of a package or without applicable license terms, 4 | the terms of the BSD-3-Clause license shall apply. 5 | You may obtain a copy of the BSD-3-Clause at: 6 | https://opensource.org/licenses/BSD-3-Clause 7 | -------------------------------------------------------------------------------- /docs/config.md: -------------------------------------------------------------------------------- 1 | # Configurations 2 | ## UART Configurations 3 | | | Type A | Type C | 4 | | ------- | ------- | ----------------------- | 5 | | Dbus | UART1 | UART3 | 6 | | Print | UART8 | UART1 (labeled as UART2) | 7 | | Referee | | UART6 (labeled as UART1) | 8 | | Timer | htim2 | htim5 | 9 | 10 | ## Dbus Channel Map 11 | CH0: R horizontal\ 12 | CH1: R vertical\ 13 | CH2: L horizontal\ 14 | CH3: L vertical 15 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/misc/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/Core/functors/TernaryFunctors.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TERNARY_FUNCTORS_H 11 | #define EIGEN_TERNARY_FUNCTORS_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | //---------- associative ternary functors ---------- 18 | 19 | 20 | 21 | } // end namespace internal 22 | 23 | } // end namespace Eigen 24 | 25 | #endif // EIGEN_TERNARY_FUNCTORS_H 26 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(RegexUtils) 2 | test_escape_string_as_regex() 3 | 4 | file(GLOB Eigen_directory_files "*") 5 | 6 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 7 | 8 | foreach(f ${Eigen_directory_files}) 9 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src") 10 | list(APPEND Eigen_directory_files_to_install ${f}) 11 | endif() 12 | endforeach(f ${Eigen_directory_files}) 13 | 14 | install(FILES 15 | ${Eigen_directory_files_to_install} 16 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel 17 | ) 18 | 19 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h") 20 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 17 | 18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) 19 | 20 | #else 21 | 22 | #include "src/StlSupport/StdList.h" 23 | 24 | #endif 25 | 26 | #endif // EIGEN_STDLIST_MODULE_H 27 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/COPYING.README: -------------------------------------------------------------------------------- 1 | Eigen is primarily MPL2 licensed. See COPYING.MPL2 and these links: 2 | http://www.mozilla.org/MPL/2.0/ 3 | http://www.mozilla.org/MPL/2.0/FAQ.html 4 | 5 | Some files contain third-party code under BSD or LGPL licenses, whence the other 6 | COPYING.* files here. 7 | 8 | All the LGPL code is either LGPL 2.1-only, or LGPL 2.1-or-later. 9 | For this reason, the COPYING.LGPL file contains the LGPL 2.1 text. 10 | 11 | If you want to guarantee that the Eigen code that you are #including is licensed 12 | under the MPL2 and possibly more permissive licenses (like BSD), #define this 13 | preprocessor symbol: 14 | EIGEN_MPL2_ONLY 15 | For example, with most compilers, you could add this to your project CXXFLAGS: 16 | -DEIGEN_MPL2_ONLY 17 | This will cause a compilation error to be generated if you #include any code that is 18 | LGPL licensed. 19 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/StdDeque: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_MODULE_H 12 | #define EIGEN_STDDEQUE_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdDeque.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDDEQUE_MODULE_H 28 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/StdVector: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_MODULE_H 12 | #define EIGEN_STDVECTOR_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 && (EIGEN_MAX_STATIC_ALIGN_BYTES<=16) /* MSVC auto aligns up to 16 bytes in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdVector.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDVECTOR_MODULE_H 28 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/Householder: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 9 | #define EIGEN_HOUSEHOLDER_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Householder_Module Householder module 16 | * This module provides Householder transformations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/Householder/Householder.h" 24 | #include "src/Householder/HouseholderSequence.h" 25 | #include "src/Householder/BlockHouseholder.h" 26 | 27 | #include "src/Core/util/ReenableStupidWarnings.h" 28 | 29 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 30 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 31 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Middlewares/Third_Party/FatFs/src/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _FF_INTEGER 6 | #define _FF_INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | typedef unsigned __int64 QWORD; 13 | 14 | 15 | #else /* Embedded platform */ 16 | 17 | /* These types MUST be 16-bit or 32-bit */ 18 | typedef int INT; 19 | typedef unsigned int UINT; 20 | 21 | /* This type MUST be 8-bit */ 22 | typedef unsigned char BYTE; 23 | 24 | /* These types MUST be 16-bit */ 25 | typedef short SHORT; 26 | typedef unsigned short WORD; 27 | typedef unsigned short WCHAR; 28 | 29 | /* These types MUST be 32-bit */ 30 | typedef long LONG; 31 | typedef unsigned long DWORD; 32 | 33 | /* This type MUST be 64-bit (Remove this for ANSI C (C89) compatibility) */ 34 | typedef unsigned long long QWORD; 35 | 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSE_MODULE_H 9 | #define EIGEN_SPARSE_MODULE_H 10 | 11 | /** \defgroup Sparse_Module Sparse meta-module 12 | * 13 | * Meta-module including all related modules: 14 | * - \ref SparseCore_Module 15 | * - \ref OrderingMethods_Module 16 | * - \ref SparseCholesky_Module 17 | * - \ref SparseLU_Module 18 | * - \ref SparseQR_Module 19 | * - \ref IterativeLinearSolvers_Module 20 | * 21 | \code 22 | #include 23 | \endcode 24 | */ 25 | 26 | #include "SparseCore" 27 | #include "OrderingMethods" 28 | #ifndef EIGEN_MPL2_ONLY 29 | #include "SparseCholesky" 30 | #endif 31 | #include "SparseLU" 32 | #include "SparseQR" 33 | #include "IterativeLinearSolvers" 34 | 35 | #endif // EIGEN_SPARSE_MODULE_H 36 | 37 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_JACOBI_MODULE_H 9 | #define EIGEN_JACOBI_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup Jacobi_Module Jacobi module 16 | * This module provides Jacobi and Givens rotations. 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | * 22 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 23 | * - MatrixBase::applyOnTheLeft() 24 | * - MatrixBase::applyOnTheRight(). 25 | */ 26 | 27 | #include "src/Jacobi/Jacobi.h" 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_JACOBI_MODULE_H 32 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 33 | 34 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/Core/DiagonalProduct.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // Copyright (C) 2007-2009 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_DIAGONALPRODUCT_H 12 | #define EIGEN_DIAGONALPRODUCT_H 13 | 14 | namespace Eigen { 15 | 16 | /** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. 17 | */ 18 | template 19 | template 20 | inline const Product 21 | MatrixBase::operator*(const DiagonalBase &a_diagonal) const 22 | { 23 | return Product(derived(),a_diagonal.derived()); 24 | } 25 | 26 | } // end namespace Eigen 27 | 28 | #endif // EIGEN_DIAGONALPRODUCT_H 29 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QTMALLOC_MODULE_H 9 | #define EIGEN_QTMALLOC_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | void *qMalloc(std::size_t size) 18 | { 19 | return Eigen::internal::aligned_malloc(size); 20 | } 21 | 22 | void qFree(void *ptr) 23 | { 24 | Eigen::internal::aligned_free(ptr); 25 | } 26 | 27 | void *qRealloc(void *ptr, std::size_t size) 28 | { 29 | void* newPtr = Eigen::internal::aligned_malloc(size); 30 | std::memcpy(newPtr, ptr, size); 31 | Eigen::internal::aligned_free(ptr); 32 | return newPtr; 33 | } 34 | 35 | #include "src/Core/util/ReenableStupidWarnings.h" 36 | 37 | #endif 38 | 39 | #endif // EIGEN_QTMALLOC_MODULE_H 40 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 41 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_METISSUPPORT_MODULE_H 9 | #define EIGEN_METISSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | 20 | /** \ingroup Support_modules 21 | * \defgroup MetisSupport_Module MetisSupport module 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 27 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 28 | */ 29 | 30 | 31 | #include "src/MetisSupport/MetisSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_METISSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Middlewares/Third_Party/FreeRTOS/Source/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | Permission is hereby granted, free of charge, to any person obtaining a copy of 3 | this software and associated documentation files (the "Software"), to deal in 4 | the Software without restriction, including without limitation the rights to 5 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 6 | the Software, and to permit persons to whom the Software is furnished to do so, 7 | subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED_2 2 | // "DisableStupidWarnings.h" was included twice recursively: Do not reenable warnings yet! 3 | # undef EIGEN_WARNINGS_DISABLED_2 4 | 5 | #elif defined(EIGEN_WARNINGS_DISABLED) 6 | #undef EIGEN_WARNINGS_DISABLED 7 | 8 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 9 | #ifdef _MSC_VER 10 | #pragma warning( pop ) 11 | #elif defined __INTEL_COMPILER 12 | #pragma warning pop 13 | #elif defined __clang__ 14 | #pragma clang diagnostic pop 15 | #elif defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) 16 | #pragma GCC diagnostic pop 17 | #endif 18 | 19 | #if defined __NVCC__ 20 | // Don't reenable the diagnostic messages, as it turns out these messages need 21 | // to be disabled at the point of the template instantiation (i.e the user code) 22 | // otherwise they'll be triggered by nvcc. 23 | // #pragma diag_default code_is_unreachable 24 | // #pragma diag_default initialization_not_reachable 25 | // #pragma diag_default 2651 26 | // #pragma diag_default 2653 27 | #endif 28 | 29 | #endif 30 | 31 | #endif // EIGEN_WARNINGS_DISABLED 32 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Middlewares/Third_Party/FreeRTOS/Source/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | Permission is hereby granted, free of charge, to any person obtaining a copy of 3 | this software and associated documentation files (the "Software"), to deal in 4 | the Software without restriction, including without limitation the rights to 5 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 6 | the Software, and to permit persons to whom the Software is furnished to do so, 7 | subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | 19 | -------------------------------------------------------------------------------- /shared/libraries/filtering.cc: -------------------------------------------------------------------------------- 1 | #include "filtering.h" 2 | #include "controller.h" 3 | #include "utils.h" 4 | 5 | /* Designed for ANGLE!!! */ 6 | 7 | KalmanFilter::KalmanFilter(float init_x, float init_t) : FilterBase() { 8 | xhat = init_x; 9 | xhatminus = init_x; 10 | last_x = init_x; 11 | last_t = init_t; 12 | } 13 | 14 | void KalmanFilter::register_state(float input, float timestamp) { 15 | last_x = input; 16 | last_t = timestamp; 17 | 18 | // Wrap xhat and xhatminus 19 | if (abs(xhat + 2 * PI - input) < abs(xhat - input)) { 20 | xhat += 2 * PI; 21 | xhatminus += 2 * PI; 22 | } else if (abs(xhat - 2 * PI - input) < abs(xhat - input)) { 23 | xhat -= 2 * PI; 24 | xhatminus -= 2 * PI; 25 | } 26 | } 27 | 28 | float KalmanFilter::iter_and_get_estimation() { 29 | xhatminus = A * xhat + B; 30 | Pminus = A * P * A + Q; 31 | 32 | float K = Pminus * H / (H * Pminus * H + R); 33 | 34 | // TODO: use better extrapolation (e.g., exponential decay moving average) 35 | float extrapolation = last_x; 36 | xhat = xhatminus + K * (extrapolation - H * xhatminus); 37 | 38 | return xhat; 39 | } 40 | 41 | float KalmanFilter::get_estimation() { 42 | return xhat; 43 | } 44 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/FATFS/Target/fatfs_platform.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file : fatfs_platform.c 4 | * @brief : fatfs_platform source file 5 | ****************************************************************************** 6 | * @attention 7 | * 8 | *

© Copyright (c) 2023 STMicroelectronics. 9 | * All rights reserved.

10 | * 11 | * This software component is licensed by ST under Ultimate Liberty license 12 | * SLA0044, the "License"; You may not use this file except in compliance with 13 | * the License. You may obtain a copy of the License at: 14 | * www.st.com/SLA0044 15 | * 16 | ****************************************************************************** 17 | */ 18 | #include "fatfs_platform.h" 19 | 20 | uint8_t BSP_PlatformIsDetected(void) { 21 | uint8_t status = SD_PRESENT; 22 | /* Check SD card detect pin */ 23 | if(HAL_GPIO_ReadPin(SD_DETECT_GPIO_PORT, SD_DETECT_PIN) != GPIO_PIN_RESET) 24 | { 25 | status = SD_NOT_PRESENT; 26 | } 27 | /* USER CODE BEGIN 1 */ 28 | /* user code can be inserted here */ 29 | /* USER CODE END 1 */ 30 | return status; 31 | } 32 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/SparseCore/SparseFuzzy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_FUZZY_H 11 | #define EIGEN_SPARSE_FUZZY_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | template 17 | bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const 18 | { 19 | const typename internal::nested_eval::type actualA(derived()); 20 | typename internal::conditional::type, 22 | const PlainObject>::type actualB(other.derived()); 23 | 24 | return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); 25 | } 26 | 27 | } // end namespace Eigen 28 | 29 | #endif // EIGEN_SPARSE_FUZZY_H 30 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: arm build 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | # checkout 14 | - uses: actions/checkout@v4 15 | # cached ARM toolchain 16 | - name: cache ARM toolchain 17 | id: cache-arm 18 | uses: actions/cache@v4 19 | with: 20 | path: ~/arm-toolchain-v10-3 21 | key: ${{ runner.os }}-arm-toolchain 22 | # download ARM toolchain 23 | - name: download ARM toolchain 24 | if: steps.cache-arm.outputs.cache-hit != 'true' 25 | run: | 26 | wget -O ~/gcc-arm-none-eabi.tar.bz2 https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 27 | mkdir ~/arm-toolchain-v10-3 28 | tar -xjf ~/gcc-arm-none-eabi.tar.bz2 --directory ~/arm-toolchain-v10-3 --strip-components=1 29 | - name: add system path 30 | run: echo "~/arm-toolchain-v10-3/bin" >> $GITHUB_PATH # set envrionment variable 31 | - name: cmake 32 | run: | 33 | mkdir build && cd build 34 | cmake -DCMAKE_BUILD_TYPE=Debug .. 35 | - name: build 36 | run: make -j 37 | working-directory: build -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 9 | #define EIGEN_PARDISOSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup PardisoSupport_Module PardisoSupport module 19 | * 20 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. 27 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 28 | * 29 | */ 30 | 31 | #include "src/PardisoSupport/PardisoSupport.h" 32 | 33 | #include "src/Core/util/ReenableStupidWarnings.h" 34 | 35 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 36 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Src/sys.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : SYS.c 4 | * Description : This file provides code for the configuration 5 | * of the SYS instances. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2020 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /* Includes ------------------------------------------------------------------*/ 21 | #include "sys.h" 22 | 23 | /* USER CODE BEGIN 0 */ 24 | 25 | /* USER CODE END 0 */ 26 | 27 | /* SYS init function */ 28 | void MX_SYS_Init(void) 29 | { 30 | 31 | } 32 | 33 | /* USER CODE BEGIN 1 */ 34 | 35 | /* USER CODE END 1 */ 36 | 37 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 38 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 9 | #define EIGEN_SPQRSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "SuiteSparseQR.hpp" 16 | 17 | /** \ingroup Support_modules 18 | * \defgroup SPQRSupport_Module SuiteSparseQR module 19 | * 20 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). 27 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 28 | * 29 | */ 30 | 31 | #include "src/CholmodSupport/CholmodSupport.h" 32 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SPARSEQR_MODULE_H 9 | #define EIGEN_SPARSEQR_MODULE_H 10 | 11 | #include "SparseCore" 12 | #include "OrderingMethods" 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup SparseQR_Module SparseQR module 16 | * \brief Provides QR decomposition for sparse matrices 17 | * 18 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 19 | * The columns of the input matrix should be reordered to limit the fill-in during the 20 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 21 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 22 | * of built-in and external ordering methods. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | * 28 | * 29 | */ 30 | 31 | #include "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseQR/SparseQR.h" 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/FATFS/Target/fatfs_platform.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file : fatfs_platform.h 4 | * @brief : fatfs_platform header file 5 | ****************************************************************************** 6 | * @attention 7 | * 8 | *

© Copyright (c) 2023 STMicroelectronics. 9 | * All rights reserved.

10 | * 11 | * This software component is licensed by ST under Ultimate Liberty license 12 | * SLA0044, the "License"; You may not use this file except in compliance with 13 | * the License. You may obtain a copy of the License at: 14 | * www.st.com/SLA0044 15 | * 16 | ****************************************************************************** 17 | */ 18 | /* Includes ------------------------------------------------------------------*/ 19 | #include "stm32f4xx_hal.h" 20 | /* Defines ------------------------------------------------------------------*/ 21 | #define SD_PRESENT ((uint8_t)0x01) /* also in bsp_driver_sd.h */ 22 | #define SD_NOT_PRESENT ((uint8_t)0x00) /* also in bsp_driver_sd.h */ 23 | #define SD_DETECT_PIN GPIO_PIN_15 24 | #define SD_DETECT_GPIO_PORT GPIOE 25 | /* Prototypes ---------------------------------------------------------------*/ 26 | uint8_t BSP_PlatformIsDetected(void); 27 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_CHOLESKY_MODULE_H 9 | #define EIGEN_CHOLESKY_MODULE_H 10 | 11 | #include "Core" 12 | #include "Jacobi" 13 | 14 | #include "src/Core/util/DisableStupidWarnings.h" 15 | 16 | /** \defgroup Cholesky_Module Cholesky module 17 | * 18 | * 19 | * 20 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 21 | * Those decompositions are also accessible via the following methods: 22 | * - MatrixBase::llt() 23 | * - MatrixBase::ldlt() 24 | * - SelfAdjointView::llt() 25 | * - SelfAdjointView::ldlt() 26 | * 27 | * \code 28 | * #include 29 | * \endcode 30 | */ 31 | 32 | #include "src/Cholesky/LLT.h" 33 | #include "src/Cholesky/LDLT.h" 34 | #ifdef EIGEN_USE_LAPACKE 35 | #ifdef EIGEN_USE_MKL 36 | #include "mkl_lapacke.h" 37 | #else 38 | #include "src/misc/lapacke.h" 39 | #endif 40 | #include "src/Cholesky/LLT_LAPACKE.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_CHOLESKY_MODULE_H 46 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 47 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/Core/arch/AVX/TypeCasting.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TYPE_CASTING_AVX_H 11 | #define EIGEN_TYPE_CASTING_AVX_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | // For now we use SSE to handle integers, so we can't use AVX instructions to cast 18 | // from int to float 19 | template <> 20 | struct type_casting_traits { 21 | enum { 22 | VectorizedCast = 0, 23 | SrcCoeffRatio = 1, 24 | TgtCoeffRatio = 1 25 | }; 26 | }; 27 | 28 | template <> 29 | struct type_casting_traits { 30 | enum { 31 | VectorizedCast = 0, 32 | SrcCoeffRatio = 1, 33 | TgtCoeffRatio = 1 34 | }; 35 | }; 36 | 37 | 38 | 39 | template<> EIGEN_STRONG_INLINE Packet8i pcast(const Packet8f& a) { 40 | return _mm256_cvtps_epi32(a); 41 | } 42 | 43 | template<> EIGEN_STRONG_INLINE Packet8f pcast(const Packet8i& a) { 44 | return _mm256_cvtepi32_ps(a); 45 | } 46 | 47 | } // end namespace internal 48 | 49 | } // end namespace Eigen 50 | 51 | #endif // EIGEN_TYPE_CASTING_AVX_H 52 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Core/Inc/gpio.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file gpio.h 5 | * @brief This file contains all the function prototypes for 6 | * the gpio.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __GPIO_H__ 22 | #define __GPIO_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | /* USER CODE BEGIN Private defines */ 36 | 37 | /* USER CODE END Private defines */ 38 | 39 | void MX_GPIO_Init(void); 40 | 41 | /* USER CODE BEGIN Prototypes */ 42 | 43 | /* USER CODE END Prototypes */ 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif /*__ GPIO_H__ */ 49 | 50 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Core/Inc/gpio.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file gpio.h 5 | * @brief This file contains all the function prototypes for 6 | * the gpio.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __GPIO_H__ 22 | #define __GPIO_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | /* USER CODE BEGIN Private defines */ 36 | 37 | /* USER CODE END Private defines */ 38 | 39 | void MX_GPIO_Init(void); 40 | 41 | /* USER CODE BEGIN Prototypes */ 42 | 43 | /* USER CODE END Prototypes */ 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | #endif /*__ GPIO_H__ */ 49 | 50 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Core/Inc/crc.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file crc.h 5 | * @brief This file contains all the function prototypes for 6 | * the crc.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __CRC_H__ 22 | #define __CRC_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern CRC_HandleTypeDef hcrc; 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | 39 | /* USER CODE END Private defines */ 40 | 41 | void MX_CRC_Init(void); 42 | 43 | /* USER CODE BEGIN Prototypes */ 44 | 45 | /* USER CODE END Prototypes */ 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* __CRC_H__ */ 52 | 53 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Core/Inc/rtc.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file rtc.h 5 | * @brief This file contains all the function prototypes for 6 | * the rtc.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __RTC_H__ 22 | #define __RTC_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern RTC_HandleTypeDef hrtc; 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | 39 | /* USER CODE END Private defines */ 40 | 41 | void MX_RTC_Init(void); 42 | 43 | /* USER CODE BEGIN Prototypes */ 44 | 45 | /* USER CODE END Prototypes */ 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* __RTC_H__ */ 52 | 53 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Core/Inc/adc.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file adc.h 5 | * @brief This file contains all the function prototypes for 6 | * the adc.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __ADC_H__ 22 | #define __ADC_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern ADC_HandleTypeDef hadc1; 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | 39 | /* USER CODE END Private defines */ 40 | 41 | void MX_ADC1_Init(void); 42 | 43 | /* USER CODE BEGIN Prototypes */ 44 | 45 | /* USER CODE END Prototypes */ 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* __ADC_H__ */ 52 | 53 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Core/Inc/i2c.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file i2c.h 5 | * @brief This file contains all the function prototypes for 6 | * the i2c.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __I2C_H__ 22 | #define __I2C_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern I2C_HandleTypeDef hi2c1; 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | 39 | /* USER CODE END Private defines */ 40 | 41 | void MX_I2C1_Init(void); 42 | 43 | /* USER CODE BEGIN Prototypes */ 44 | 45 | /* USER CODE END Prototypes */ 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* __I2C_H__ */ 52 | 53 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/QR: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_QR_MODULE_H 9 | #define EIGEN_QR_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "Cholesky" 14 | #include "Jacobi" 15 | #include "Householder" 16 | 17 | #include "src/Core/util/DisableStupidWarnings.h" 18 | 19 | /** \defgroup QR_Module QR module 20 | * 21 | * 22 | * 23 | * This module provides various QR decompositions 24 | * This module also provides some MatrixBase methods, including: 25 | * - MatrixBase::householderQr() 26 | * - MatrixBase::colPivHouseholderQr() 27 | * - MatrixBase::fullPivHouseholderQr() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/QR/HouseholderQR.h" 35 | #include "src/QR/FullPivHouseholderQR.h" 36 | #include "src/QR/ColPivHouseholderQR.h" 37 | #include "src/QR/CompleteOrthogonalDecomposition.h" 38 | #ifdef EIGEN_USE_LAPACKE 39 | #ifdef EIGEN_USE_MKL 40 | #include "mkl_lapacke.h" 41 | #else 42 | #include "src/misc/lapacke.h" 43 | #endif 44 | #include "src/QR/HouseholderQR_LAPACKE.h" 45 | #include "src/QR/ColPivHouseholderQR_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_QR_MODULE_H 51 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 52 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/UmfPackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 9 | #define EIGEN_UMFPACKSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | } 18 | 19 | /** \ingroup Support_modules 20 | * \defgroup UmfPackSupport_Module UmfPackSupport module 21 | * 22 | * This module provides an interface to the UmfPack library which is part of the suitesparse package. 23 | * It provides the following factorization class: 24 | * - class UmfPackLU: a multifrontal sequential LU factorization. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | * 30 | * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. 31 | * The dependencies depend on how umfpack has been compiled. 32 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. 33 | * 34 | */ 35 | 36 | #include "src/UmfPackSupport/UmfPackSupport.h" 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H 41 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2013 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 11 | #define EIGEN_SPARSECHOLESKY_MODULE_H 12 | 13 | #include "SparseCore" 14 | #include "OrderingMethods" 15 | 16 | #include "src/Core/util/DisableStupidWarnings.h" 17 | 18 | /** 19 | * \defgroup SparseCholesky_Module SparseCholesky module 20 | * 21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. 22 | * Those decompositions are accessible via the following classes: 23 | * - SimplicialLLt, 24 | * - SimplicialLDLt 25 | * 26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #ifdef EIGEN_MPL2_ONLY 34 | #error The SparseCholesky module has nothing to offer in MPL2 only mode 35 | #endif 36 | 37 | #include "src/SparseCholesky/SimplicialCholesky.h" 38 | 39 | #ifndef EIGEN_MPL2_ONLY 40 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 41 | #endif 42 | 43 | #include "src/Core/util/ReenableStupidWarnings.h" 44 | 45 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 46 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Core/Inc/can.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file can.h 5 | * @brief This file contains all the function prototypes for 6 | * the can.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __CAN_H__ 22 | #define __CAN_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern CAN_HandleTypeDef hcan1; 36 | 37 | extern CAN_HandleTypeDef hcan2; 38 | 39 | /* USER CODE BEGIN Private defines */ 40 | 41 | /* USER CODE END Private defines */ 42 | 43 | void MX_CAN1_Init(void); 44 | void MX_CAN2_Init(void); 45 | 46 | /* USER CODE BEGIN Prototypes */ 47 | 48 | /* USER CODE END Prototypes */ 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* __CAN_H__ */ 55 | 56 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Core/Inc/spi.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file spi.h 5 | * @brief This file contains all the function prototypes for 6 | * the spi.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __SPI_H__ 22 | #define __SPI_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern SPI_HandleTypeDef hspi1; 36 | 37 | extern SPI_HandleTypeDef hspi2; 38 | 39 | /* USER CODE BEGIN Private defines */ 40 | 41 | /* USER CODE END Private defines */ 42 | 43 | void MX_SPI1_Init(void); 44 | void MX_SPI2_Init(void); 45 | 46 | /* USER CODE BEGIN Prototypes */ 47 | 48 | /* USER CODE END Prototypes */ 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* __SPI_H__ */ 55 | 56 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Inc/gpio.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file gpio.h 4 | * @brief This file contains all the function prototypes for 5 | * the gpio.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2023 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __GPIO_H__ 21 | #define __GPIO_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Includes ------------------------------------------------------------------*/ 28 | #include "main.h" 29 | 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | /* USER CODE BEGIN Private defines */ 35 | 36 | /* USER CODE END Private defines */ 37 | 38 | void MX_GPIO_Init(void); 39 | 40 | /* USER CODE BEGIN Prototypes */ 41 | 42 | /* USER CODE END Prototypes */ 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif /*__ GPIO_H__ */ 48 | 49 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 50 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Core/Inc/can.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file can.h 5 | * @brief This file contains all the function prototypes for 6 | * the can.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __CAN_H__ 22 | #define __CAN_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern CAN_HandleTypeDef hcan1; 36 | 37 | extern CAN_HandleTypeDef hcan2; 38 | 39 | /* USER CODE BEGIN Private defines */ 40 | 41 | /* USER CODE END Private defines */ 42 | 43 | void MX_CAN1_Init(void); 44 | void MX_CAN2_Init(void); 45 | 46 | /* USER CODE BEGIN Prototypes */ 47 | 48 | /* USER CODE END Prototypes */ 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* __CAN_H__ */ 55 | 56 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Core/Inc/i2c.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file i2c.h 5 | * @brief This file contains all the function prototypes for 6 | * the i2c.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __I2C_H__ 22 | #define __I2C_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern I2C_HandleTypeDef hi2c2; 36 | 37 | extern I2C_HandleTypeDef hi2c3; 38 | 39 | /* USER CODE BEGIN Private defines */ 40 | 41 | /* USER CODE END Private defines */ 42 | 43 | void MX_I2C2_Init(void); 44 | void MX_I2C3_Init(void); 45 | 46 | /* USER CODE BEGIN Prototypes */ 47 | 48 | /* USER CODE END Prototypes */ 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* __I2C_H__ */ 55 | 56 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Core/Inc/spi.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file spi.h 5 | * @brief This file contains all the function prototypes for 6 | * the spi.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __SPI_H__ 22 | #define __SPI_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern SPI_HandleTypeDef hspi1; 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | extern DMA_HandleTypeDef hdma_spi1_rx; 39 | extern DMA_HandleTypeDef hdma_spi1_tx; 40 | /* USER CODE END Private defines */ 41 | 42 | void MX_SPI1_Init(void); 43 | 44 | /* USER CODE BEGIN Prototypes */ 45 | 46 | /* USER CODE END Prototypes */ 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __SPI_H__ */ 53 | 54 | -------------------------------------------------------------------------------- /vehicles/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | add_subdirectory(Fortress) 22 | add_subdirectory(Sentry) 23 | add_subdirectory(Steering) 24 | add_subdirectory(Hero) 25 | -------------------------------------------------------------------------------- /examples/imu/magCal.m: -------------------------------------------------------------------------------- 1 | %--------------------------------------------------------------------------% 2 | % % 3 | % Copyright (C) 2023 RoboMaster. % 4 | % Illini RoboMaster @ University of Illinois at Urbana-Champaign % 5 | % % 6 | % This program is free software: you can redistribute it and/or modify % 7 | % it under the terms of the GNU General Public License as published by % 8 | % the Free Software Foundation, either version 3 of the License, or % 9 | % (at your option) any later version. % 10 | % % 11 | % This program is distributed in the hope that it will be useful, % 12 | % but WITHOUT ANY WARRANTY; without even the implied warranty of % 13 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % 14 | % GNU General Public License for more details. % 15 | % % 16 | % You should have received a copy of the GNU General Public License % 17 | % along with this program. If not, see . % 18 | % % 19 | %--------------------------------------------------------------------------% 20 | 21 | magData = squeeze(out.mag); 22 | [A,b,exp] = magcal(magData'); 23 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Core/Inc/dma.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file dma.h 5 | * @brief This file contains all the function prototypes for 6 | * the dma.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __DMA_H__ 22 | #define __DMA_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* DMA memory to memory transfer handles -------------------------------------*/ 32 | 33 | /* USER CODE BEGIN Includes */ 34 | 35 | /* USER CODE END Includes */ 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | 39 | /* USER CODE END Private defines */ 40 | 41 | void MX_DMA_Init(void); 42 | 43 | /* USER CODE BEGIN Prototypes */ 44 | void RM_DMA_IRQHandler(SPI_HandleTypeDef* hspi); 45 | /* USER CODE END Prototypes */ 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* __DMA_H__ */ 52 | 53 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/COPYING.BSD: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Intel Corporation. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of Intel Corporation nor the names of its contributors may 13 | be used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ -------------------------------------------------------------------------------- /vehicles/Hero/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(Hero ASM C CXX) 22 | 23 | irm_add_arm_executable(Hero 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | 27 | -------------------------------------------------------------------------------- /vehicles/Fortress/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(Fortress ASM C CXX) 22 | 23 | irm_add_arm_executable(Fortress 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/usb/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_usb ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeA 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/laser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_laser ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/oled/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_oled ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/sdio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_sdio ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeA 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/buzzer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_buzzer ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/fortress/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_fortress ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/sensor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_sensor ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/stepper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_stepper ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/supercap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_supercap ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/turret/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_turret ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeA 25 | SOURCES turret.cc) 26 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Inc/adc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file adc.h 4 | * @brief This file contains all the function prototypes for 5 | * the adc.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2023 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __ADC_H__ 21 | #define __ADC_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Includes ------------------------------------------------------------------*/ 28 | #include "main.h" 29 | 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | extern ADC_HandleTypeDef hadc1; 35 | 36 | /* USER CODE BEGIN Private defines */ 37 | 38 | /* USER CODE END Private defines */ 39 | 40 | void MX_ADC1_Init(void); 41 | 42 | /* USER CODE BEGIN Prototypes */ 43 | 44 | /* USER CODE END Prototypes */ 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* __ADC_H__ */ 51 | 52 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 53 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Inc/i2c.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file i2c.h 4 | * @brief This file contains all the function prototypes for 5 | * the i2c.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2023 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __I2C_H__ 21 | #define __I2C_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Includes ------------------------------------------------------------------*/ 28 | #include "main.h" 29 | 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | extern I2C_HandleTypeDef hi2c2; 35 | 36 | /* USER CODE BEGIN Private defines */ 37 | 38 | /* USER CODE END Private defines */ 39 | 40 | void MX_I2C2_Init(void); 41 | 42 | /* USER CODE BEGIN Prototypes */ 43 | 44 | /* USER CODE END Prototypes */ 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* __I2C_H__ */ 51 | 52 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 53 | -------------------------------------------------------------------------------- /examples/autoaim/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2021 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_autoaim ASM C CXX) 22 | 23 | #irm_add_arm_executable(${PROJECT_NAME} 24 | # TARGET DJI_Board_TypeC 25 | # SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Inc/sdio.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file sdio.h 4 | * @brief This file contains all the function prototypes for 5 | * the sdio.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2023 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __SDIO_H__ 21 | #define __SDIO_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Includes ------------------------------------------------------------------*/ 28 | #include "main.h" 29 | 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | extern SD_HandleTypeDef hsd; 35 | 36 | /* USER CODE BEGIN Private defines */ 37 | 38 | /* USER CODE END Private defines */ 39 | 40 | void MX_SDIO_SD_Init(void); 41 | 42 | /* USER CODE BEGIN Prototypes */ 43 | 44 | /* USER CODE END Prototypes */ 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* __SDIO_H__ */ 51 | 52 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 53 | -------------------------------------------------------------------------------- /examples/brt_encoder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_brt_encoder ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeA 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/referee/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_referee ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | -------------------------------------------------------------------------------- /examples/ultrasonic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_ultrasonic ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeA 25 | SOURCES main.cc) 26 | 27 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/LU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_LU_MODULE_H 9 | #define EIGEN_LU_MODULE_H 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | /** \defgroup LU_Module LU module 16 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 17 | * This module defines the following MatrixBase methods: 18 | * - MatrixBase::inverse() 19 | * - MatrixBase::determinant() 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/misc/Kernel.h" 27 | #include "src/misc/Image.h" 28 | #include "src/LU/FullPivLU.h" 29 | #include "src/LU/PartialPivLU.h" 30 | #ifdef EIGEN_USE_LAPACKE 31 | #ifdef EIGEN_USE_MKL 32 | #include "mkl_lapacke.h" 33 | #else 34 | #include "src/misc/lapacke.h" 35 | #endif 36 | #include "src/LU/PartialPivLU_LAPACKE.h" 37 | #endif 38 | #include "src/LU/Determinant.h" 39 | #include "src/LU/InverseImpl.h" 40 | 41 | // Use the SSE optimized version whenever possible. At the moment the 42 | // SSE version doesn't compile when AVX is enabled 43 | #if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX 44 | #include "src/LU/arch/Inverse_SSE.h" 45 | #endif 46 | 47 | #include "src/Core/util/ReenableStupidWarnings.h" 48 | 49 | #endif // EIGEN_LU_MODULE_H 50 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 51 | -------------------------------------------------------------------------------- /examples/eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_eigen ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeA 25 | SOURCES typeA.cc 26 | DEPENDS eigen3) 27 | -------------------------------------------------------------------------------- /debug/OpenOCD/cmsis-dap.cfg: -------------------------------------------------------------------------------- 1 | 2 | # **************************************************************************** 3 | # * * 4 | # * Copyright (C) 2023 RoboMaster. * 5 | # * Illini RoboMaster @ University of Illinois at Urbana-Champaign * 6 | # * * 7 | # * This program is free software: you can redistribute it and/or modify * 8 | # * it under the terms of the GNU General Public License as published by * 9 | # * the Free Software Foundation, either version 3 of the License, or * 10 | # * (at your option) any later version. * 11 | # * * 12 | # * This program is distributed in the hope that it will be useful, * 13 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | # * GNU General Public License for more details. * 16 | # * * 17 | # * You should have received a copy of the GNU General Public License * 18 | # * along with this program. If not, see . * 19 | # * * 20 | # **************************************************************************** 21 | 22 | source [find interface/cmsis-dap.cfg] 23 | source [find target/stm32f4x.cfg] -------------------------------------------------------------------------------- /debug/OpenOCD/stlink_f4.cfg: -------------------------------------------------------------------------------- 1 | 2 | # **************************************************************************** 3 | # * * 4 | # * Copyright (C) 2023 RoboMaster. * 5 | # * Illini RoboMaster @ University of Illinois at Urbana-Champaign * 6 | # * * 7 | # * This program is free software: you can redistribute it and/or modify * 8 | # * it under the terms of the GNU General Public License as published by * 9 | # * the Free Software Foundation, either version 3 of the License, or * 10 | # * (at your option) any later version. * 11 | # * * 12 | # * This program is distributed in the hope that it will be useful, * 13 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | # * GNU General Public License for more details. * 16 | # * * 17 | # * You should have received a copy of the GNU General Public License * 18 | # * along with this program. If not, see . * 19 | # * * 20 | # **************************************************************************** 21 | 22 | source [find interface/stlink.cfg] 23 | source [find target/stm32f4x.cfg] 24 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/FATFS/App/fatfs.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file fatfs.h 4 | * @brief Header for fatfs applications 5 | ****************************************************************************** 6 | * @attention 7 | * 8 | *

© Copyright (c) 2023 STMicroelectronics. 9 | * All rights reserved.

10 | * 11 | * This software component is licensed by ST under Ultimate Liberty license 12 | * SLA0044, the "License"; You may not use this file except in compliance with 13 | * the License. You may obtain a copy of the License at: 14 | * www.st.com/SLA0044 15 | * 16 | ****************************************************************************** 17 | */ 18 | 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __fatfs_H 21 | #define __fatfs_H 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #include "ff.h" 27 | #include "ff_gen_drv.h" 28 | #include "sd_diskio.h" /* defines SD_Driver as external */ 29 | 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | extern uint8_t retSD; /* Return value for SD */ 35 | extern char SDPath[4]; /* SD logical drive path */ 36 | extern FATFS SDFatFS; /* File system object for SD logical drive */ 37 | extern FIL SDFile; /* File object for SD */ 38 | 39 | void MX_FATFS_Init(void); 40 | 41 | /* USER CODE BEGIN Prototypes */ 42 | 43 | /* USER CODE END Prototypes */ 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | #endif /*__fatfs_H */ 48 | 49 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 50 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Inc/dma.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file dma.h 4 | * @brief This file contains all the function prototypes for 5 | * the dma.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2023 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __DMA_H__ 21 | #define __DMA_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Includes ------------------------------------------------------------------*/ 28 | #include "main.h" 29 | 30 | /* DMA memory to memory transfer handles -------------------------------------*/ 31 | 32 | /* USER CODE BEGIN Includes */ 33 | 34 | /* USER CODE END Includes */ 35 | 36 | /* USER CODE BEGIN Private defines */ 37 | 38 | /* USER CODE END Private defines */ 39 | 40 | void MX_DMA_Init(void); 41 | 42 | /* USER CODE BEGIN Prototypes */ 43 | 44 | /* USER CODE END Prototypes */ 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* __DMA_H__ */ 51 | 52 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 53 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Inc/sys.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : SYS.h 4 | * Description : This file provides code for the configuration 5 | * of the SYS instances. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2020 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __sys_H 21 | #define __sys_H 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | /* Includes ------------------------------------------------------------------*/ 27 | #include "main.h" 28 | 29 | /* USER CODE BEGIN Includes */ 30 | 31 | /* USER CODE END Includes */ 32 | 33 | /* USER CODE BEGIN Private defines */ 34 | 35 | /* USER CODE END Private defines */ 36 | 37 | void MX_SYS_Init(void); 38 | 39 | /* USER CODE BEGIN Prototypes */ 40 | 41 | /* USER CODE END Prototypes */ 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif /*__ sys_H */ 47 | 48 | /** 49 | * @} 50 | */ 51 | 52 | /** 53 | * @} 54 | */ 55 | 56 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 57 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Inc/can.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file can.h 4 | * @brief This file contains all the function prototypes for 5 | * the can.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2023 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __CAN_H__ 21 | #define __CAN_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Includes ------------------------------------------------------------------*/ 28 | #include "main.h" 29 | 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | extern CAN_HandleTypeDef hcan1; 35 | extern CAN_HandleTypeDef hcan2; 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | 39 | /* USER CODE END Private defines */ 40 | 41 | void MX_CAN1_Init(void); 42 | void MX_CAN2_Init(void); 43 | 44 | /* USER CODE BEGIN Prototypes */ 45 | 46 | /* USER CODE END Prototypes */ 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __CAN_H__ */ 53 | 54 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 55 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Inc/spi.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file spi.h 4 | * @brief This file contains all the function prototypes for 5 | * the spi.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2023 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __SPI_H__ 21 | #define __SPI_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Includes ------------------------------------------------------------------*/ 28 | #include "main.h" 29 | 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | extern SPI_HandleTypeDef hspi1; 35 | extern SPI_HandleTypeDef hspi5; 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | 39 | /* USER CODE END Private defines */ 40 | 41 | void MX_SPI1_Init(void); 42 | void MX_SPI5_Init(void); 43 | 44 | /* USER CODE BEGIN Prototypes */ 45 | 46 | /* USER CODE END Prototypes */ 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __SPI_H__ */ 53 | 54 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 55 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Core/Inc/dma.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file dma.h 5 | * @brief This file contains all the function prototypes for 6 | * the dma.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __DMA_H__ 22 | #define __DMA_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* DMA memory to memory transfer handles -------------------------------------*/ 32 | 33 | /* USER CODE BEGIN Includes */ 34 | 35 | /* USER CODE END Includes */ 36 | 37 | /* USER CODE BEGIN Private defines */ 38 | 39 | /* USER CODE END Private defines */ 40 | 41 | void MX_DMA_Init(void); 42 | 43 | /* USER CODE BEGIN Prototypes */ 44 | void RM_DMA_SPI_IRQHandler(SPI_HandleTypeDef* hspi); 45 | void RM_DMA_I2C_IRQHandler(I2C_HandleTypeDef * hi2c); 46 | void MX_DMA_USART3_INIT(void); 47 | /* USER CODE END Prototypes */ 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* __DMA_H__ */ 54 | 55 | -------------------------------------------------------------------------------- /vehicles/Sentry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(Sentry ASM C CXX) 22 | 23 | irm_add_arm_executable(Sentry 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | 27 | irm_add_arm_executable(Sentry_base 28 | TARGET DJI_Board_TypeC 29 | SOURCES base_task.cc) 30 | -------------------------------------------------------------------------------- /vehicles/Steering/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(Steering ASM C CXX) 22 | 23 | irm_add_arm_executable(Steering_chassis 24 | TARGET DJI_Board_TypeC 25 | SOURCES chassis.cc) 26 | 27 | irm_add_arm_executable(Steering_gimbal 28 | TARGET DJI_Board_TypeC 29 | SOURCES gimbal.cc) 30 | -------------------------------------------------------------------------------- /examples/chassis/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_chassis ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeA 25 | SOURCES main.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_typeC 28 | TARGET DJI_Board_TypeC 29 | SOURCES typeC.cc) -------------------------------------------------------------------------------- /examples/lidar07/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_lidar07 ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME}_uart 24 | TARGET DJI_Board_TypeA 25 | SOURCES uart.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_i2c 28 | TARGET DJI_Board_TypeC 29 | SOURCES i2c.cc) 30 | -------------------------------------------------------------------------------- /examples/sbus/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_sbus ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_mc01 28 | TARGET DM_MC_01 29 | SOURCES mc01.cc) 30 | 31 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Core/Inc/usart.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file usart.h 5 | * @brief This file contains all the function prototypes for 6 | * the usart.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __USART_H__ 22 | #define __USART_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern UART_HandleTypeDef huart1; 36 | 37 | extern UART_HandleTypeDef huart3; 38 | 39 | extern UART_HandleTypeDef huart6; 40 | 41 | /* USER CODE BEGIN Private defines */ 42 | 43 | /* USER CODE END Private defines */ 44 | 45 | void MX_USART1_UART_Init(void); 46 | void MX_USART3_UART_Init(void); 47 | void MX_USART6_UART_Init(void); 48 | 49 | /* USER CODE BEGIN Prototypes */ 50 | void RM_UART_IRQHandler(UART_HandleTypeDef *huart); 51 | /* USER CODE END Prototypes */ 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* __USART_H__ */ 58 | 59 | -------------------------------------------------------------------------------- /boards/DM_MC_01/DSP/Source/ControllerFunctions/arm_pid_reset_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Project: CMSIS DSP Library 3 | * Title: arm_pid_reset_q15.c 4 | * Description: Q15 PID Control reset function 5 | * 6 | * $Date: 27. January 2017 7 | * $Revision: V.1.5.1 8 | * 9 | * Target Processor: Cortex-M cores 10 | * -------------------------------------------------------------------- */ 11 | /* 12 | * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 13 | * 14 | * SPDX-License-Identifier: Apache-2.0 15 | * 16 | * Licensed under the Apache License, Version 2.0 (the License); you may 17 | * not use this file except in compliance with the License. 18 | * You may obtain a copy of the License at 19 | * 20 | * www.apache.org/licenses/LICENSE-2.0 21 | * 22 | * Unless required by applicable law or agreed to in writing, software 23 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | * See the License for the specific language governing permissions and 26 | * limitations under the License. 27 | */ 28 | 29 | #include "arm_math.h" 30 | 31 | /** 32 | * @addtogroup PID 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Reset function for the Q15 PID Control. 38 | * @param[in] *S Instance pointer of PID control data structure. 39 | * @return none. 40 | * \par Description: 41 | * The function resets the state buffer to zeros. 42 | */ 43 | void arm_pid_reset_q15( 44 | arm_pid_instance_q15 * S) 45 | { 46 | /* Reset state to zero, The size will be always 3 samples */ 47 | memset(S->state, 0, 3U * sizeof(q15_t)); 48 | } 49 | 50 | /** 51 | * @} end of PID group 52 | */ 53 | -------------------------------------------------------------------------------- /examples/relay/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_relay ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME}_TypeA 24 | TARGET DJI_Board_TypeA 25 | SOURCES TypeA.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_TypeC 28 | TARGET DJI_Board_TypeC 29 | SOURCES TypeC.cc) 30 | 31 | -------------------------------------------------------------------------------- /examples/unitree_motor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2023 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_unitree_motor ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME}_typeC 24 | TARGET DJI_Board_TypeC 25 | SOURCES typeC.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_mc01 28 | TARGET DM_MC_01 29 | SOURCES mc01.cc) 30 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/DSP/Source/ControllerFunctions/arm_pid_reset_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Project: CMSIS DSP Library 3 | * Title: arm_pid_reset_q15.c 4 | * Description: Q15 PID Control reset function 5 | * 6 | * $Date: 27. January 2017 7 | * $Revision: V.1.5.1 8 | * 9 | * Target Processor: Cortex-M cores 10 | * -------------------------------------------------------------------- */ 11 | /* 12 | * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 13 | * 14 | * SPDX-License-Identifier: Apache-2.0 15 | * 16 | * Licensed under the Apache License, Version 2.0 (the License); you may 17 | * not use this file except in compliance with the License. 18 | * You may obtain a copy of the License at 19 | * 20 | * www.apache.org/licenses/LICENSE-2.0 21 | * 22 | * Unless required by applicable law or agreed to in writing, software 23 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | * See the License for the specific language governing permissions and 26 | * limitations under the License. 27 | */ 28 | 29 | #include "arm_math.h" 30 | 31 | /** 32 | * @addtogroup PID 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Reset function for the Q15 PID Control. 38 | * @param[in] *S Instance pointer of PID control data structure. 39 | * @return none. 40 | * \par Description: 41 | * The function resets the state buffer to zeros. 42 | */ 43 | void arm_pid_reset_q15( 44 | arm_pid_instance_q15 * S) 45 | { 46 | /* Reset state to zero, The size will be always 3 samples */ 47 | memset(S->state, 0, 3U * sizeof(q15_t)); 48 | } 49 | 50 | /** 51 | * @} end of PID group 52 | */ 53 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/DSP/Source/ControllerFunctions/arm_pid_reset_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Project: CMSIS DSP Library 3 | * Title: arm_pid_reset_q15.c 4 | * Description: Q15 PID Control reset function 5 | * 6 | * $Date: 27. January 2017 7 | * $Revision: V.1.5.1 8 | * 9 | * Target Processor: Cortex-M cores 10 | * -------------------------------------------------------------------- */ 11 | /* 12 | * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 13 | * 14 | * SPDX-License-Identifier: Apache-2.0 15 | * 16 | * Licensed under the Apache License, Version 2.0 (the License); you may 17 | * not use this file except in compliance with the License. 18 | * You may obtain a copy of the License at 19 | * 20 | * www.apache.org/licenses/LICENSE-2.0 21 | * 22 | * Unless required by applicable law or agreed to in writing, software 23 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | * See the License for the specific language governing permissions and 26 | * limitations under the License. 27 | */ 28 | 29 | #include "arm_math.h" 30 | 31 | /** 32 | * @addtogroup PID 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Reset function for the Q15 PID Control. 38 | * @param[in] *S Instance pointer of PID control data structure. 39 | * @return none. 40 | * \par Description: 41 | * The function resets the state buffer to zeros. 42 | */ 43 | void arm_pid_reset_q15( 44 | arm_pid_instance_q15 * S) 45 | { 46 | /* Reset state to zero, The size will be always 3 samples */ 47 | memset(S->state, 0, 3U * sizeof(q15_t)); 48 | } 49 | 50 | /** 51 | * @} end of PID group 52 | */ 53 | -------------------------------------------------------------------------------- /boards/DM_MC_01/DSP/Source/ControllerFunctions/arm_pid_reset_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Project: CMSIS DSP Library 3 | * Title: arm_pid_reset_q31.c 4 | * Description: Q31 PID Control reset function 5 | * 6 | * $Date: 27. January 2017 7 | * $Revision: V.1.5.1 8 | * 9 | * Target Processor: Cortex-M cores 10 | * -------------------------------------------------------------------- */ 11 | /* 12 | * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 13 | * 14 | * SPDX-License-Identifier: Apache-2.0 15 | * 16 | * Licensed under the Apache License, Version 2.0 (the License); you may 17 | * not use this file except in compliance with the License. 18 | * You may obtain a copy of the License at 19 | * 20 | * www.apache.org/licenses/LICENSE-2.0 21 | * 22 | * Unless required by applicable law or agreed to in writing, software 23 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | * See the License for the specific language governing permissions and 26 | * limitations under the License. 27 | */ 28 | 29 | #include "arm_math.h" 30 | 31 | /** 32 | * @addtogroup PID 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Reset function for the Q31 PID Control. 38 | * @param[in] *S Instance pointer of PID control data structure. 39 | * @return none. 40 | * \par Description: 41 | * The function resets the state buffer to zeros. 42 | */ 43 | void arm_pid_reset_q31( 44 | arm_pid_instance_q31 * S) 45 | { 46 | 47 | /* Clear the state buffer. The size will be always 3 samples */ 48 | memset(S->state, 0, 3U * sizeof(q31_t)); 49 | } 50 | 51 | /** 52 | * @} end of PID group 53 | */ 54 | -------------------------------------------------------------------------------- /examples/can_bridge/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_can_bridge ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME}_send 24 | TARGET DJI_Board_TypeC 25 | SOURCES send.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_receive 28 | TARGET DJI_Board_TypeC 29 | SOURCES receive.cc) 30 | -------------------------------------------------------------------------------- /examples/steering/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_steering ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_alignment 28 | TARGET DJI_Board_TypeC 29 | SOURCES steering_alignment.cc) 30 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/DSP/Source/ControllerFunctions/arm_pid_reset_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Project: CMSIS DSP Library 3 | * Title: arm_pid_reset_q31.c 4 | * Description: Q31 PID Control reset function 5 | * 6 | * $Date: 27. January 2017 7 | * $Revision: V.1.5.1 8 | * 9 | * Target Processor: Cortex-M cores 10 | * -------------------------------------------------------------------- */ 11 | /* 12 | * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 13 | * 14 | * SPDX-License-Identifier: Apache-2.0 15 | * 16 | * Licensed under the Apache License, Version 2.0 (the License); you may 17 | * not use this file except in compliance with the License. 18 | * You may obtain a copy of the License at 19 | * 20 | * www.apache.org/licenses/LICENSE-2.0 21 | * 22 | * Unless required by applicable law or agreed to in writing, software 23 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | * See the License for the specific language governing permissions and 26 | * limitations under the License. 27 | */ 28 | 29 | #include "arm_math.h" 30 | 31 | /** 32 | * @addtogroup PID 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Reset function for the Q31 PID Control. 38 | * @param[in] *S Instance pointer of PID control data structure. 39 | * @return none. 40 | * \par Description: 41 | * The function resets the state buffer to zeros. 42 | */ 43 | void arm_pid_reset_q31( 44 | arm_pid_instance_q31 * S) 45 | { 46 | 47 | /* Clear the state buffer. The size will be always 3 samples */ 48 | memset(S->state, 0, 3U * sizeof(q31_t)); 49 | } 50 | 51 | /** 52 | * @} end of PID group 53 | */ 54 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/DSP/Source/ControllerFunctions/arm_pid_reset_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Project: CMSIS DSP Library 3 | * Title: arm_pid_reset_q31.c 4 | * Description: Q31 PID Control reset function 5 | * 6 | * $Date: 27. January 2017 7 | * $Revision: V.1.5.1 8 | * 9 | * Target Processor: Cortex-M cores 10 | * -------------------------------------------------------------------- */ 11 | /* 12 | * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 13 | * 14 | * SPDX-License-Identifier: Apache-2.0 15 | * 16 | * Licensed under the Apache License, Version 2.0 (the License); you may 17 | * not use this file except in compliance with the License. 18 | * You may obtain a copy of the License at 19 | * 20 | * www.apache.org/licenses/LICENSE-2.0 21 | * 22 | * Unless required by applicable law or agreed to in writing, software 23 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | * See the License for the specific language governing permissions and 26 | * limitations under the License. 27 | */ 28 | 29 | #include "arm_math.h" 30 | 31 | /** 32 | * @addtogroup PID 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Reset function for the Q31 PID Control. 38 | * @param[in] *S Instance pointer of PID control data structure. 39 | * @return none. 40 | * \par Description: 41 | * The function resets the state buffer to zeros. 42 | */ 43 | void arm_pid_reset_q31( 44 | arm_pid_instance_q31 * S) 45 | { 46 | 47 | /* Clear the state buffer. The size will be always 3 samples */ 48 | memset(S->state, 0, 3U * sizeof(q31_t)); 49 | } 50 | 51 | /** 52 | * @} end of PID group 53 | */ 54 | -------------------------------------------------------------------------------- /examples/protocol/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_protocol ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME}_host 24 | TARGET DJI_Board_TypeA 25 | SOURCES host.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_client 28 | TARGET DJI_Board_TypeA 29 | SOURCES client.cc) 30 | -------------------------------------------------------------------------------- /examples/hero/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2023 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_hero ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeA 25 | SOURCES main.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_shooter_2023 28 | TARGET DJI_Board_TypeC 29 | SOURCES hero_shooter_2023.cc) 30 | -------------------------------------------------------------------------------- /boards/DM_MC_01/DSP/Source/ControllerFunctions/arm_pid_reset_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Project: CMSIS DSP Library 3 | * Title: arm_pid_reset_f32.c 4 | * Description: Floating-point PID Control reset function 5 | * 6 | * $Date: 27. January 2017 7 | * $Revision: V.1.5.1 8 | * 9 | * Target Processor: Cortex-M cores 10 | * -------------------------------------------------------------------- */ 11 | /* 12 | * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 13 | * 14 | * SPDX-License-Identifier: Apache-2.0 15 | * 16 | * Licensed under the Apache License, Version 2.0 (the License); you may 17 | * not use this file except in compliance with the License. 18 | * You may obtain a copy of the License at 19 | * 20 | * www.apache.org/licenses/LICENSE-2.0 21 | * 22 | * Unless required by applicable law or agreed to in writing, software 23 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | * See the License for the specific language governing permissions and 26 | * limitations under the License. 27 | */ 28 | 29 | #include "arm_math.h" 30 | 31 | /** 32 | * @addtogroup PID 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Reset function for the floating-point PID Control. 38 | * @param[in] *S Instance pointer of PID control data structure. 39 | * @return none. 40 | * \par Description: 41 | * The function resets the state buffer to zeros. 42 | */ 43 | void arm_pid_reset_f32( 44 | arm_pid_instance_f32 * S) 45 | { 46 | 47 | /* Clear the state buffer. The size will be always 3 samples */ 48 | memset(S->state, 0, 3U * sizeof(float32_t)); 49 | } 50 | 51 | /** 52 | * @} end of PID group 53 | */ 54 | -------------------------------------------------------------------------------- /shared/bsp/bsp_error_handler.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2023 RoboMaster. * 4 | * Illini RoboMaster @ University of Illinois at Urbana-Champaign * 5 | * * 6 | * This program is free software: you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation, either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | ****************************************************************************/ 20 | 21 | #include "bsp_error_handler.h" 22 | 23 | void bsp_error_handler(const char* func, int line, const char* msg) { 24 | print("[ERROR at "); 25 | print("%s:", func); 26 | print("%d] ", line); 27 | print("%s\r\n", msg); 28 | return; 29 | } 30 | -------------------------------------------------------------------------------- /shared/third_party/MahonyAHRS.h: -------------------------------------------------------------------------------- 1 | //===================================================================================================== 2 | // MahonyAHRS.h 3 | //===================================================================================================== 4 | // 5 | // Madgwick's implementation of Mayhony's AHRS algorithm. 6 | // See: http://www.x-io.co.uk/node/8#open_source_ahrs_and_imu_algorithms 7 | // 8 | // Date Author Notes 9 | // 29/09/2011 SOH Madgwick Initial release 10 | // 02/10/2011 SOH Madgwick Optimised for reduced CPU load 11 | // 12 | //===================================================================================================== 13 | #ifndef MahonyAHRS_h 14 | #define MahonyAHRS_h 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | //---------------------------------------------------------------------------------------------------- 21 | // Variable declaration 22 | 23 | extern volatile float twoKp; // 2 * proportional gain (Kp) 24 | extern volatile float twoKi; // 2 * integral gain (Ki) 25 | extern volatile float q0, q1, q2, q3; // quaternion of sensor frame relative to auxiliary frame 26 | 27 | //--------------------------------------------------------------------------------------------------- 28 | // Function declarations 29 | 30 | void MahonyAHRSupdate(float q[4], float gx, float gy, float gz, float ax, float ay, float az, float mx, float my, float mz); 31 | void MahonyAHRSupdateIMU(float q[4], float gx, float gy, float gz, float ax, float ay, float az); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | //===================================================================================================== 39 | // End of file 40 | //===================================================================================================== 41 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/DSP/Source/ControllerFunctions/arm_pid_reset_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Project: CMSIS DSP Library 3 | * Title: arm_pid_reset_f32.c 4 | * Description: Floating-point PID Control reset function 5 | * 6 | * $Date: 27. January 2017 7 | * $Revision: V.1.5.1 8 | * 9 | * Target Processor: Cortex-M cores 10 | * -------------------------------------------------------------------- */ 11 | /* 12 | * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 13 | * 14 | * SPDX-License-Identifier: Apache-2.0 15 | * 16 | * Licensed under the Apache License, Version 2.0 (the License); you may 17 | * not use this file except in compliance with the License. 18 | * You may obtain a copy of the License at 19 | * 20 | * www.apache.org/licenses/LICENSE-2.0 21 | * 22 | * Unless required by applicable law or agreed to in writing, software 23 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | * See the License for the specific language governing permissions and 26 | * limitations under the License. 27 | */ 28 | 29 | #include "arm_math.h" 30 | 31 | /** 32 | * @addtogroup PID 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Reset function for the floating-point PID Control. 38 | * @param[in] *S Instance pointer of PID control data structure. 39 | * @return none. 40 | * \par Description: 41 | * The function resets the state buffer to zeros. 42 | */ 43 | void arm_pid_reset_f32( 44 | arm_pid_instance_f32 * S) 45 | { 46 | 47 | /* Clear the state buffer. The size will be always 3 samples */ 48 | memset(S->state, 0, 3U * sizeof(float32_t)); 49 | } 50 | 51 | /** 52 | * @} end of PID group 53 | */ 54 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/DSP/Source/ControllerFunctions/arm_pid_reset_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Project: CMSIS DSP Library 3 | * Title: arm_pid_reset_f32.c 4 | * Description: Floating-point PID Control reset function 5 | * 6 | * $Date: 27. January 2017 7 | * $Revision: V.1.5.1 8 | * 9 | * Target Processor: Cortex-M cores 10 | * -------------------------------------------------------------------- */ 11 | /* 12 | * Copyright (C) 2010-2017 ARM Limited or its affiliates. All rights reserved. 13 | * 14 | * SPDX-License-Identifier: Apache-2.0 15 | * 16 | * Licensed under the Apache License, Version 2.0 (the License); you may 17 | * not use this file except in compliance with the License. 18 | * You may obtain a copy of the License at 19 | * 20 | * www.apache.org/licenses/LICENSE-2.0 21 | * 22 | * Unless required by applicable law or agreed to in writing, software 23 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 24 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | * See the License for the specific language governing permissions and 26 | * limitations under the License. 27 | */ 28 | 29 | #include "arm_math.h" 30 | 31 | /** 32 | * @addtogroup PID 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Reset function for the floating-point PID Control. 38 | * @param[in] *S Instance pointer of PID control data structure. 39 | * @return none. 40 | * \par Description: 41 | * The function resets the state buffer to zeros. 42 | */ 43 | void arm_pid_reset_f32( 44 | arm_pid_instance_f32 * S) 45 | { 46 | 47 | /* Clear the state buffer. The size will be always 3 samples */ 48 | memset(S->state, 0, 3U * sizeof(float32_t)); 49 | } 50 | 51 | /** 52 | * @} end of PID group 53 | */ 54 | -------------------------------------------------------------------------------- /shared/bsp/bsp_laser.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2023 RoboMaster. * 4 | * Illini RoboMaster @ University of Illinois at Urbana-Champaign * 5 | * * 6 | * This program is free software: you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation, either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | ****************************************************************************/ 20 | 21 | #include "bsp_laser.h" 22 | 23 | namespace bsp { 24 | 25 | Laser::Laser(GPIO_TypeDef* group, uint16_t pin) : laser_(group, pin) {} 26 | 27 | void Laser::On() { laser_.High(); } 28 | 29 | void Laser::Off() { laser_.Low(); } 30 | 31 | } /* namespace bsp */ 32 | -------------------------------------------------------------------------------- /shared/bsp/bsp_relay.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2023 RoboMaster. * 4 | * Illini RoboMaster @ University of Illinois at Urbana-Champaign * 5 | * * 6 | * This program is free software: you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation, either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | ****************************************************************************/ 20 | 21 | #include "bsp_relay.h" 22 | 23 | namespace bsp { 24 | 25 | Relay::Relay(GPIO_TypeDef* relay_group, uint16_t relay_pin) : relay_(relay_group, relay_pin) {} 26 | 27 | void Relay::On() { relay_.High(); } 28 | 29 | void Relay::Off() { relay_.Low(); } 30 | 31 | } /* namespace bsp */ 32 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/FATFS/App/fatfs.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file fatfs.c 4 | * @brief Code for fatfs applications 5 | ****************************************************************************** 6 | * @attention 7 | * 8 | *

© Copyright (c) 2023 STMicroelectronics. 9 | * All rights reserved.

10 | * 11 | * This software component is licensed by ST under Ultimate Liberty license 12 | * SLA0044, the "License"; You may not use this file except in compliance with 13 | * the License. You may obtain a copy of the License at: 14 | * www.st.com/SLA0044 15 | * 16 | ****************************************************************************** 17 | */ 18 | 19 | #include "fatfs.h" 20 | 21 | uint8_t retSD; /* Return value for SD */ 22 | char SDPath[4]; /* SD logical drive path */ 23 | FATFS SDFatFS; /* File system object for SD logical drive */ 24 | FIL SDFile; /* File object for SD */ 25 | 26 | /* USER CODE BEGIN Variables */ 27 | 28 | /* USER CODE END Variables */ 29 | 30 | void MX_FATFS_Init(void) 31 | { 32 | /*## FatFS: Link the SD driver ###########################*/ 33 | retSD = FATFS_LinkDriver(&SD_Driver, SDPath); 34 | 35 | /* USER CODE BEGIN Init */ 36 | /* additional user code for init */ 37 | /* USER CODE END Init */ 38 | } 39 | 40 | /** 41 | * @brief Gets Time from RTC 42 | * @param None 43 | * @retval Time in DWORD 44 | */ 45 | DWORD get_fattime(void) 46 | { 47 | /* USER CODE BEGIN get_fattime */ 48 | return 0; 49 | /* USER CODE END get_fattime */ 50 | } 51 | 52 | /* USER CODE BEGIN Application */ 53 | 54 | /* USER CODE END Application */ 55 | 56 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 57 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Drivers/CMSIS/Include/cmsis_version.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file cmsis_version.h 3 | * @brief CMSIS Core(M) Version definitions 4 | * @version V5.0.2 5 | * @date 19. April 2017 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef __CMSIS_VERSION_H 32 | #define __CMSIS_VERSION_H 33 | 34 | /* CMSIS Version definitions */ 35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ 36 | #define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */ 37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ 38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ 39 | #endif 40 | -------------------------------------------------------------------------------- /examples/led/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_led ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME}_typeA 24 | TARGET DJI_Board_TypeA 25 | SOURCES typeA.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_typeC 28 | TARGET DJI_Board_TypeC 29 | SOURCES typeC.cc) 30 | 31 | irm_add_arm_executable(${PROJECT_NAME}_mc01 32 | TARGET DM_MC_01 33 | SOURCES mc01.cc) 34 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/SVD: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_SVD_MODULE_H 9 | #define EIGEN_SVD_MODULE_H 10 | 11 | #include "QR" 12 | #include "Householder" 13 | #include "Jacobi" 14 | 15 | #include "src/Core/util/DisableStupidWarnings.h" 16 | 17 | /** \defgroup SVD_Module SVD module 18 | * 19 | * 20 | * 21 | * This module provides SVD decomposition for matrices (both real and complex). 22 | * Two decomposition algorithms are provided: 23 | * - JacobiSVD implementing two-sided Jacobi iterations is numerically very accurate, fast for small matrices, but very slow for larger ones. 24 | * - BDCSVD implementing a recursive divide & conquer strategy on top of an upper-bidiagonalization which remains fast for large problems. 25 | * These decompositions are accessible via the respective classes and following MatrixBase methods: 26 | * - MatrixBase::jacobiSvd() 27 | * - MatrixBase::bdcSvd() 28 | * 29 | * \code 30 | * #include 31 | * \endcode 32 | */ 33 | 34 | #include "src/misc/RealSvd2x2.h" 35 | #include "src/SVD/UpperBidiagonalization.h" 36 | #include "src/SVD/SVDBase.h" 37 | #include "src/SVD/JacobiSVD.h" 38 | #include "src/SVD/BDCSVD.h" 39 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 40 | #ifdef EIGEN_USE_MKL 41 | #include "mkl_lapacke.h" 42 | #else 43 | #include "src/misc/lapacke.h" 44 | #endif 45 | #include "src/SVD/JacobiSVD_LAPACKE.h" 46 | #endif 47 | 48 | #include "src/Core/util/ReenableStupidWarnings.h" 49 | 50 | #endif // EIGEN_SVD_MODULE_H 51 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 52 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Drivers/CMSIS/Include/cmsis_version.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file cmsis_version.h 3 | * @brief CMSIS Core(M) Version definitions 4 | * @version V5.0.2 5 | * @date 19. April 2017 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef __CMSIS_VERSION_H 32 | #define __CMSIS_VERSION_H 33 | 34 | /* CMSIS Version definitions */ 35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ 36 | #define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */ 37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ 38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ 39 | #endif 40 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Drivers/CMSIS/Include/cmsis_version.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file cmsis_version.h 3 | * @brief CMSIS Core(M) Version definitions 4 | * @version V5.0.2 5 | * @date 19. April 2017 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef __CMSIS_VERSION_H 32 | #define __CMSIS_VERSION_H 33 | 34 | /* CMSIS Version definitions */ 35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ 36 | #define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */ 37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ 38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ 39 | #endif 40 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Core/Inc/tim.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file tim.h 5 | * @brief This file contains all the function prototypes for 6 | * the tim.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __TIM_H__ 22 | #define __TIM_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern TIM_HandleTypeDef htim1; 36 | 37 | extern TIM_HandleTypeDef htim2; 38 | 39 | extern TIM_HandleTypeDef htim3; 40 | 41 | extern TIM_HandleTypeDef htim5; 42 | 43 | extern TIM_HandleTypeDef htim8; 44 | 45 | /* USER CODE BEGIN Private defines */ 46 | 47 | /* USER CODE END Private defines */ 48 | 49 | void MX_TIM1_Init(void); 50 | void MX_TIM2_Init(void); 51 | void MX_TIM3_Init(void); 52 | void MX_TIM5_Init(void); 53 | void MX_TIM8_Init(void); 54 | 55 | void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); 56 | 57 | /* USER CODE BEGIN Prototypes */ 58 | 59 | /* USER CODE END Prototypes */ 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* __TIM_H__ */ 66 | 67 | -------------------------------------------------------------------------------- /examples/rtos/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_rtos ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeA 25 | SOURCES typeA.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_spin 28 | TARGET DJI_Board_TypeA 29 | SOURCES spinlock.cc) 30 | 31 | irm_add_arm_executable(${PROJECT_NAME}_eventflag 32 | TARGET DJI_Board_TypeA 33 | SOURCES eventflag.cc) 34 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeC/Core/Inc/tim.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file tim.h 5 | * @brief This file contains all the function prototypes for 6 | * the tim.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2022 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __TIM_H__ 22 | #define __TIM_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern TIM_HandleTypeDef htim1; 36 | 37 | extern TIM_HandleTypeDef htim4; 38 | 39 | extern TIM_HandleTypeDef htim5; 40 | 41 | extern TIM_HandleTypeDef htim8; 42 | 43 | extern TIM_HandleTypeDef htim10; 44 | 45 | /* USER CODE BEGIN Private defines */ 46 | 47 | /* USER CODE END Private defines */ 48 | 49 | void MX_TIM1_Init(void); 50 | void MX_TIM4_Init(void); 51 | void MX_TIM5_Init(void); 52 | void MX_TIM8_Init(void); 53 | void MX_TIM10_Init(void); 54 | 55 | void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); 56 | 57 | /* USER CODE BEGIN Prototypes */ 58 | 59 | /* USER CODE END Prototypes */ 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* __TIM_H__ */ 66 | 67 | -------------------------------------------------------------------------------- /examples/dbus/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_dbus ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME}_typeA 24 | TARGET DJI_Board_TypeA 25 | SOURCES typeA.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_typeC 28 | TARGET DJI_Board_TypeC 29 | SOURCES typeC.cc) 30 | 31 | irm_add_arm_executable(${PROJECT_NAME}_mc01 32 | TARGET DM_MC_01 33 | SOURCES mc01.cc) 34 | -------------------------------------------------------------------------------- /examples/gimbal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2021 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_gimbal ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeC 25 | SOURCES main.cc) 26 | 27 | irm_add_arm_executable(${PROJECT_NAME}_imu 28 | TARGET DJI_Board_TypeA 29 | SOURCES imu_stablized.cc) 30 | 31 | irm_add_arm_executable(${PROJECT_NAME}_typeC 32 | TARGET DJI_Board_TypeC 33 | SOURCES typeC.cc) 34 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | cmake_minimum_required(VERSION 3.8) 22 | 23 | include(cmake/arm_toolchain.cmake) 24 | include(cmake/build_helper.cmake) 25 | include(cmake/clang_format.cmake) 26 | include(cmake/doxygen.cmake) 27 | 28 | project(iRM_Embedded_2023) 29 | 30 | set(CMAKE_EXPORT_COMPILE_COMMANDS 1) 31 | 32 | add_subdirectory(boards) 33 | add_subdirectory(shared) 34 | add_subdirectory(vehicles) 35 | add_subdirectory(examples) 36 | -------------------------------------------------------------------------------- /boards/DM_MC_01/Core/Inc/usart.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file usart.h 5 | * @brief This file contains all the function prototypes for 6 | * the usart.c file 7 | ****************************************************************************** 8 | * @attention 9 | * 10 | * Copyright (c) 2023 STMicroelectronics. 11 | * All rights reserved. 12 | * 13 | * This software is licensed under terms that can be found in the LICENSE file 14 | * in the root directory of this software component. 15 | * If no LICENSE file comes with this software, it is provided AS-IS. 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __USART_H__ 22 | #define __USART_H__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "main.h" 30 | 31 | /* USER CODE BEGIN Includes */ 32 | 33 | /* USER CODE END Includes */ 34 | 35 | extern UART_HandleTypeDef huart4; 36 | 37 | extern UART_HandleTypeDef huart5; 38 | 39 | extern UART_HandleTypeDef huart1; 40 | 41 | extern UART_HandleTypeDef huart2; 42 | 43 | /* USER CODE BEGIN Private defines */ 44 | extern UART_HandleTypeDef huart3; 45 | /* USER CODE END Private defines */ 46 | 47 | void MX_UART4_Init(void); 48 | void MX_UART5_Init(void); 49 | void MX_USART1_UART_Init(void); 50 | void MX_USART2_UART_Init(void); 51 | 52 | /* USER CODE BEGIN Prototypes */ 53 | void MX_USART3_UART_Init(void); 54 | void RM_UART_IRQHandler(UART_HandleTypeDef *huart); 55 | /* USER CODE END Prototypes */ 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* __USART_H__ */ 62 | 63 | -------------------------------------------------------------------------------- /examples/motor/HERO_SERVO.cc: -------------------------------------------------------------------------------- 1 | #include "bsp_gpio.h" 2 | #include "bsp_print.h" 3 | #include "cmsis_os.h" 4 | #include "main.h" 5 | #include "motor.h" 6 | 7 | /** 8 | * @brief when installing, please use this example to set angle to 0.0 degree for calibration. 9 | * The current program is functioning, however, might not be 100% accurate 10 | */ 11 | 12 | // All of these following parameters are tuned for this servo. 13 | uint8_t PWM_CHANNEL = 1; 14 | uint32_t TIM_CLOCK_FREQ = 1980000; /* TODO: could use more calibration if data is available*/ 15 | // rule of thumb, TIM_CLOCK_FREQ could use more calibration if more data is available for PDI-HV5932 16 | uint32_t MOTOR_OUT_FREQ = 500; /* TODO: could use more calibration if data is available*/ 17 | uint32_t PULSE_WIDTH = 1500; 18 | // PULSE_WIDTH when servo is idle 19 | 20 | bsp::GPIO* key = nullptr; 21 | 22 | #define KEY_GPIO_GROUP GPIOA 23 | #define KEY_GPIO_PIN GPIO_PIN_0 24 | 25 | control::PDIHV* motor1; 26 | 27 | void RM_RTOS_Init(){ 28 | print_use_uart(&huart1); 29 | key = new bsp::GPIO(KEY_GPIO_GROUP, KEY_GPIO_PIN); 30 | motor1 = new control::PDIHV(&htim1, PWM_CHANNEL,TIM_CLOCK_FREQ,MOTOR_OUT_FREQ, PULSE_WIDTH); 31 | // motor1->SetOutput(1500); 32 | osDelay(300); 33 | } 34 | 35 | void RM_RTOS_Default_Task(const void* args) { 36 | UNUSED(args); 37 | float angle = 0.0; 38 | // angle could be set to 80 ~ -80 deg 39 | int16_t power = 1947; 40 | // power is from range 972 to 1947, data on purchasing page is not available, pulse width for central point is 1500 41 | while(true){ 42 | motor1->SetOutPutAngle(angle); 43 | 44 | // motor1->SetOutput(power); 45 | if(!key->Read()){ 46 | angle += 10.0; 47 | power -= 10; 48 | } 49 | // power += 10; 50 | osDelay(2); 51 | // angle += 1.0; 52 | print("angle: %f\r\n", angle); 53 | print("power: %d\r\n", power); 54 | print("\r\n"); 55 | 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/PaStiXSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This Source Code Form is subject to the terms of the Mozilla 5 | // Public License v. 2.0. If a copy of the MPL was not distributed 6 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 9 | #define EIGEN_PASTIXSUPPORT_MODULE_H 10 | 11 | #include "SparseCore" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | extern "C" { 16 | #include 17 | #include 18 | } 19 | 20 | #ifdef complex 21 | #undef complex 22 | #endif 23 | 24 | /** \ingroup Support_modules 25 | * \defgroup PaStiXSupport_Module PaStiXSupport module 26 | * 27 | * This module provides an interface to the PaSTiX library. 28 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. 29 | * It provides the two following main factorization classes: 30 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. 31 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. 32 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | * 38 | * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies. 39 | * The dependencies depend on how PaSTiX has been compiled. 40 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 41 | * 42 | */ 43 | 44 | #include "src/PaStiXSupport/PaStiXSupport.h" 45 | 46 | #include "src/Core/util/ReenableStupidWarnings.h" 47 | 48 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 49 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/SparseLU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // Copyright (C) 2012 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_SPARSELU_MODULE_H 12 | #define EIGEN_SPARSELU_MODULE_H 13 | 14 | #include "SparseCore" 15 | 16 | /** 17 | * \defgroup SparseLU_Module SparseLU module 18 | * This module defines a supernodal factorization of general sparse matrices. 19 | * The code is fully optimized for supernode-panel updates with specialized kernels. 20 | * Please, see the documentation of the SparseLU class for more details. 21 | */ 22 | 23 | // Ordering interface 24 | #include "OrderingMethods" 25 | 26 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 27 | 28 | #include "src/SparseLU/SparseLU_Structs.h" 29 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 30 | #include "src/SparseLU/SparseLUImpl.h" 31 | #include "src/SparseCore/SparseColEtree.h" 32 | #include "src/SparseLU/SparseLU_Memory.h" 33 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 34 | #include "src/SparseLU/SparseLU_relax_snode.h" 35 | #include "src/SparseLU/SparseLU_pivotL.h" 36 | #include "src/SparseLU/SparseLU_panel_dfs.h" 37 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 38 | #include "src/SparseLU/SparseLU_panel_bmod.h" 39 | #include "src/SparseLU/SparseLU_column_dfs.h" 40 | #include "src/SparseLU/SparseLU_column_bmod.h" 41 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 42 | #include "src/SparseLU/SparseLU_pruneL.h" 43 | #include "src/SparseLU/SparseLU_Utils.h" 44 | #include "src/SparseLU/SparseLU.h" 45 | 46 | #endif // EIGEN_SPARSELU_MODULE_H 47 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/Core/SelfCwiseBinaryOp.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SELFCWISEBINARYOP_H 11 | #define EIGEN_SELFCWISEBINARYOP_H 12 | 13 | namespace Eigen { 14 | 15 | // TODO generalize the scalar type of 'other' 16 | 17 | template 18 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator*=(const Scalar& other) 19 | { 20 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op()); 21 | return derived(); 22 | } 23 | 24 | template 25 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator+=(const Scalar& other) 26 | { 27 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::add_assign_op()); 28 | return derived(); 29 | } 30 | 31 | template 32 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase::operator-=(const Scalar& other) 33 | { 34 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::sub_assign_op()); 35 | return derived(); 36 | } 37 | 38 | template 39 | EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase::operator/=(const Scalar& other) 40 | { 41 | internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op()); 42 | return derived(); 43 | } 44 | 45 | } // end namespace Eigen 46 | 47 | #endif // EIGEN_SELFCWISEBINARYOP_H 48 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/SparseCore/SparseRedux.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2014 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSEREDUX_H 11 | #define EIGEN_SPARSEREDUX_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | typename internal::traits::Scalar 17 | SparseMatrixBase::sum() const 18 | { 19 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 20 | Scalar res(0); 21 | internal::evaluator thisEval(derived()); 22 | for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter) 24 | res += iter.value(); 25 | return res; 26 | } 27 | 28 | template 29 | typename internal::traits >::Scalar 30 | SparseMatrix<_Scalar,_Options,_Index>::sum() const 31 | { 32 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 33 | if(this->isCompressed()) 34 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 35 | else 36 | return Base::sum(); 37 | } 38 | 39 | template 40 | typename internal::traits >::Scalar 41 | SparseVector<_Scalar,_Options,_Index>::sum() const 42 | { 43 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 44 | return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); 45 | } 46 | 47 | } // end namespace Eigen 48 | 49 | #endif // EIGEN_SPARSEREDUX_H 50 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/FATFS/Target/sd_diskio.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file sd_diskio.h 5 | * @brief Header for sd_diskio.c module 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2019 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Note: code generation based on sd_diskio_dma_rtos_template.h */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __SD_DISKIO_H 25 | #define __SD_DISKIO_H 26 | 27 | /* USER CODE BEGIN firstSection */ 28 | /* can be used to modify / undefine following code or add new definitions */ 29 | /* USER CODE END firstSection */ 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "bsp_driver_sd.h" 33 | /* Exported types ------------------------------------------------------------*/ 34 | /* Exported constants --------------------------------------------------------*/ 35 | /* Exported functions ------------------------------------------------------- */ 36 | extern const Diskio_drvTypeDef SD_Driver; 37 | 38 | /* USER CODE BEGIN lastSection */ 39 | /* can be used to modify / undefine previous code or add new definitions */ 40 | /* USER CODE END lastSection */ 41 | 42 | #endif /* __SD_DISKIO_H */ 43 | 44 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 45 | 46 | -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Inc/tim.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file tim.h 4 | * @brief This file contains all the function prototypes for 5 | * the tim.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2023 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __TIM_H__ 21 | #define __TIM_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Includes ------------------------------------------------------------------*/ 28 | #include "main.h" 29 | 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | extern TIM_HandleTypeDef htim1; 35 | extern TIM_HandleTypeDef htim2; 36 | extern TIM_HandleTypeDef htim4; 37 | extern TIM_HandleTypeDef htim5; 38 | extern TIM_HandleTypeDef htim12; 39 | 40 | /* USER CODE BEGIN Private defines */ 41 | 42 | /* USER CODE END Private defines */ 43 | 44 | void MX_TIM1_Init(void); 45 | void MX_TIM2_Init(void); 46 | void MX_TIM4_Init(void); 47 | void MX_TIM5_Init(void); 48 | void MX_TIM12_Init(void); 49 | 50 | void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); 51 | 52 | /* USER CODE BEGIN Prototypes */ 53 | 54 | /* USER CODE END Prototypes */ 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* __TIM_H__ */ 61 | 62 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 63 | -------------------------------------------------------------------------------- /examples/imu/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------- # 2 | # # 3 | # Copyright (C) 2022 # 4 | # Illini RoboMaster @ University of Illinois at Urbana-Champaign. # 5 | # # 6 | # This program is free software: you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation, either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # This program is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # ---------------------------------------------------------------------- # 20 | 21 | project(example_imu ASM C CXX) 22 | 23 | irm_add_arm_executable(${PROJECT_NAME} 24 | TARGET DJI_Board_TypeA 25 | SOURCES main.cc) 26 | 27 | irm_add_arm_executable(imu_calibrate 28 | TARGET DJI_Board_TypeA 29 | SOURCES calibrate.cc) 30 | 31 | irm_add_arm_executable(imu_estimate 32 | TARGET DJI_Board_TypeA 33 | SOURCES poseEstimate.cc) 34 | 35 | irm_add_arm_executable(${PROJECT_NAME}_typeC 36 | TARGET DJI_Board_TypeC 37 | SOURCES typeC.cc) 38 | -------------------------------------------------------------------------------- /shared/libraries/supercap.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2023 RoboMaster. * 4 | * Illini RoboMaster @ University of Illinois at Urbana-Champaign * 5 | * * 6 | * This program is free software: you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation, either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | ****************************************************************************/ 20 | 21 | #pragma once 22 | #include "bsp_can.h" 23 | 24 | namespace control { 25 | 26 | typedef struct { 27 | float voltage; 28 | float energy; 29 | } __packed cap_message_t; 30 | 31 | class SuperCap { 32 | public: 33 | SuperCap(bsp::CAN* can, uint16_t rx_id); 34 | void UpdateData(const uint8_t data[]); 35 | 36 | volatile bool connection_flag_ = false; 37 | 38 | cap_message_t info; 39 | }; 40 | 41 | } // namespace control 42 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/Core/arch/Default/Settings.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | 12 | /* All the parameters defined in this file can be specialized in the 13 | * architecture specific files, and/or by the user. 14 | * More to come... */ 15 | 16 | #ifndef EIGEN_DEFAULT_SETTINGS_H 17 | #define EIGEN_DEFAULT_SETTINGS_H 18 | 19 | /** Defines the maximal loop size to enable meta unrolling of loops. 20 | * Note that the value here is expressed in Eigen's own notion of "number of FLOPS", 21 | * it does not correspond to the number of iterations or the number of instructions 22 | */ 23 | #ifndef EIGEN_UNROLLING_LIMIT 24 | #define EIGEN_UNROLLING_LIMIT 100 25 | #endif 26 | 27 | /** Defines the threshold between a "small" and a "large" matrix. 28 | * This threshold is mainly used to select the proper product implementation. 29 | */ 30 | #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 31 | #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8 32 | #endif 33 | 34 | /** Defines the maximal width of the blocks used in the triangular product and solver 35 | * for vectors (level 2 blas xTRMV and xTRSV). The default is 8. 36 | */ 37 | #ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 38 | #define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8 39 | #endif 40 | 41 | 42 | /** Defines the default number of registers available for that architecture. 43 | * Currently it must be 8 or 16. Other values will fail. 44 | */ 45 | #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 46 | #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8 47 | #endif 48 | 49 | #endif // EIGEN_DEFAULT_SETTINGS_H 50 | -------------------------------------------------------------------------------- /shared/bsp/bsp_laser.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2023 RoboMaster. * 4 | * Illini RoboMaster @ University of Illinois at Urbana-Champaign * 5 | * * 6 | * This program is free software: you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation, either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | ****************************************************************************/ 20 | 21 | #pragma once 22 | 23 | #include "bsp_gpio.h" 24 | 25 | namespace bsp { 26 | 27 | class Laser { 28 | public: 29 | /** 30 | * @brief constructor for laser 31 | */ 32 | Laser(GPIO_TypeDef* group, uint16_t pin); 33 | /** 34 | * @brief Turn on the laser 35 | */ 36 | void On(); 37 | /** 38 | * @brief Turn off the laser 39 | */ 40 | void Off(); 41 | 42 | private: 43 | GPIO laser_; 44 | }; 45 | 46 | } /* namespace bsp */ 47 | -------------------------------------------------------------------------------- /examples/led/mc01.cc: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 RoboMaster. * 4 | * Illini RoboMaster @ University of Illinois at Urbana-Champaign * 5 | * * 6 | * This program is free software: you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation, either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | ****************************************************************************/ 20 | 21 | #include "main.h" 22 | 23 | #include "bsp_gpio.h" 24 | #include "cmsis_os.h" 25 | static bsp::GPIO* led = nullptr; 26 | 27 | void RM_RTOS_Init(void) { 28 | print_use_usb(); 29 | led = new bsp::GPIO(LED_GPIO_Port, LED_Pin); 30 | HAL_Delay(3000); 31 | } 32 | 33 | void RM_RTOS_Default_Task(const void* args) { 34 | UNUSED(args); 35 | while (true) { 36 | print("test\r\n"); 37 | led->High(); 38 | osDelay(1000); 39 | led->Low(); 40 | osDelay(1000); 41 | } 42 | } -------------------------------------------------------------------------------- /boards/DJI_Board_TypeA/Core/Inc/usart.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usart.h 4 | * @brief This file contains all the function prototypes for 5 | * the usart.c file 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2023 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under Ultimate Liberty license 13 | * SLA0044, the "License"; You may not use this file except in compliance with 14 | * the License. You may obtain a copy of the License at: 15 | * www.st.com/SLA0044 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* Define to prevent recursive inclusion -------------------------------------*/ 20 | #ifndef __USART_H__ 21 | #define __USART_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Includes ------------------------------------------------------------------*/ 28 | #include "main.h" 29 | 30 | /* USER CODE BEGIN Includes */ 31 | 32 | /* USER CODE END Includes */ 33 | 34 | extern UART_HandleTypeDef huart7; 35 | extern UART_HandleTypeDef huart8; 36 | extern UART_HandleTypeDef huart1; 37 | extern UART_HandleTypeDef huart3; 38 | extern UART_HandleTypeDef huart6; 39 | 40 | /* USER CODE BEGIN Private defines */ 41 | 42 | /* USER CODE END Private defines */ 43 | 44 | void MX_UART7_Init(void); 45 | void MX_UART8_Init(void); 46 | void MX_USART1_UART_Init(void); 47 | void MX_USART3_UART_Init(void); 48 | void MX_USART6_UART_Init(void); 49 | 50 | /* USER CODE BEGIN Prototypes */ 51 | void RM_UART_IRQHandler(UART_HandleTypeDef *huart); 52 | /* USER CODE END Prototypes */ 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __USART_H__ */ 59 | 60 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 61 | -------------------------------------------------------------------------------- /shared/third_party/eigen-3.3.9/Eigen/src/misc/RealSvd2x2.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2010 Benoit Jacob 5 | // Copyright (C) 2013-2016 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_REALSVD2X2_H 12 | #define EIGEN_REALSVD2X2_H 13 | 14 | namespace Eigen { 15 | 16 | namespace internal { 17 | 18 | template 19 | void real_2x2_jacobi_svd(const MatrixType& matrix, Index p, Index q, 20 | JacobiRotation *j_left, 21 | JacobiRotation *j_right) 22 | { 23 | using std::sqrt; 24 | using std::abs; 25 | Matrix m; 26 | m << numext::real(matrix.coeff(p,p)), numext::real(matrix.coeff(p,q)), 27 | numext::real(matrix.coeff(q,p)), numext::real(matrix.coeff(q,q)); 28 | JacobiRotation rot1; 29 | RealScalar t = m.coeff(0,0) + m.coeff(1,1); 30 | RealScalar d = m.coeff(1,0) - m.coeff(0,1); 31 | 32 | if(abs(d) < (std::numeric_limits::min)()) 33 | { 34 | rot1.s() = RealScalar(0); 35 | rot1.c() = RealScalar(1); 36 | } 37 | else 38 | { 39 | // If d!=0, then t/d cannot overflow because the magnitude of the 40 | // entries forming d are not too small compared to the ones forming t. 41 | RealScalar u = t / d; 42 | RealScalar tmp = sqrt(RealScalar(1) + numext::abs2(u)); 43 | rot1.s() = RealScalar(1) / tmp; 44 | rot1.c() = u / tmp; 45 | } 46 | m.applyOnTheLeft(0,1,rot1); 47 | j_right->makeJacobi(m,0,1); 48 | *j_left = rot1 * j_right->transpose(); 49 | } 50 | 51 | } // end namespace internal 52 | 53 | } // end namespace Eigen 54 | 55 | #endif // EIGEN_REALSVD2X2_H 56 | -------------------------------------------------------------------------------- /vehicles/Steering/config.md: -------------------------------------------------------------------------------- 1 | # Steering Configurations 2 | ## ID Definition 3 | ### Gimbal Type C Board 4 | | | CAN | TX ID | RX ID | 5 | | ------------- | --- | ------ | ------ | 6 | | pitch_motor | 1 | 0x01 | 0x02 | 7 | | yaw_motor | 1 | 0x1ff | 0x206 | 8 | | sl_motor | 1 | 0x200 | 0x201 | 9 | | sr_motor | 1 | 0x200 | 0x202 | 10 | | ld_motor | 1 | 0x200 | 0x203 | 11 | | can_bridge | 2 | 0x20A | 0x20B | 12 | 13 | ### Chassis Type C Board 14 | | | CAN | TX ID | RX ID | 15 | | ------------- | --- | ------ | ------ | 16 | | motor1 | 1 | 0x200 | 0x201 | 17 | | motor2 | 1 | 0x200 | 0x202 | 18 | | motor3 | 1 | 0x200 | 0x203 | 19 | | motor4 | 1 | 0x200 | 0x204 | 20 | | motor5 | 2 | 0x1ff | 0x205 | 21 | | motor6 | 2 | 0x1ff | 0x206 | 22 | | motor7 | 2 | 0x1ff | 0x207 | 23 | | motor8 | 2 | 0x1ff | 0x208 | 24 | | can_bridge | 2 | 0x20B | 0x20A | 25 | 26 | ## RC Switch Definition 27 | | | Function | 28 | | ----------------------------|------------------------| 29 | | swl-down | Toggle Kill | 30 | | swl-up | Toggle spin mode | 31 | | swr-down (pre-calibration) | Calibrate | 32 | | swr-down (post-calibration) | Do nothing | 33 | | swr-mid | Turn on flywheels | 34 | | swr-up | Slow Continue Shooting | 35 | 36 | ## Key Definition 37 | | | Function | 38 | | -------- | ---------------- | 39 | | WASD | Directions | 40 | | B | Initialization | 41 | | SHIFT | Toggle Spin | 42 | | R | Recalibrate steer motors | 43 | | G | Manual anti-jam | 44 | 45 | ## Wheel Definition 46 | | | Function | 47 | |------|------------------------| 48 | | Up | Triple Shooting | 49 | | Down | Fast Continue Shooting | 50 | --------------------------------------------------------------------------------