Smart Camera ESP32
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
Loading...
Searching...
No Matches
SystemControl Class Reference

Encapsulates the primary control authority of the turret. More...

#include <system_control_types.h>

Public Types

enum  Mode : uint8_t { USER_MODE = 0 , AI_MODE = 1 }
 Internal mode values. More...
 

Public Member Functions

constexpr SystemControl (Mode mode=AI_MODE)
 Construct a new SystemControl object.
 
bool is_ai () const
 Checks if the system is in AI mode.
 
bool is_user () const
 Checks if the system is in User mode.
 
Mode toggle_mode ()
 Toggles the state between USER_MODE and AI_MODE.
 
const char * to_string () const
 Converts the current mode to a human-readable string.
 
Mode get_mode () const
 Gets the underlying Mode enum.
 
 operator uint8_t () const
 Implicit conversion to uint8_t for simple storage.
 
bool operator== (Mode m) const
 Equality comparison with Mode enum.
 
bool operator!= (Mode m) const
 Inequality comparison with Mode enum.
 

Detailed Description

Encapsulates the primary control authority of the turret.

Provides a wrapper around system modes to allow for method-based state manipulation and string conversion.

Member Enumeration Documentation

◆ Mode

enum SystemControl::Mode : uint8_t

Internal mode values.

Enumerator
USER_MODE 

Manual override: Joystick inputs drive motors.

AI_MODE 

Autonomous: Computer Vision drives motors.

Constructor & Destructor Documentation

◆ SystemControl()

SystemControl::SystemControl ( Mode mode = AI_MODE)
inlineconstexpr

Construct a new SystemControl object.

Parameters
modeInitial mode (defaults to AI_MODE).

Member Function Documentation

◆ get_mode()

Mode SystemControl::get_mode ( ) const
inline

Gets the underlying Mode enum.

Returns
Mode.

◆ is_ai()

bool SystemControl::is_ai ( ) const
inline

Checks if the system is in AI mode.

Returns
true if AI_MODE.

◆ is_user()

bool SystemControl::is_user ( ) const
inline

Checks if the system is in User mode.

Returns
true if USER_MODE.

◆ to_string()

const char * SystemControl::to_string ( ) const
inline

Converts the current mode to a human-readable string.

Returns
const char* "USER_MODE" or "AI_MODE".

◆ toggle_mode()

Mode SystemControl::toggle_mode ( )
inline

Toggles the state between USER_MODE and AI_MODE.

Returns
The new Mode state after toggling.

The documentation for this class was generated from the following file: