Commit graph

8 commits

Author SHA1 Message Date
f7818c63ec Refactors source file naming convention
Updates source file names to adhere to a consistent lowercase convention, improving code maintainability and readability.

This change ensures consistency across the codebase and aligns with common coding standards.
2026-02-21 08:23:21 +00:00
adda211b76 Improves shutdown handling and adds logging
Adds logging to heart component and signal handler for improved debugging.
Changes signal handler to set a "StopPending" state to allow the main loop to handle shutdown.
Fixes a potential thread join issue during shutdown.
2026-02-20 17:07:10 +00:00
3a4e00a409 Adds basic logging and refactors main loop
Adds a basic logging system using std::clog with color codes for different log levels.
Refactors the main loop to use the logging system and improve readability.
Changes DixonNodeState to use atomic exchange for setting node status and logs status changes.
Removes the old main.cpp and adds a new one that uses a separate thread for signal handling.
Updates the CMakeLists.txt to link against gpiod and spdlog.
Moves version information into a version.txt file and creates a custom target to bump the version using a python script.
2026-02-20 15:27:42 +00:00
Russell Gilbert
c19687d91a Improves Dixon's shutdown and control flow.
Adds signal handling for graceful shutdown via SIGINT and SIGTERM.

Updates the control loop to be interruptible, allowing for a clean exit when a shutdown signal is received.

Changes the node state management to use an enum for clarity and better control the run states (starting, running, stopping, stopped).

The heartbeat is stopped when the node is stopping or stopped.

Also updates the line request to force an inactive state when claiming the pin.

Also updates the version number.
2026-02-12 09:53:29 +00:00
Russell Gilbert
1da934ba3c Updates executable name and dependency links
Renames the executable to lowercase and updates the corresponding dependency links in CMakeLists.txt.

Introduces a version file to manage the project's version.
2026-02-11 07:43:40 +00:00
Russell Gilbert
957f789faa Adds heartbeat functionality using GPIO
Introduces a heartbeat mechanism to the robot node using GPIO.
This allows for external monitoring of the node's active state.

The heartbeat is implemented using a GPIO pin that toggles
at a regular interval, indicating that the system is running.

Updates CMakeLists to link the project with gpiod libraries
staged locally.
Adds .gitignore entries for local dependencies and PC build directories.
2026-02-08 12:55:44 +00:00
Russell Gilbert
6a8f4f364b Refactors heart beat mechanism with gpiod
Updates the heart beat mechanism to use a prepared request to control the GPIO line, improving efficiency and code clarity.
Removes the direct line request in the beat function.
Switches to using pkg-config to manage dependencies and linker flags.
2026-02-07 06:44:18 +00:00
Russell Gilbert
5fcedb0fca Initializes project structure for Dixon Robot, config build & link
Sets up the initial project structure for the Dixon robot,
including core components and build configurations.

This commit lays the foundation for future development by:
- Adding necessary `.idea` files for IDE configuration,
  including `.gitignore`, `aws.xml`, `modules.xml`, `vcs.xml`,
  `editor.xml`, and `encodings.xml`
- Creating `Heart` component for managing heart beat with GPIO.
- Setting up CMakeLists.txt to define project dependencies and configurations,
  including specifying C++20 standard and linking necessary libraries.
2026-02-07 04:36:27 +00:00