2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
argos_lib::SwerveFSHomingStorage Class Reference

#include <fs_homing.h>

Inheritance diagram for argos_lib::SwerveFSHomingStorage:
argos_lib::SwerveHomeStorageInterface

Public Member Functions

 SwerveFSHomingStorage (const fs::path &swerveHomesPath)
 Construct a new File System Homing Storage object.
 
bool Save (const argos_lib::swerve::SwerveModulePositions &homePosition) override
 Save positions as new homes.
 
std::optional< argos_lib::swerve::SwerveModulePositionsLoad () override
 Load absolute positions that represent 0 degree module orientations.
 

Private Member Functions

fs::path GetFilePath ()
 Get the path of the file to load from and save to.
 

Private Attributes

const fs::path m_swerveHomesPath
 Path of persistent storage file relative to home directory.
 

Constructor & Destructor Documentation

◆ SwerveFSHomingStorage()

SwerveFSHomingStorage::SwerveFSHomingStorage ( const fs::path &  swerveHomesPath)
explicit

Construct a new File System Homing Storage object.

Parameters
swerveHomesPathFile path relative to home directory to save into and load from

Member Function Documentation

◆ GetFilePath()

fs::path SwerveFSHomingStorage::GetFilePath ( )
private

Get the path of the file to load from and save to.

Returns
fs::path Absolute path of persistent storage file

◆ Load()

std::optional< argos_lib::swerve::SwerveModulePositions > SwerveFSHomingStorage::Load ( )
overridevirtual

Load absolute positions that represent 0 degree module orientations.

Returns
Saved module positions if they exist, otherwise std::nullopt to indicate failure

Implements argos_lib::SwerveHomeStorageInterface.

◆ Save()

bool SwerveFSHomingStorage::Save ( const argos_lib::swerve::SwerveModulePositions homePosition)
overridevirtual

Save positions as new homes.

Parameters
homePositionPositions that represent 0 degree module orientations
Returns
true if save successful, false otherwise

Implements argos_lib::SwerveHomeStorageInterface.

Member Data Documentation

◆ m_swerveHomesPath

const fs::path argos_lib::SwerveFSHomingStorage::m_swerveHomesPath
private

Path of persistent storage file relative to home directory.


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