Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c951087
working comms with hive-rs
Sammyboyo Oct 15, 2025
7b8e560
configured controllers to use new config format
Rishi-H Feb 3, 2026
0654184
can_manager done
Feb 4, 2026
63575e8
buff encoder setup
Feb 8, 2026
4c0f9cf
finished CAN manager
Rishi-H Feb 9, 2026
8aae58d
replacing pointers with references, got can manager fully working
Rishi-H Feb 10, 2026
6aa6246
Merge branch 'feature-new-rust-config' of github.com:CU-Robotics/firm…
Feb 10, 2026
1c43c9c
Sensor Manager prog
Feb 12, 2026
ce08194
Sensor manager prog
Rishi-H Feb 13, 2026
61489fb
configuring sensors
Feb 13, 2026
9c6584f
almost all sensors configured
Rishi-H Feb 14, 2026
7f8ba13
laptop push
Feb 16, 2026
75e9ecf
merge
Feb 16, 2026
fb07389
clean up can, ref, transmitter usage in main, delete dead code and cl…
Rishi-H Feb 18, 2026
20cc1c7
initial state rework completed
Rishi-H Feb 20, 2026
e3814d3
state refactor
Rishi-H Feb 22, 2026
08e42f9
finished robot state design, still need to incorporate wrapping
Rishi-H Feb 25, 2026
a2125a4
integrating state into controls, estimator, reference gov
Rishi-H Mar 4, 2026
2c8ef63
more controls and estimator work, setup for assert safety mode
Mar 4, 2026
87dd02b
stuff
Rishi-H Mar 5, 2026
08236eb
design complete
Rishi-H Mar 6, 2026
3eb8b80
compiling yo
Rishi-H Mar 6, 2026
6873ae1
base config packet size changes to allign with rust
Sammyboyo Mar 6, 2026
0b28580
config seems to be working
Sammyboyo Mar 6, 2026
882e0f3
bug fixes
cu-boulder-robotics Mar 7, 2026
60f3b5e
reorder hive_data switch
Sammyboyo Mar 8, 2026
9ae1b25
fixes
cu-boulder-robotics Mar 8, 2026
fca2b71
transmitter refactor
cu-boulder-robotics Mar 9, 2026
5a01187
bug fixes
Sammyboyo Mar 9, 2026
6f33c63
working ethernet comms with state visualizer
cu-boulder-robotics Mar 10, 2026
8011fd3
code cleanup and some docs
Rishi-H Mar 11, 2026
42e4de8
working manual controls
cu-boulder-robotics Mar 11, 2026
2e64d58
add make target to build docs; cleaned up comms ref data; documented …
Rishi-H Mar 12, 2026
35658eb
Ref data over comms, configuration status syncing with hive-rs
cu-boulder-robotics Mar 13, 2026
ca8d989
fully documented
Rishi-H Mar 14, 2026
d06aca5
adressed rest of jackson's comments, got rid of all if defined hive
Rishi-H Mar 25, 2026
b19c077
merged with main UNTESTED
Rishi-H Mar 26, 2026
b1b6c46
documented
Rishi-H Mar 26, 2026
3cd5aee
adressed comments
cu-boulder-robotics Mar 29, 2026
20e9d63
docs and remove debug
cu-boulder-robotics Mar 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 0 additions & 138 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@ ALLOW_UNICODE_NAMES = NO

OUTPUT_LANGUAGE = English

# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all generated output in the proper direction.
# Possible values are: None, LTR, RTL and Context.
# The default value is: None.

OUTPUT_TEXT_DIRECTION = None

# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
Expand Down Expand Up @@ -1149,44 +1141,6 @@ USE_HTAGS = NO

VERBATIM_HEADERS = YES

# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
# clang parser (see:
# http://clang.llvm.org/) for more accurate parsing at the cost of reduced
# performance. This can be particularly helpful with template rich C++ code for
# which doxygen's built-in parser lacks the necessary type information.
# Note: The availability of this option depends on whether or not doxygen was
# generated with the -Duse_libclang=ON option for CMake.
# The default value is: NO.

CLANG_ASSISTED_PARSING = NO

# If clang assisted parsing is enabled and the CLANG_ADD_INC_PATHS tag is set to
# YES then doxygen will add the directory of each input to the include path.
# The default value is: YES.

CLANG_ADD_INC_PATHS = YES

# If clang assisted parsing is enabled you can provide the compiler with command
# line options that you would normally use when invoking the compiler. Note that
# the include paths will already be set by doxygen for the files and directories
# specified with INPUT and INCLUDE_PATH.
# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.

CLANG_OPTIONS =

# If clang assisted parsing is enabled you can provide the clang parser with the
# path to the directory containing a file called compile_commands.json. This
# file is the compilation database (see:
# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the
# options used when the source files were built. This is equivalent to
# specifying the -p option to a clang tool, such as clang-check. These options
# will then be passed to the parser. Any options specified with CLANG_OPTIONS
# will be added as well.
# Note: The availability of this option depends on whether or not doxygen was
# generated with the -Duse_libclang=ON option for CMake.

