#include <power_state_estimator.h>
Classes | |
struct | LogRecord |
Public Member Functions | |
AdvancedPowerStateEstimator () | |
PowerStateEstimate | estimate (const ros::Time &t) |
std::string | getMethodName () const |
PowerStateEstimator::Type | getMethodType () const |
virtual void | recordObservation (const PowerObservation &obs) |
Private Member Functions | |
bool | hasEverDischarged () const |
bool | readObservations (std::vector< LogRecord > &log) |
bool | saveObservation (const PowerObservation &obs) const |
Static Private Member Functions | |
static void | tokenize (const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=",") |
Private Attributes | |
std::vector< LogRecord > | log_ |
std::string | log_filename_ |
Static Private Attributes | |
static const std::string | DEFAULT_LOG_FILE = "/var/ros/power_monitor/power.log" |
A more advanced power state estimator which is informed by the history of the batteries.
Definition at line 87 of file power_state_estimator.h.
AdvancedPowerStateEstimator::AdvancedPowerStateEstimator | ( | ) |
Definition at line 82 of file power_state_estimator.cpp.
PowerStateEstimate AdvancedPowerStateEstimator::estimate | ( | const ros::Time & | t | ) | [virtual] |
Implements power_monitor::PowerStateEstimator.
Definition at line 131 of file power_state_estimator.cpp.
string AdvancedPowerStateEstimator::getMethodName | ( | ) | const [virtual] |
Implements power_monitor::PowerStateEstimator.
Definition at line 94 of file power_state_estimator.cpp.
PowerStateEstimator::Type AdvancedPowerStateEstimator::getMethodType | ( | ) | const [virtual] |
Implements power_monitor::PowerStateEstimator.
Definition at line 95 of file power_state_estimator.cpp.
bool AdvancedPowerStateEstimator::hasEverDischarged | ( | ) | const [private] |
Returns whether we've ever received a message that the power board is shutting down. If we have, then we can use the remaining capacity reported at that point to bias our prediction.
Definition at line 122 of file power_state_estimator.cpp.
bool power_monitor::AdvancedPowerStateEstimator::readObservations | ( | std::vector< LogRecord > & | log | ) | [private] |
void AdvancedPowerStateEstimator::recordObservation | ( | const PowerObservation & | obs | ) | [virtual] |
Reimplemented from power_monitor::PowerStateEstimator.
Definition at line 97 of file power_state_estimator.cpp.
bool AdvancedPowerStateEstimator::saveObservation | ( | const PowerObservation & | obs | ) | const [private] |
Definition at line 249 of file power_state_estimator.cpp.
static void power_monitor::AdvancedPowerStateEstimator::tokenize | ( | const std::string & | str, | |
std::vector< std::string > & | tokens, | |||
const std::string & | delimiters = "," | |||
) | [static, private] |
const std::string AdvancedPowerStateEstimator::DEFAULT_LOG_FILE = "/var/ros/power_monitor/power.log" [static, private] |
Definition at line 110 of file power_state_estimator.h.
std::vector<LogRecord> power_monitor::AdvancedPowerStateEstimator::log_ [private] |
Definition at line 118 of file power_state_estimator.h.
std::string power_monitor::AdvancedPowerStateEstimator::log_filename_ [private] |
Definition at line 120 of file power_state_estimator.h.