2022-Robot
Robot code for 2022 FRC Season by Argos, FRC team #1756
Loading...
Searching...
No Matches
argos_lib::swerve::NetworkTablesHomingStorage Class Reference

Saves and loads swerve module homes to networkTables. More...

#include <network_tables_homing_storage.h>

Inheritance diagram for argos_lib::swerve::NetworkTablesHomingStorage:
argos_lib::swerve::SwerveHomeStorageInterface

Public Member Functions

 NetworkTablesHomingStorage (const std::string &tableName, const std::string &frontLeftPath, const std::string &frontRightPath, const std::string &rearRightPath, const std::string &rearLeftPath)
 Construct a new Network Tables Homing Storage object. More...
 
bool Save (const argos_lib::swerve::SwerveModulePositions &homePosition) override
 Save home positions to network tables. More...
 
std::optional< argos_lib::swerve::SwerveModulePositionsLoad () override
 Load home positions from network tables. More...
 
virtual bool Save (const SwerveModulePositions &homePosition)=0
 Save home position to persistent storage. More...
 
virtual std::optional< SwerveModulePositionsLoad ()=0
 Load home position from persistent storage. More...
 

Private Attributes

const std::string m_tableName
 
const std::string m_frontLeftPath
 
const std::string m_frontRightPath
 
const std::string m_rearRightPath
 
const std::string m_rearLeftPath
 

Detailed Description

Saves and loads swerve module homes to networkTables.

Constructor & Destructor Documentation

◆ NetworkTablesHomingStorage()

NetworkTablesHomingStorage::NetworkTablesHomingStorage ( const std::string &  tableName,
const std::string &  frontLeftPath,
const std::string &  frontRightPath,
const std::string &  rearRightPath,
const std::string &  rearLeftPath 
)

Construct a new Network Tables Homing Storage object.

Parameters
tableNameNetwork table name
frontLeftPathKey name for front left module
frontRightPathKey name for front right module
rearRightPathKey name for rear right module
rearLeftPathKey name for rear left module

Member Function Documentation

◆ Load()

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

Load home positions from network tables.

Returns
Loaded positions or nullopt if failed

Implements argos_lib::swerve::SwerveHomeStorageInterface.

◆ Save()

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

Save home positions to network tables.

Parameters
homePositionPositions to store
Returns
true if successful

Implements argos_lib::swerve::SwerveHomeStorageInterface.

Member Data Documentation

◆ m_frontLeftPath

const std::string argos_lib::swerve::NetworkTablesHomingStorage::m_frontLeftPath
private

◆ m_frontRightPath

const std::string argos_lib::swerve::NetworkTablesHomingStorage::m_frontRightPath
private

◆ m_rearLeftPath

const std::string argos_lib::swerve::NetworkTablesHomingStorage::m_rearLeftPath
private

◆ m_rearRightPath

const std::string argos_lib::swerve::NetworkTablesHomingStorage::m_rearRightPath
private

◆ m_tableName

const std::string argos_lib::swerve::NetworkTablesHomingStorage::m_tableName
private

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