CLANG_DATABASE_PATH =

#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
Expand Down Expand Up @@ -1325,15 +1279,6 @@ HTML_COLORSTYLE_SAT = 100

HTML_COLORSTYLE_GAMMA = 80

# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting this
# to YES can help to show when doxygen was last run and thus if the
# documentation is up to date.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.

HTML_TIMESTAMP = NO

# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
# documentation will contain a main index with vertical navigation menus that
# are dynamically created via JavaScript. If disabled, the navigation index will
Expand Down Expand Up @@ -1628,17 +1573,6 @@ HTML_FORMULA_FORMAT = png

FORMULA_FONTSIZE = 10

# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
# Note that when changing this option you need to delete any form_*.png files in
# the HTML output directory before the changes have effect.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.

FORMULA_TRANSPARENT = YES

# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
# to create new LaTeX commands to be used in formulas as building blocks. See
# the section "Including formulas" for details.
Expand Down Expand Up @@ -1942,16 +1876,6 @@ LATEX_BATCHMODE = NO

LATEX_HIDE_INDICES = NO

# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
# code with syntax highlighting in the LaTeX output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.

LATEX_SOURCE_CODE = NO

# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
Expand All @@ -1960,14 +1884,6 @@ LATEX_SOURCE_CODE = NO

LATEX_BIB_STYLE = plain

# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.

LATEX_TIMESTAMP = NO

# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
# path from which the emoji images will be read. If a relative path is entered,
# it will be relative to the LATEX_OUTPUT directory. If left blank the
Expand Down Expand Up @@ -2032,16 +1948,6 @@ RTF_STYLESHEET_FILE =

RTF_EXTENSIONS_FILE =

# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
# with syntax highlighting in the RTF output.
#
# Note that which sources are shown also depends on other settings such as
# SOURCE_BROWSER.
# The default value is: NO.
# This tag requires that the tag GENERATE_RTF is set to YES.

RTF_SOURCE_CODE = NO

#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
Expand Down Expand Up @@ -2138,14 +2044,6 @@ GENERATE_DOCBOOK = NO

DOCBOOK_OUTPUT = docbook

# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
# program listings (including syntax highlighting and cross-referencing
# information) to the DOCBOOK output. Note that enabling this will significantly
# increase the size of the DOCBOOK output.
# The default value is: NO.
# This tag requires that the tag GENERATE_DOCBOOK is set to YES.

DOCBOOK_PROGRAMLISTING = NO

#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
Expand Down Expand Up @@ -2325,15 +2223,6 @@ EXTERNAL_PAGES = YES
# Configuration options related to the dot tool
#---------------------------------------------------------------------------

# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
# NO turns the diagrams off. Note that this option also works with HAVE_DOT
# disabled, but it is recommended to install and use dot, since it yields more
# powerful graphs.
# The default value is: YES.

CLASS_DIAGRAMS = YES

# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
Expand Down Expand Up @@ -2366,22 +2255,6 @@ HAVE_DOT = YES

DOT_NUM_THREADS = 0

# When you want a differently looking font in the dot files that doxygen
# generates you can specify the font name using DOT_FONTNAME. You need to make
# sure dot is able to find the font, which can be done by putting it in a
# standard location or by setting the DOTFONTPATH environment variable or by
# setting DOT_FONTPATH to the directory containing the font.
# The default value is: Helvetica.
# This tag requires that the tag HAVE_DOT is set to YES.

DOT_FONTNAME = Helvetica

# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
# dot graphs.
# Minimum value: 4, maximum value: 24, default value: 10.
# This tag requires that the tag HAVE_DOT is set to YES.

DOT_FONTSIZE = 10

# By default doxygen will tell dot to use the default font as specified with
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
Expand Down Expand Up @@ -2619,17 +2492,6 @@ DOT_GRAPH_MAX_NODES = 50

MAX_DOT_GRAPH_DEPTH = 0

# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not seem
# to support this out of the box.
#
# Warning: Depending on the platform used, enabling this option may lead to
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
# read).
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.

DOT_TRANSPARENT = NO

# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
Expand Down
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ CFLAGS := $(CPU_CFLAGS)

# Compiler flags for C++ files
CXXFLAGS := $(CPU_CFLAGS) -std=gnu++23 \
-felide-constructors -fno-exceptions -fpermissive -fno-rtti \
-felide-constructors -fno-exceptions -fpermissive \
-Wno-error=narrowing -Wno-trigraphs -Wno-comment -Wall -Werror \
-Wno-volatile

Expand Down Expand Up @@ -171,6 +171,15 @@ $(BUILD_DIR)/%.cpp.o: %.cpp
@$(OBJDUMP) -dstz $@ > $@.dump



DOC_SCRIPT = $(TOOLS_DIR)/build_docs.sh
# Phony target to generate documentation using Doxygen
.PHONY: docs

docs: build
@chmod +x $(DOC_SCRIPT)
@$(DOC_SCRIPT)

