From 13fe5386d1965ad568ccaade9530ee6a5525c1b3 Mon Sep 17 00:00:00 2001 From: Douglas Chen Date: Fri, 10 Oct 2025 15:38:13 -0700 Subject: [PATCH 1/4] chore: change submodules folder name --- .gitmodules | 4 ++-- common_libraries/CMakeLists.txt | 2 +- {external_libs => submodules}/Catch2 | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename {external_libs => submodules}/Catch2 (100%) diff --git a/.gitmodules b/.gitmodules index 66924ce..dd10f4c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "external_libs/Catch2"] - path = external_libs/Catch2 +[submodule "submodules/Catch2"] + path = submodules/Catch2 url = https://github.com/catchorg/Catch2.git diff --git a/common_libraries/CMakeLists.txt b/common_libraries/CMakeLists.txt index 1a33315..6c260a4 100644 --- a/common_libraries/CMakeLists.txt +++ b/common_libraries/CMakeLists.txt @@ -7,7 +7,7 @@ project(common_lib_tests) set(CMAKE_CXX_STANDARD 17) # cpp 2017 standard set(CMAKE_CXX_STANDARD_REQUIRED True) -add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../external_libs/Catch2 ${CMAKE_CURRENT_BINARY_DIR}/external_libs/Catch2) # Include Catch2 for unit tests +add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../submodules/Catch2 ${CMAKE_CURRENT_BINARY_DIR}/submodules/Catch2) # Include Catch2 for unit tests set(BUILD_DIR ${CMAKE_CURRENT_LIST_DIR}/build) diff --git a/external_libs/Catch2 b/submodules/Catch2 similarity index 100% rename from external_libs/Catch2 rename to submodules/Catch2 From 6798eed30e14f56524164e75047a7c8c7d688628 Mon Sep 17 00:00:00 2001 From: Douglas Chen Date: Fri, 10 Oct 2025 15:38:19 -0700 Subject: [PATCH 2/4] chore: update readme --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f28e7a9..7777ada 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,32 @@ This contains all our firmware and embedded code. From both elec and software. Some build code is committed, which will likely change soon. But we don't have a setup script for zephyr, and use teensy tools to flash our old arm, so by having build code, we don't need to install zephyr on all our computers. -### CONTRIBUTING + +## Setup + +### Install CMake + +This is a tool used to run scripts (e.g. setup scripts). + +#### Mac +```bash +brew install cmake +cd common_libs/ +make build +``` + +#### Linux / WSL +```bash +sudo apt-get install cmake +cd common_libs/ +make build +``` + +### Install Zephyr + +Follow setup instructions [here](https://docs.zephyrproject.org/latest/develop/getting_started/index.html). + +### Contributing Currently, we protect main branch by PR approval and an automated test of our common libraries. More automated tests will follow. From 7fa318466e0f4bbd18167234d7a495d6ecc9ba90 Mon Sep 17 00:00:00 2001 From: Douglas Chen Date: Mon, 20 Oct 2025 19:30:19 -0700 Subject: [PATCH 3/4] chore: revise readme --- README.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5ad440c..922bb74 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,15 @@ make build Follow setup instructions [here](https://docs.zephyrproject.org/latest/develop/getting_started/index.html). -### Contributing +## Contributing Currently, we protect main branch by PR approval and an automated test of our common libraries. More automated tests will follow. -### ZephyrRTOS +## ZephyrRTOS We have some zephyr rtos projects under zephyr_projects. To build/develop them you will need to install zephyr: https://docs.zephyrproject.org/latest/develop/getting_started/index.html -### Arduino +## Arduino We have some arduino projects, under arduino_firmware. ### Common Libraries @@ -47,7 +47,7 @@ We have an example here, that shows the general workflow for creating a common l 1. [Low pass FIR filter](common_libraries/low_pass_fir_filter/README.md) -### Testing +## Testing We use Catch2 for testing cpp and c code. It's an easy to use, and easy to integrate tool for cpp unit tests. Ideally, all our code has test coverage. Test driven development (TDD) is a powerful process where if done perfectly, you never push a bug that would impact system operations, because your tests would cover every needed operation of the system. @@ -57,8 +57,14 @@ Catch2 docs are in it's readme: https://github.com/catchorg/Catch2?tab=readme-ov A good book on TDD is Test Driven Development for Embedded Systems: https://pragprog.com/titles/jgade/test-driven-development-for-embedded-c/ +For example, to test the common libraries, do: +```bash +cd common_libraries/ +make test +``` + ### ROS2 Tests We have some ros2 code in here, specifically for testing firmware. Might be moved to RoverFlake2 in the future. -### End Notes +## End Notes The filestructure is currently based around development enviroments, we may change this to project based structure in the future. \ No newline at end of file From 0a838392a45c1bcd834973bd998c1ac52fc4a4bd Mon Sep 17 00:00:00 2001 From: Douglas Chen Date: Mon, 20 Oct 2025 19:35:02 -0700 Subject: [PATCH 4/4] chore: add clone instruction --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 922bb74..4b71c4a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@ Some build code is committed, which will likely change soon. But we don't have a ## Setup +### Clone the repository +```bash +git clone --recurse-submodules https://github.com/UBC-Snowbots/FirmFlake.git +``` + ### Install CMake This is a tool used to run scripts (e.g. setup scripts).