Introduces a multi-threaded architecture where the brain operates in its own thread.
Establishes explicit MPSC channels for communication, enabling the main application (God) to send `LifecycleCommand` messages to the brain and receive status updates. This replaces the previous polling-based `update` loop with an event-driven model.
Defines a comprehensive `LifeState` enum for more granular and robust state management. The `LedPump` component is removed as its functionality is superseded by the new command-driven state transitions.
This architectural shift improves separation of concerns and lays the groundwork for more complex and responsive robot control.
Introduces an `increment` Cargo feature to control the automatic incrementing of the build number during the build process.
This change prevents the build number from incrementing on every build, providing more control for local development and specific release scenarios. The build number will now only increment when the `increment` feature is explicitly enabled.
Adds `cargo:rerun-if-changed=src/` to ensure the build script re-runs when source files change.
Introduces a build script to automatically increment a build number with each compilation.
This number is combined with the semantic version to create a full version string.
The full version is then exposed to the application and logged at startup, providing a unique identifier for each build to aid in tracking and debugging.
Adds a `LedPump` component to the `Brain` to execute logic periodically while in the `Running` state.
This establishes a basic timing mechanism that currently logs debug messages at a fixed interval, providing a foundation for future timed operations or state transitions. The default logging level is adjusted to `debug` to ensure these periodic events are visible.
Renames the `mod.rs` file for the `brain` module to `brain.rs`.
This simplifies the module path and aligns with standard Rust practices for modules defined entirely within a single file.
Replaces existing `println!` statements with `tracing::info!` macros for improved observability and debuggability.
Configures `tracing-subscriber` to enable structured logging, allowing for flexible filtering via `RUST_LOG` and compact, human-readable output by default.
Refactors the existing `RobotNode` module by renaming its directory and associated files to `Dixon`. This consolidates the core C++ robot node under a new name.
Introduces the initial `rustylee` module, establishing a foundational structure for the robot's brain. This new Rust component includes:
- A state machine (Starting, Running, Stopping, Stopped) to manage the brain's operational lifecycle.
- Graceful shutdown capabilities using a `ctrlc` signal handler.
- A main watchdog loop that orchestrates state transitions and responds to shutdown requests.
Introduces the `rustylee` Rust project with a basic "Hello, world!" application.
Configures cross-compilation for `aarch64-unknown-linux-gnu` targets using `cargo.toml`.
Adds a deployment script to automate pushing the compiled ARM64 binary to a remote host.
This enables development and deployment of Rust applications for the target environment.
Moves GPIO pin and chip definitions to a central
constants file for easier management and consistency.
Refactors the heart component to utilize these centralized
constants, enhancing code maintainability and readability.
Refactors the location of the heart module for better organization and clarity.
Updates the include paths and CMakeLists.txt to reflect the new location.
Increments the version number.
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.
Updates the version logging to use the DIXON_VERSION macro.
This allows the version to be dynamically injected at compile time, instead of a hardcoded string.
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.
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.
Simplifies the RobotNode build process by linking directly to system gpiod libraries instead of including a local copy. This reduces redundancy and ensures compatibility with the system's gpiod installation.
Adds a deployment script for easier deployment to the robot, streamlining the update process.
Also introduces a script to automatically fix symlinks during cross-compilation, ensuring that links resolve correctly on the target system.
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.
Replaces mutex with atomic booleans in DixonNodeState for improved thread safety. This eliminates the need for explicit locking in the connected_ and brainRunning_ accessors, reducing overhead and potential for deadlocks.
Updates version file.
Renames the executable to lowercase and updates the corresponding dependency links in CMakeLists.txt.
Introduces a version file to manage the project's version.
Implements an automatic versioning system for the robot node,
utilizing a `version.txt` file and a Python script to increment
the patch version.
Integrates the version into the CMake build process to ensure
the version is displayed in the robot node's output.
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.
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.
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.
Introduces a basic structure for the robot control node. This includes:
- A central brain component that manages the robot's logic.
- A state management system using a singleton to ensure thread-safe access to shared data.
- A simple main loop that can be started and stopped.
- Initial CMakeLists.txt and gitignore configurations.
This provides a foundation for implementing robot control logic.