# Phony target to prevent conflicts with files named 'clean' and force a rebuild every time
.PHONY: clean

Expand Down Expand Up @@ -257,7 +266,12 @@ help:
@echo " monitor: monitors any actively running firmware and displays serial output"
@echo " kill: stops any running firmware"
@echo " restart: restarts any running firmware"

@echo " clean: removes all build artifacts and generated files"
@echo " clean_src: removes only the source object files"
@echo " clean_libs: removes only the library object files"
@echo " clean_teensy4: removes only the Teensy object files"
@echo " cdb: generates compile_commands.json for clangd using Bear"
@echo " docs: generates documentation of our src/ code using Doxygen"

# --- Compile DB generation with Bear -----------------------------------------
.PHONY: cdb
Expand Down
1 change: 1 addition & 0 deletions libraries/QNEthernet/src/lwip/pbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
/* If pbuf is to be allocated in RAM, allocate memory for it. */
p = (struct pbuf *)mem_malloc(alloc_len);
if (p == NULL) {

return NULL;
}
pbuf_init_alloced_pbuf(p, LWIP_MEM_ALIGN((void *)((u8_t *)p + SIZEOF_STRUCT_PBUF + offset)),
Expand Down
7 changes: 2 additions & 5 deletions src/comms/SDManager.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef SD_WRAP
#define SD_WRAP
#pragma once

#include <SD/SD.h>
#include <SPI/SPI.h>
Expand Down Expand Up @@ -97,6 +96,4 @@ class SDManager {

/// @brief Internal File object that represents currently opened file on SD card
File file;
};

#endif
};
36 changes: 36 additions & 0 deletions src/comms/comms_layer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
#include "comms_layer.hpp"
#include "comms/data/configuration_status_data.hpp"
#include "comms/data/sendable.hpp"


/// @brief This resets the whole processor and kicks it back to program entry (teensy4/startup.c)
/// @param void specify no arguments (needed in C)
/// @note Dont abuse this function, it is not to be used lightly
extern "C" void reset_teensy(void) {
// Register information found in the NXP IM.XRT 1060 reference manual
SRC_GPR5 = 0x0BAD00F1;
// Register information found in the Arm-v7-m reference manual
SCB_AIRCR = 0x05FA0004;
// loop to catch execution while the reset occurs
while (1);
}

namespace Comms {

Expand Down Expand Up @@ -148,6 +163,27 @@ void CommsLayer::set_firmware_data(FirmwareData& data) {
m_firmware_data = data;
};

void CommsLayer::configure() {
int time = millis();
Sendable<ConfigurationStatusData> config_status_sendable;
while (!m_hive_data.config.config_start.num_config_sections != 0) {
Serial.printf("Waiting for config start packet... time since start: %d ms\n", millis() - time);
config_status_sendable.data.is_configured = 0;
config_status_sendable.send_to_comms();
run();
Comment thread
Rishi-H marked this conversation as resolved.
config_loop_timer.delay_micros(5000);
}
Serial.printf("Config start packet received, expecting %d config sections\n", m_hive_data.config.config_start.num_config_sections);

while(!m_hive_data.config.is_configured()) {
config_status_sendable.data.ready_for_config = 1;
config_status_sendable.send_to_comms();
run();
Serial.printf("Config: received %d of %d sections\n", m_hive_data.config.num_sections_received, m_hive_data.config.config_start.num_config_sections);
config_loop_timer.delay_micros(5000);
}
}

bool CommsLayer::initialize_hid() {
// Initialize the HID physical layer
m_hid.init();
Expand Down
13 changes: 11 additions & 2 deletions src/comms/comms_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "comms/data/packet_payload.hpp" // for PacketPayload
#include "comms/data/hive_data.hpp" // for HiveData
#include "comms/data/firmware_data.hpp" // for FirmwareData
#include "comms/config_data/robot_config.hpp" // for RobotConfig
#include "config_data/robot_config.hpp"

namespace Comms {

Expand All @@ -27,7 +29,8 @@ class CommsLayer {
/// @return Exit status, 0 for success, < 0 for error
/// @note Should never return
int run();

/// @brief Requests the configuration data from the Hive and waits until it is fully received before returning
void configure();
public:
/// @brief Send a CommsData packet to the appropriate packet payload
/// @param data The CommsData packet to send
Expand All @@ -52,6 +55,10 @@ class CommsLayer {
/// @brief Clear all physical layer outgoing buffers
void clear_outgoing_buffers();

/// @brief Check if the configuration process is complete
/// @return True if configuration is complete, false if not
bool is_configured() const { return m_hive_data.config.is_configured(); }

public:
/// @brief Get the outgoing ethernet packet
/// @return The outgoing ethernet packet
Expand Down Expand Up @@ -116,7 +123,9 @@ class CommsLayer {

/// @brief Firmware data
FirmwareData m_firmware_data;


/// @brief Timer for use in the configuration process
Timer config_loop_timer;
};

} // namespace Comms
Expand Down
Loading
Loading